adk_runtime_policy (erlang_adk v0.7.0)
View SourceFail-closed runtime authorization and byte-budget policy.
A compiled policy is an immutable Erlang value. Agent and tool names must be explicitly allowed (or the corresponding allow selector must be all), and deny selectors always win. Content and tool arguments are measured at the runtime boundary without retaining their values.
Every check returns an immutable, JSON-safe audit decision. Decisions never contain arguments, content, credentials, exception text, pids, references, or functions. They can therefore be appended to an event/audit store by the caller without further redaction.
Summary
Functions
Authorize an agent invocation, then enforce the content budget.
Enforce the content budget for an already-authorized runtime value, such as a model response or tool result.
Authorize a resolved tool call, then enforce its canonical JSON argument budget. Runner integration must call this only after normal tool resolution, preserving dynamic toolset and plugin precedence.
Compile and strictly validate a policy.
JSON-safe policy metadata. Names are policy configuration, not runtime argument/content values.
Types
Functions
Authorize an agent invocation, then enforce the content budget.
Enforce the content budget for an already-authorized runtime value, such as a model response or tool result.
Authorize a resolved tool call, then enforce its canonical JSON argument budget. Runner integration must call this only after normal tool resolution, preserving dynamic toolset and plugin precedence.
Compile and strictly validate a policy.
Supported keys are id, agents, tools, max_argument_bytes, and max_content_bytes. Agent/tool rules are maps with allow and deny selectors. A selector is all or a list of UTF-8 binary names. Omitted allow selectors are empty, which is intentionally fail-closed.
JSON-safe policy metadata. Names are policy configuration, not runtime argument/content values.