Skip to content

fix(agent): authorize structured subagent results - #1317

Merged
jbeda merged 2 commits into
mainfrom
fix/subagent-structured-output-authority
Sep 9, 2026
Merged

jbeda merged 2 commits into
mainfrom
fix/subagent-structured-output-authority

Conversation

@jbeda

@jbeda jbeda commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A subagent can be asked to return data in a specific JSON shape with output_schema. For that kind of task, mecatl gives the subagent a temporary SubmitResult tool. The subagent calls that tool to hand back its final validated result.

When the parent session uses delegated authority, the child inherits a limited list of allowed tools. SubmitResult is intentionally not on that list: it is not a capability that grants access to files, commands, network services, or MCP tools. It is only an in-process result handoff for this one subagent run.

The bug was that the authority check treated SubmitResult like an ordinary delegated tool. As a result, the child was told to call it, but the call was denied because the tool name was absent from its allowed-tool list. The child could therefore never complete the requested structured result.

Fix

Register the temporary tool with private runtime metadata saying that it does not need delegated authority. All run-scoped tools remain authority-restricted by default; only the structured-output result handoff opts out. Normal catalog tools and external capabilities remain subject to delegated-authority checks.

Verification

  • task lint
  • cd engine && go test ./agent/
  • task test (fails in existing unrelated internal/app tests: TestReconcileStaleFireAfterSessionSettles and TestSessionDebuggerCrossBoundaryAcceptance)

@jbeda
jbeda merged commit eb0b651 into main Sep 9, 2026
31 checks passed
@jbeda
jbeda deleted the fix/subagent-structured-output-authority branch September 9, 2026 22:19
jbeda added a commit that referenced this pull request Sep 11, 2026
* commit 'cc6b16afbf7feec3e16451fdc590a3265fbf0c0b':
  docs: amend Shell diagnostic ownership (#1330)
  fix(mecatui): refresh status context on session continuation (#1328)
  fix(jsonlstore): preserve session saves with legacy lineage (#1327)
  test(sessiondebug): eliminate handle tampering flake (#1323)
  fix(agent): authorize structured subagent results (#1317)
  feat(mcp): support attachment-backed broker queries for CallMcpWithQuery (#1309)
  docs(agents): document full-gate timeout guidance (#1316)
  fix(server): let the stale-session sweep re-acquire a lost lease (#1302)
  feat(clientauth): headless Linux credential storage (#1291)
  chore(mcpbroker): trace protected call latency (#1314)

# Conflicts:
#	docs/acceptance/canonical-shell-command-tool.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant