The authorization flow
Agent requests a tool call
Your AI agent decides it wants to call a tool — for example,
file.write with a specific path.You call veto.authorize()
Before executing the tool, your code calls
veto.authorize() with the agent ID, tool name, and parameters.Veto evaluates policies
Veto retrieves the agent’s enabled policies, sorts them by priority, and evaluates each one in order until a decision is reached.
Calling authorize()
parameters — is optional but important. Pass the actual parameters the agent is using so that parameter_constraint rules can be evaluated correctly.
Authorization result fields
| Field | Type | Description |
|---|---|---|
allowed | boolean | Whether the action is permitted. |
outcome | "allowed" | "denied" | "escalated" | The authorization outcome. |
matchedPolicyId | string | null | The ID of the policy that produced the decision. null if the result is a default deny. |
reason | string | A human-readable explanation of the decision. |
evaluatedAt | string | ISO 8601 timestamp of when the evaluation occurred. |
How evaluation works
Veto evaluates policies using the following logic:- Sort by priority — enabled policies are sorted by
prioritydescending. The highest priority policy is evaluated first. - First match wins — evaluation stops as soon as a policy produces a definitive decision.
- Within a policy — each rule is evaluated. If any rule denies the request, the policy returns
denied. If all relevant rules pass, the policy returnsallowed. - Default deny — if no policy produces a decision (no relevant rules matched any policy), Veto denies the request.
"No policy explicitly allows this action (default deny)".
A policy only applies to a tool call if it has at least one rule relevant to that tool. Policies with no matching rules are skipped, and evaluation continues to the next policy.