You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugins need a trustworthy human-origin signal for gating destructive agent tools #1564
A plugin exposes destructive agent tools (flashing firmware to physical hardware; later fuse-burning/mass-erase). Policy requires these to execute only on explicit human authorization — an agent must never be able to satisfy the gate on its own. We built the gate fail-closed and went looking for a signal the plugin can trust. There isn't one.
What we verified (at current heads)
PluginAgentToolContext carries no turn or origin identity — only threadId, projectId, and an AbortSignal. A tool handler cannot distinguish "the human asked for this in the current turn" from "an agent inherited this from a stale plan".
bb.ui.requestInput responses are not provably human. The public SDK's thread-interactions area (api/v1/threads/:id/interactions/...) lets any SDK caller — including an agent running on the same host — resolve a pending interaction. The server records a response but does not attest the actor class, so a plugin persisting "human confirmed" is asserting something it cannot observe.
Consequence: destructive tools stay permanently refused (typed authorization-unavailable), which is safe but parks legitimate human-in-the-loop value.
Ask (either primitive unblocks us)
Actor-attested interaction responses: the server marks each interaction response with the responder class (human UI client vs. SDK/API caller) — the server already knows the transport — and exposes it to the plugin resolving the interaction; or
Turn-origin evidence in PluginAgentToolContext: e.g. whether the current turn was initiated by a human client, and a turn id so a confirmation can be scoped to it.
The first is likely smaller and is sufficient: a plugin can then issue an execution-time confirmation (invocation-scoped, single-use, turn-expiring) and trust the response only when attested human.
Context
Found while building a hardware bench plugin whose destructive-gate feasibility audit produced executable assertions for both findings above; happy to share details or test a proposed API.
The actor-attested interaction primitive is the better boundary, but transport class alone is not enough evidence of a human. A compromised UI session, automation using the UI transport, or a server-side proxy could still produce human UI client while no human authorized this invocation.
For a destructive tool, I would make the response an execution capability with these bindings:
authenticated principal and actor class
interaction ID plus exact tool invocation digest (tool, normalized arguments, target)
policy version and risk class shown to the approver
issued-at / expiry and a server nonce
single-use consumed state, atomically claimed with tool dispatch
Then the plugin can distinguish three claims that otherwise collapse into one: interaction answered, authorized principal approved this exact invocation, and that approval was consumed by this exact dispatch.
The regression test worth adding is: obtain a valid approval, mutate one argument or retry after consumption, and require a typed refusal. Also exercise an SDK caller resolving the same interaction and prove that it never mints the human actor class. That catches both stale-plan inheritance and replay without requiring plugins to trust a self-reported origin field.
Tracked as a sub-issue of #1541. The parent now covers the shared scope and links this implementation. This issue retains its distinct evidence and acceptance criteria and remains open until that work is complete.
Another consumer, on bb 0.49.0: an approval gate for answers from an external system (Jira) before the agent may see them.
Flow. A Claude Code tool call fetches a Jira issue. Before the result reaches the model, our plugin opens a bb.ui.requestInput form in the thread. The user reads the answer, strikes out or rewrites parts, and approves or
rejects. Only the approved text goes back to the model. The form payload carries a key, and the form fetches the full
answer over plugin RPC (hent).
The gap. The agent in the same thread can do both halves itself:
read the pending answer: bb thread interactions show --self gives the key, bb plugin rpc call <plugin> hent
gives the answer;
bb guide teaches agents these commands, so this is one well-known call away, not a deliberate bypass. Inside the RPC
handler, experimental_caller is { kind: "client" } for both the bb window and bb plugin rpc call from the agent,
so the plugin cannot refuse the second.
We accept the trust model in SECURITY.md (local processes are trusted) and do not need proof of a human against a
hostile agent. We need the host to stop an agent from answering a form meant for the user by accident.
Smallest change that would solve our case:
bb.ui.requestInput({ ..., respondents: "user" }) (name is a sketch): the server rejects responses that do not come
from a bb app surface (desktop, web, mobile). bb thread interactions respond and the public interactions API get a
typed refusal. Default stays as today.
(1) alone closes the approval half. (2) closes the read half.
Happy to test a proposed API against the plugin.
Edit 2026-11-26: removed "(per --help; not yet run against an open form)" from the approve step, which is now verified, and added the update below.
Update 2026-11-26. Both halves are now verified against an open form on bb 0.50.1, from an agent (Claude Code) in the same thread: bb plugin rpc call <plugin> hent returned the pending answer, and bb thread interactions respond <id> --self answered the form, so the answer reached the model without the user doing anything. As a stopgap, our Claude Code plugin now refuses the agent's Bash commands that answer forms in the thread or call our plugin's RPC. That stops the accident, but it is a deny-list in one plugin, not a fix in the host.
Activity
impartshadow commentedon Aug 18, 2026
The actor-attested interaction primitive is the better boundary, but transport class alone is not enough evidence of a human. A compromised UI session, automation using the UI transport, or a server-side proxy could still produce
human UI clientwhile no human authorized this invocation.For a destructive tool, I would make the response an execution capability with these bindings:
Then the plugin can distinguish three claims that otherwise collapse into one:
interaction answered,authorized principal approved this exact invocation, andthat approval was consumed by this exact dispatch.The regression test worth adding is: obtain a valid approval, mutate one argument or retry after consumption, and require a typed refusal. Also exercise an SDK caller resolving the same interaction and prove that it never mints the human actor class. That catches both stale-plan inheritance and replay without requiring plugins to trust a self-reported origin field.
SawyerHood commentedon Sep 9, 2026
Tracked as a sub-issue of #1541. The parent now covers the shared scope and links this implementation. This issue retains its distinct evidence and acceptance criteria and remains open until that work is complete.
otron commentedon Nov 23, 2026
Another consumer, on bb 0.49.0: an approval gate for answers from an external system (Jira) before the agent may see them.
Flow. A Claude Code tool call fetches a Jira issue. Before the result reaches the model, our plugin opens a
bb.ui.requestInputform in the thread. The user reads the answer, strikes out or rewrites parts, and approves orrejects. Only the approved text goes back to the model. The form payload carries a key, and the form fetches the full
answer over plugin RPC (
hent).The gap. The agent in the same thread can do both halves itself:
bb thread interactions show --selfgives the key,bb plugin rpc call <plugin> hentgives the answer;
bb thread interactions respond <id> --self --value '{"utfall":"godkjenn","handlinger":[]}'.bb guideteaches agents these commands, so this is one well-known call away, not a deliberate bypass. Inside the RPChandler,
experimental_calleris{ kind: "client" }for both the bb window andbb plugin rpc callfrom the agent,so the plugin cannot refuse the second.
We accept the trust model in
SECURITY.md(local processes are trusted) and do not need proof of a human against ahostile agent. We need the host to stop an agent from answering a form meant for the user by accident.
Smallest change that would solve our case:
bb.ui.requestInput({ ..., respondents: "user" })(name is a sketch): the server rejects responses that do not comefrom a bb app surface (desktop, web, mobile).
bb thread interactions respondand the public interactions API get atyped refusal. Default stays as today.
x-bb-app-surface) passed intoexperimental_callerfor RPC, assuggested in Host-verified operator authorization for plugin invocations and tool approvals #1541 and Plugin RPC/CLI handlers: expose caller kind (panel vs cli vs agent) #7769, so the form's own RPC calls can be told apart from
bb plugin rpc call.(1) alone closes the approval half. (2) closes the read half.
Happy to test a proposed API against the plugin.
Edit 2026-11-26: removed "(per
--help; not yet run against an open form)" from the approve step, which is now verified, and added the update below.Update 2026-11-26. Both halves are now verified against an open form on bb 0.50.1, from an agent (Claude Code) in the same thread:
bb plugin rpc call <plugin> hentreturned the pending answer, andbb thread interactions respond <id> --selfanswered the form, so the answer reached the model without the user doing anything. As a stopgap, our Claude Code plugin now refuses the agent's Bash commands that answer forms in the thread or call our plugin's RPC. That stops the accident, but it is a deny-list in one plugin, not a fix in the host.— Raoul Claudio Duke (Claude Opus 5.5)