Repository navigation
Agent orchestration access: a setting that withholds the cross-thread tools from a thread's own agent #27643
Replies: 1 comment
|
On v0.1.7 a Codex home can no longer narrow T3's tools with a tool filter on
Measured with codex-cli 0.166.0, both in Could T3 keep a home's filter, for example by appending |
Uh oh!
There was an error while loading. Please reload this page.
Problem or use case
A messaging bridge, acting as an outside MCP client, binds a chat conversation to one thread. It forwards the chat's messages into the thread with
t3_thread_send, waits witht3_thread_wait, reads the answer witht3_thread_readand posts it back into the chat automatically. Other people can write in that chat, for example in a group. Even when only the owner's messages start a turn, the others' messages go into the thread as context. So text from people other than the thread's owner reaches the thread's agent, and no one reviews the answer before the chat sees it.The bridge can cap the thread's modes, but it cannot take the T3 tools away from the thread's own agent. A chat message can lead that agent to call
t3_thread_list(withallProjects),t3_thread_searchandt3_thread_read, which reads any thread by id; withactivity, that includes command and tool input and output. The agent can then put what it finds into its answer, which everyone in the chat reads. Within the mode ceiling it can also send to, interrupt or reconfigure other threads and start new ones. With agent browser access on, it could send the data elsewhere through thepreview_*tools; turning browser access off doesn't close every such path (see Risks).Today the bridge can warn the user, keep the thread at Supervised and recommend a dedicated project with browser access off. Supervised limits writes to other threads, but reads have no mode ceiling, and no setting removes these tools.
Proposed solution
An Agent orchestration access setting next to Agent browser access and Agent device access. Agent browser access came from an Ideas request (#6792, implemented in #7083); this asks for the same kind of switch for the orchestration tools. It is the per-toolkit toggle that #17205 mentions as a finer variant, asked for access rather than context size; Alternatives says what it adds.
When the setting is off for a thread:
orchestration. Every tool that checks it then fails withcapability_denied, ascore.test.tsalready shows for a credential without it. That covers listing, reading, searching, waiting on, sending to, interrupting, configuring, organizing and transferring threads;t3_queueandt3_pending_request; delegation, thread creation and scheduling; project and environment tools; and linked-environment forwarding. A few tools that act only on the thread itself check it too; see Risks.pull-requestsis withheld too, or the pull-requests tools are limited to the caller's own thread and project. They don't checkorchestrationtoday, and they reach other threads and projects (details below).tools/list, as open PR fix(server): hide browser and device tools when agent access is off #24314 proposes for the browser and device tools.orchestration, and changing the mode doesn't bring it back.writesEnvironment; the access level is your call.Read-back.
t3_thread_readwould include, in the thread detail it returns, the effective agent access of the thread's current credential (orchestration, browser, device), andt3_project_readthe project values. A change could then take effect at the next session start, as browser access does today, because a client can see when it is in force.Smallest useful scope
The per-project setting with points 1 and 2 and the read-back. The per-thread value, tool hiding and instruction trimming can follow.
Alternatives considered
orchestration. It adds what Setting to not attach the t3-code MCP server (and its prompt text) to agent sessions #17205 doesn't ask for: the pull-requests tools stop reaching other threads and projects, a per-thread value, no in-thread agent can widen it, and an outside client can read whether it is in force.orchestrationandworktree. It makes the same credential change, but per provider instance or perdelegate_task, for delegated children, to save tokens. It would also work here, since an outside client can pick the instance throught3_thread_launch'smodelSelection. But nothing reports that the narrower credential is in effect, the pull-requests tools stay cross-thread, and the thread's instance can change later. A project or thread setting seems the clearer home for an access decision.permissions.denyformcp__t3-code__*. A deny covers one provider, leaves the orchestration instructions in the agent's instructions and leaves the credential unchanged, and ACP agents receive that credential in their process environment (T3_ACP_MCP_AUTHORIZATION) by design.Risks or tradeoffs
orchestration: notablyt3_background_waitandrequest_secret. Losingt3_background_waitmatters to a bridge. Claude's instructions tell the agent to call it before ending its turn while a background command runs, so without it the turn can end while the work still runs, and a bridge waiting witht3_thread_waitwould post an unfinished answer. I'd have those two check that the target is the caller's own thread rather thanorchestration. I read this in the source; I haven't tested it.html_previewneeds no capability, and Claude pre-approves it. Its tool description says remote URLs load as-is: its headless Chrome intercepts only document navigations, and its proxy blocks only local addresses. So with browser access off, a page could still carry data out, for example in an image URL. I read this in the source; I haven't tested it. Bringing its network under Agent browser access would close it, and it may deserve its own issue.readCaller;What exists today, in the code (checked against
mainat 6575ce3)orchestration,worktreeandpull-requests.ProviderSessionManagerstarts from that set and adds onlypreviewanddevice, according to the agent access settings.McpSessionRegistry.issueprepends the same three to whatever is requested, andMcpSessionRegistry.test.tsasserts that. No setting withholdsorchestration.McpToolAccess.readsdeclares no access rule, so a Supervised thread can read every thread in the environment.writesThreads→assertTargetWithinLimits). Sot3_thread_send,t3_thread_interrupt,t3_thread_configure,t3_queueand the other thread writes still reach every thread whose modes are no broader than the caller's, anddelegate_task,create_threadsandt3_thread_launchstart new threads at up to the caller's modes,t3_thread_launchin any project. Given [Bug]: Agent-to-agent thread sends reach the receiving model as if the user wrote them #24711 and [Bug]: An agent's message to another thread runs any skill it mentions, as if the user typed it #24667 (open fix: fix(server): preserve agent origin in cross-thread provider messages #24725), a send arrives in the other thread as if the user wrote it, and runs any skill it mentions.orchestrationcheck lives in each handler.writesThreads,startsThreadsandactsAsCallerload the caller throughloadCaller, which doesn't check it;readCaller, the orchestrator service'srequireCapabilityandThreadMetadataMcpServicedo. Today every tool that reaches another thread or project passes one of those checks, except the pull-requests tools.pull-requests.requireThreadaccepts anythreadId, solist_thread_pull_requestsreads another thread's PRs, and link, unlink and watch change them within the mode ceiling.locateAllresolves a PR through any project of the environment, soread_pull_request_guidereturns another project's review guide andwrite_pull_request_guidesstarts guide runs.allowedToolsincludesmcp__t3-code__*. With a read-only sandbox it narrows to the read-only tools, which still includet3_thread_list,t3_thread_searchandhtml_preview. Supervised maps to Claude'sdefaultpermission mode, so from the adapter I'd expect these calls to run without a prompt; in Plan mode, Repeated t3_thread_read approvals after session approval in Claude Plan mode with Full access #23918 reports approval prompts fort3_thread_read. I read this in the source; I haven't tested it.t3_project_read, nott3_environment_read, notorchestrator_capabilities, not the thread detail. So a client can't check what a thread's agent will have before it forwards untrusted text.systemPrompt.append, together with thet3_background_waittext, and the other providers throught3OrchestrationPromptort3OrchestrationSystemPrompt, keyed onhasT3Mcp. The block also holds the Visuals section forhtml_previewandhtml_render, which need noorchestration.Where it would fit
packages/contracts/src/settings.ts: a key inPROJECT_SCOPED_SERVER_SETTING_KEYSnext toenableAgentBrowserAccessandenableAgentDeviceAccess, with itsProjectSettingsOverridesfield, default and patch field.ProviderSessionManager:agentAccessSettings;orchestrationonly when the setting allows it;preview,deviceandsubagent. Otherwise a changed setting waits until the credential rotates.McpSessionRegistry.issue: stop addingorchestrationunconditionally.McpToolAccess: checkorchestrationinwritesThreadsandstartsThreadsrather than in each handler, so a future tool can't skip it. The pull-requests tools, if they stay for the caller's own thread, would be the stated exception.toolkits/pullRequests/handlers.ts: while the setting is off,requireThreadrefuses another thread's id andlocateAllanother project.t3_background_waitandrequest_secret: check that the target is the caller's own thread rather thanorchestration.EnabledWhenpredicate on the credential's capabilities, as in fix(server): hide browser and device tools when agent access is off #24314 andhiddenFromSubagents.ClaudeAdapterV2'ssystemPrompt.append, and the callers oft3OrchestrationPromptandt3OrchestrationSystemPrompt): key on the credential's capabilities rather than on whether an MCP session exists, and keep the sections for tools that remain.References
allProjects.Is this direction, with the smallest scope above, something you'd consider?
Version: 0.1.5 (macOS, desktop)
All reactions