Skip to main content

ALLOWED_TOOLS_ROLE

Constant ALLOWED_TOOLS_ROLE 

Source
pub const ALLOWED_TOOLS_ROLE: &str = "agentd/allowed-tools";
Expand description

The reserved SeedMessage::role that carries a child’s tool allow-listsubagent.run’s tools: narrowing, which is how scope narrows monotonically down the tree. Minted by the supervisor with SpawnPayload::narrow_tools, enforced by the child in crate::agentloop::runner::Session::prepare, which filters its assembled catalogue AND its dispatch against it.

The grant rides context_seed because that is the one part of the payload the child forwards VERBATIM into the loop’s LoopInput (subagent/control.rs), so it reaches the one place the catalogue is assembled without a second adapter hop. The loop CONSUMES it — it is a grant, not a message, and never enters the transcript. The slash makes it uninhabitable by a real role (system/user/ assistant/tool), and the direction is fail-safe: a marker can only ever REMOVE tools from the grant the supervisor already made, never add one.