Skip to main content

Policies Overview

Policies define the rules that govern what an agent is permitted to do. Each policy is a JSON document containing a set of prioritised rules with conditions. Vectra evaluates policies as the first step in the decision pipeline.


Domain Model

PolicyDefinition

PropertyTypeDescription
NamestringUnique policy identifier (matches filename without .json)
Descriptionstring?Human-readable description
OwnerstringOwner team or identifier
CreatedOnDateTime?Creation timestamp
DefaultPolicyTypeDefault effect if no rule matches: Allow or Deny
RulesList<PolicyRule>Ordered list of rules (evaluated by priority)

PolicyRule

PropertyTypeDescription
NamestringRule identifier
Reasonstring?Human-readable reason shown in decision audit
PriorityintHigher value = evaluated first
EffectPolicyTypeAllow, Deny, or Hitl
ConditionsList<PolicyRuleCondition>All conditions must match (logical AND)

PolicyRuleCondition

PropertyTypeDescription
FieldstringInput field path (e.g., input.method, input.path)
OperatorstringComparison operator (see below)
ValueobjectValue to compare against

Supported Operators

OperatorDescription
eqEquals
neNot equals
gtGreater than
ltLess than
geGreater than or equal
leLess than or equal
inValue is in array
containsString contains substring
startswithString starts with value
endswithString ends with value
regexRegex match

Available Input Fields

Conditions can reference any field in the RequestContext using dot notation under the input. prefix:

FieldDescription
input.methodHTTP method (GET, POST, DELETE, …)
input.pathRequest path and query (/users/123)
input.agentIdAgent GUID
input.policyNameAssigned policy name
input.trustScoreAgent trust score (0.0–1.0)
input.targetUrlFull target URL
input.bodyRaw request body (string)

Policy File Format

Policies are stored as .json files in the directory configured under Policy.Providers.Internal.Directory.

policies/billing-policy.json
{
"name": "billing-policy",
"description": "Governs the billing agent",
"owner": "team-finance",
"default": "Deny",
"rules": [
{
"name": "block-delete",
"reason": "Billing agent must never delete resources",
"priority": 100,
"effect": "Deny",
"conditions": [
{ "field": "input.method", "operator": "eq", "value": "DELETE" }
]
},
{
"name": "require-hitl-for-bulk-export",
"reason": "Bulk exports require human approval",
"priority": 90,
"effect": "Hitl",
"conditions": [
{ "field": "input.path", "operator": "regex", "value": "/export|/bulk" }
]
},
{
"name": "allow-read",
"reason": "Read access is permitted",
"priority": 10,
"effect": "Allow",
"conditions": [
{ "field": "input.method", "operator": "in", "value": ["GET", "HEAD"] }
]
}
]
}

Evaluation Order

  1. Rules are sorted by Priority (descending — highest first).
  2. Each rule's conditions are evaluated with logical AND — all must match.
  3. The first matching rule determines the outcome (Allow, Deny, or Hitl).
  4. If no rule matches, the Default effect is applied.

API Endpoints

Base path: /policies

List Policies

GET /policies?page=1&pageSize=25

Get Policy Details

GET /policies/{name}

See the API Reference for full request/response schemas.


OPA Integration

For advanced policy scenarios (e.g., complex Rego rules, external data), configure the OPA provider. See Policy Configuration for setup details.