Expand description
Capability taxonomy, derivation functions, and the pure gate decision
engine (#587, #591).
One tool call requires a set of Capabilitys (derived from its spec’s
MCP-style annotations plus its registry provenance) and is granted a set
(derived from the agent’s policy plus the conversation’s provenance/taint
state at that moment). decide compares them and returns the single
GateOutcome for the call — the one decision path that replaces the
previous OR of an argument-aware policy check, a sandbox-denial escalation,
and a runtime “untrusted content + egress” override.
The containment invariants live here as pure logic, testable exhaustively:
- Untrusted content in context removes
Capability::ArbitraryEgressandCapability::MutateExternalfrom the granted set — a message body or an issue title carries attacker-steered bytes out as surely as a fetch does. - An operator-declared taint-resilient set survives that subtraction, and
only when the policy declares it (
GrantPolicy::taint_resilient). - A tool whose spec cannot be classified requires the full privileged set
(
CapabilitySet::all) — fail closed. - The model is monotonic: under a fixed policy, adding taint never adds a capability.
Everything here is a pure function over its inputs. No gate wiring, no IO,
no clock: the executor surface (#592) derives the inputs and the agent’s
per-call gate (#593) is a thin adapter over decide.
Structs§
- Call
Policy - The per-call policy verdicts
decidefolds into the one outcome. - Capability
Set - A set of
Capabilitys. Small,Copy, and closed under the usual set algebra — the decision engine works only through these operations. - Grant
Policy - The agent’s configured capability policy — the operator-controlled half of grant derivation.
- Tool
Profile - The classification inputs for one tool: its spec’s MCP-style annotations plus its registry provenance.
Enums§
- ArgTransform
- An argument transform the argument-aware dispatch policy asked for, honored only when the call is otherwise allowed.
- Capability
- One thing a tool call can do — the unit of the containment model.
- Gate
Outcome - The single unified gate result for one tool call — replaces both the
argument-aware
ToolDecisionand theneeds_approval/override booleans. - Taint
State - Whether untrusted content is in the conversation’s context at this gate decision.
- Tool
Origin - Where a tool comes from — the registry-provenance half of classification.
Constants§
- NATIVE_
SEARCH_ GROUNDING - Scoping/audit name for the LLM provider’s native web-search-grounding
primitive (issue
#1226). - TAINT_
REVOKED - The capabilities that untrusted content in context revokes: both channels that carry model-authored bytes to destinations an attacker may read.
Functions§
- decide
- The one pure decision: compare what the call requires with what it is
granted, under the argument-aware policy verdicts, and return the single
GateOutcome. - escalation_
reason - The plain-language reason for a missing-capability escalation, rendered verbatim on the approval card on every edge (one shared helper so the wording never differs by surface).
- granted_
capabilities - Derive the capabilities granted to one gate decision from the agent’s policy and the provenance state at that moment.
- monotonic_
redeclaration - Clamp a re-declared profile so a connector’s runtime annotation change can
only ever ADD required capabilities (
#598). - required_
capabilities - Derive the capabilities a tool call requires from its profile — the spec’s existing annotations plus registry provenance. No new hand-written per-tool metadata.