Skip to main content

Policy Configuration

Define fine-grained access control policies for AI agents with condition-based rules, escalation paths, and compliance enforcement.

Overview

Agent policies enable organizations to enforce governance rules at the agent level, controlling what actions agents can perform and under what conditions.

Source: ow-ai-backend/models_agent_registry.py

Compliance: NIST AC-3, PCI-DSS 7.1, HIPAA 164.312(a)

Policy Structure

AgentPolicy Model

FieldTypeDescription
policy_nameStringHuman-readable name
policy_descriptionTextPurpose description
is_activeBooleanEnabled status
priorityIntegerEvaluation order (lower = higher)
conditionsJSONBWhen policy applies
policy_actionStringWhat happens
action_paramsJSONBAction configuration

Policy Actions

ActionDescriptionUse Case
allowPermit the actionLow-risk operations
blockDeny the actionProhibited operations
require_approvalQueue for human reviewMedium-risk operations
escalateSend to security teamHigh-risk operations

Creating Policies

Example: Block High-Risk Transactions

{
"policy_name": "Block High-Risk Transactions",
"policy_description": "Prevent autonomous agents from processing high-value transactions",
"is_active": true,
"priority": 10,
"conditions": {
"action_type": "transaction",
"risk_above": 70,
"agent_type": "autonomous"
},
"policy_action": "block",
"action_params": {
"notification": "security-team@company.com",
"audit_level": "critical"
}
}

Example: Require Approval for PII Access

{
"policy_name": "PII Access Approval",
"policy_description": "Require human approval for any PII data access",
"is_active": true,
"priority": 20,
"conditions": {
"resource_type": "pii",
"action_type": ["read", "write", "delete"]
},
"policy_action": "require_approval",
"action_params": {
"approvers": ["compliance-team"],
"timeout_hours": 24,
"escalate_on_timeout": true
}
}

Example: Escalate Database Deletes

{
"policy_name": "Database Delete Escalation",
"policy_description": "Escalate all database delete operations",
"is_active": true,
"priority": 5,
"conditions": {
"action_type": "database_delete"
},
"policy_action": "escalate",
"action_params": {
"escalate_to": "security-team",
"notification_channel": "slack",
"webhook_url": "https://hooks.slack.com/..."
}
}

Condition Syntax

Available Condition Fields

FieldTypeDescription
action_typestring/arrayAction type filter
agent_typestringAgent classification
risk_aboveintegerMinimum risk score
risk_belowintegerMaximum risk score
resource_typestringTarget resource type
time_windowobjectTime-based restrictions
data_classificationstring/arrayData sensitivity

Condition Operators

OperatorDescriptionExample
Direct valueExact match"action_type": "transaction"
ArrayAny match"action_type": ["read", "write"]
RangeNumeric comparison"risk_above": 70
ObjectComplex condition"time_window": {"outside": "09:00-17:00"}

Policy Priority

Policies evaluated in priority order (lower number = higher priority):

Priority 1:  Block Critical Actions
Priority 10: Require Dual Approval
Priority 20: Standard Approval
Priority 100: Default Allow

Priority Guidelines

Priority RangeUse Case
1-10Critical security blocks
11-50High-priority restrictions
51-100Standard governance
101-500Organizational rules
501+Default/fallback policies

Action Parameters

Block Action Params

{
"notification": "security@company.com",
"audit_level": "critical",
"log_reason": true,
"alert_on_repeated": true
}

Require Approval Params

{
"approvers": ["team-leads", "security"],
"timeout_hours": 24,
"escalate_on_timeout": true,
"require_justification": true,
"min_approvers": 1
}

Escalate Params

{
"escalate_to": "security-team",
"notification_channel": "slack",
"webhook_url": "https://...",
"include_context": true,
"severity": "high"
}

Agent-Level Policies

Per-Agent Configuration

Each registered agent can have specific policies:

{
"agent_id": "financial-advisor-001",
"policies": [
{
"policy_name": "Transaction Limit",
"conditions": {
"action_type": "transaction",
"amount_above": 10000
},
"policy_action": "require_approval"
}
]
}

Agent Policy Inheritance

  1. Global organization policies (highest priority)
  2. Agent-type policies
  3. Agent-specific policies
  4. Default allow (lowest priority)

Compliance Mapping

NIST AC-3 (Access Enforcement)

ControlImplementation
AC-3(1)Role-based policy assignment
AC-3(2)Dual authorization support
AC-3(3)Mandatory access control

PCI-DSS 7.1 (Restrict Access)

RequirementImplementation
7.1.1Policy-based access restrictions
7.1.2Least privilege enforcement
7.1.3Role-based permissions

API Reference

EndpointMethodDescription
/api/governance/policiesGETList all policies
/api/governance/policiesPOSTCreate policy
/api/governance/policies/{id}PUTUpdate policy
/api/governance/policies/{id}DELETEDelete policy
/api/governance/policies/evaluatePOSTTest policy

Best Practices

  1. Start restrictive: Begin with block/require_approval, relax as needed
  2. Use meaningful names: Policy names should explain purpose
  3. Document conditions: Add descriptions for complex conditions
  4. Test before deploy: Use evaluate endpoint to test policies
  5. Regular review: Audit policies quarterly for relevance
  6. Version policies: Use policy_description for change notes

Troubleshooting

Policy not triggering

Check:

  • Is policy is_active: true?
  • Do conditions match the action?
  • Is priority correct (not overridden)?

Actions being blocked unexpectedly

Solution: Check higher-priority policies; use evaluate endpoint.

Multiple policies conflicting

Solution: Review priority order; first matching policy wins.


Source: models_agent_registry.py