#[non_exhaustive]pub enum Safeguard {
Authority,
Scope,
UntrustedOutput,
Approval,
Egress,
}Expand description
A safety property every agent with tools must have before it can run.
The kernel does not implement these: a hook declares the ones it provides
through crate::Hook::safeguards, or the composition root attests one
that something else enforces (for example its own tool adapter) with
crate::AgentBuilder::attest. crate::AgentBuilder::build refuses an
agent with tools that leaves any of them uncovered, so forgetting to wire
a policy is a build error instead of a silent hole.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Authority
Every call stays within the authority explicitly granted by whoever owns the agent (owner configuration, role, grants, modes). That grant may be full by the owner’s choice; approval prompts are one way to enforce a narrower grant, not a requirement.
Scope
Calls stay inside the paths and resources the task was granted.
UntrustedOutput
Output from tools the agent does not control (web pages, MCP servers, third-party APIs) reaches the model marked as data, not instructions, and calls with egress made after reading it are verified by a clean check or, by the owner’s explicit choice, recorded.
Approval
Calls that need the owner’s approval are put to the owner (as an
crate::InterruptKind::OwnerApproval interruption) before they run,
unless a standing grant already covers them.
Egress
Outbound calls (egress annotations or effects) never carry credentials or other secrets off the machine.