Expand description
Interventions: policies that inspect and gate the agent’s lifecycle.
An InterventionHandler returns an InterventionAction at each lifecycle point it
overrides: proceed, deny, guide, confirm (ask a human) or transform. Pass handlers to
AgentConfig::interventions; they run in registration
order, after the agent’s other hooks on Before* events and before them on After* events.
Ready-made handlers are in vended_interventions.
Structs§
- Confirm
- Asks a human to approve the tool call (
Confirm); onlybefore_tool_callsupports it. - Deny
- Blocks the operation (
Deny): onBefore*events the cancel message isDENIED: <reason>, which the model sees. - Evaluate
- Decides whether a human’s response approves a
Confirm. - Guide
- Steers the model with feedback (
Guide). - Proceed
- Lets the operation continue unchanged (
Proceed). - Transform
- Mutates the event in place before execution continues (
Transform); later handlers see the change. An error from the mutation is handled by the handler’son_errorpolicy.
Enums§
- Intervention
Action - What a handler decides at a lifecycle point (
InterventionAction), for the eventEit was given. - OnError
- What happens when a handler fails during evaluation (
OnError).
Traits§
- Intervention
Handler - A policy evaluated at the agent’s lifecycle points (
InterventionHandler).
Functions§
- default_
evaluate - The default approval test of a
Confirm:true, or"y"/"yes"(case-insensitive, trimmed of Unicode whitespace other thanU+0085, plusU+FEFF).
Type Aliases§
- Intervention
Result - What a lifecycle method returns: the action for its event, or an error that the handler’s
OnErrorpolicy resolves.