Skip to main content
A policy is a set of rules that determines what tools an agent can call and under what conditions. When you call POST /v1/authorize, Veto evaluates all enabled policies for the agent in priority order (highest first) and returns the first matching decision.

The policy object

id
string
required
UUID of the policy.
agentId
string
required
UUID of the agent this policy governs.
name
string
required
Display name of the policy.
rules
PolicyRule[]
required
Ordered list of rules. See Policy rules below.
priority
number
required
Evaluation order. Higher values are evaluated first. Defaults to 0. Range: 01000.
enabled
boolean
required
Whether the policy is active. Disabled policies are skipped during authorization.
createdAt
string
required
ISO 8601 timestamp of when the policy was created.
updatedAt
string
required
ISO 8601 timestamp of when the policy was last updated.

POST /v1/policies

Create a new policy for an agent.
Requires an API key with the admin scope.

Request body

agent_id
string
required
UUID of the agent to attach this policy to. Must belong to your workspace.
name
string
required
Display name for the policy. Between 1 and 255 characters.
rules
PolicyRule[]
required
List of rules. Must contain between 1 and 50 rules. See Policy rules above for the rule schema.
priority
number
default:"0"
Evaluation priority. Higher values run first. Range: 01000.
enabled
boolean
default:"true"
Whether the policy is active immediately on creation.
Returns 201 with the created Policy object.

GET /v1/policies

List all policies in your workspace. Optionally filter by agent.

Query parameters

agent_id
string
Filter results to policies attached to this agent UUID.
Returns an array of Policy objects.

GET /v1/policies/:id

Retrieve a single policy by its UUID. Returns the Policy object, or 404 with POLICY_NOT_FOUND.

PATCH /v1/policies/:id

Update a policy’s name, rules, priority, or enabled state.
Requires an API key with the admin scope.

Request body

All fields are optional. Supply only the fields you want to change.
name
string
New display name. Between 1 and 255 characters.
rules
PolicyRule[]
Replacement rule set. Replaces all existing rules. Must contain between 1 and 50 rules.
priority
number
New evaluation priority. Range: 01000.
enabled
boolean
Enable or disable the policy.
Returns the updated Policy object, or 404 with POLICY_NOT_FOUND.

DELETE /v1/policies/:id

Delete a policy.
Requires an API key with the admin scope.
Returns 204 No Content on success, or 404 with POLICY_NOT_FOUND.
curl --request POST \
  --url https://api.veto.tools/v1/policies \
  --header 'Authorization: Bearer veto_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Production safeguards",
    "priority": 10,
    "enabled": true,
    "rules": [
      {
        "type": "tool_denylist",
        "tools": ["db.drop", "db.truncate", "fs.delete"]
      },
      {
        "type": "parameter_constraint",
        "tools": ["file.write"],
        "parameters": {
          "path": {
            "regex": "^/home/user/"
          }
        }
      },
      {
        "type": "rate_limit",
        "tools": ["web.search"],
        "rateLimit": {
          "maxCalls": 50,
          "windowSeconds": 3600
        }
      },
      {
        "type": "time_based",
        "tools": ["*"],
        "timeWindow": {
          "allowedHours": [9, 10, 11, 12, 13, 14, 15, 16, 17],
          "allowedDays": [1, 2, 3, 4, 5],
          "timezone": "America/New_York"
        }
      }
    ]
  }'
{
  "id": "p9f1a2b3-c4d5-6789-efab-012345678901",
  "agentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Production safeguards",
  "priority": 10,
  "enabled": true,
  "rules": [
    {
      "type": "tool_denylist",
      "tools": ["db.drop", "db.truncate", "fs.delete"]
    },
    {
      "type": "parameter_constraint",
      "tools": ["file.write"],
      "parameters": {
        "path": { "regex": "^/home/user/" }
      }
    },
    {
      "type": "rate_limit",
      "tools": ["web.search"],
      "rateLimit": { "maxCalls": 50, "windowSeconds": 3600 }
    },
    {
      "type": "time_based",
      "tools": ["*"],
      "timeWindow": {
        "allowedHours": [9, 10, 11, 12, 13, 14, 15, 16, 17],
        "allowedDays": [1, 2, 3, 4, 5],
        "timezone": "America/New_York"
      }
    }
  ],
  "createdAt": "2024-11-15T10:00:00.000Z",
  "updatedAt": "2024-11-15T10:00:00.000Z"
}