Compiles an effective policy into adapter-specific options.
Provider-side enforcement is best-effort: when a provider supports
native tool restrictions or output limits, the compiler maps policy
constraints into the appropriate adapter_opts.
When a provider does not support a constraint natively, the constraint is left to the reactive enforcement path (event callback + cancel).
Supported Provider Mappings
| Constraint | Claude | Codex | Amp |
|---|---|---|---|
| Tool allow/deny | allowed_tools | allowed_tools | allowed_tools |
| Max output tokens | max_tokens | max_tokens | max_tokens |
Other constraints (token budget, duration, cost) are enforced reactively.
Summary
Functions
Compiles a policy into adapter options for provider-side enforcement.
Functions
@spec compile(AgentSessionManager.Policy.Policy.t(), String.t()) :: keyword()
Compiles a policy into adapter options for provider-side enforcement.
Returns a keyword list of adapter options to merge into adapter_opts.