Modes
allowdenyapproval_required— see Approval-required tool calls
Applying a policy in code
create_agent(...) stays close to LangChain; policy enforcement is applied after
agent creation with enforce_policy(...), which accepts either a Pydantic
AgentPolicy or a YAML file path:
Per-role policies
Agents that need per-role behaviour ship apolicies/ directory (one file per
role, with inheritance) instead of a single policy.yaml. A legacy single-file
policy.yaml is treated as the default role — no migration needed. See
Request context + roles for the
multi-file shape and inheritance rules.