Skip to main content

Policy Concepts

Overview

This guide explains the fundamental concepts behind Ascend's policy engine. Understanding these concepts is essential for creating effective governance policies that balance security with operational efficiency.

Key Capabilities

  • Policy Evaluation: How policies are matched and applied
  • Pattern Matching: Wildcards, regex, and exact matching
  • Condition Evaluation: Time-based, role-based, and context conditions
  • Risk-Based Decisions: How risk scores influence policy outcomes
  • Policy Inheritance: How policies combine and override

Core Concepts

Policy

A policy is a rule that defines how the governance platform should handle specific AI actions. Each policy contains:

  • Identity: Name and description
  • Match Criteria: Patterns that determine when the policy applies
  • Conditions: Additional requirements that must be met
  • Action: What happens when the policy matches (ALLOW, DENY, etc.)
  • Priority: Order in which policies are evaluated
┌─────────────────────────────────────────────────────────────────────────────┐
│ POLICY STRUCTURE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Policy: "production-database-protection" │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ IDENTITY │ │
│ │ Name: production-database-protection │ │
│ │ Description: Protect prod DB from modifications │ │
│ │ Priority: 50 │ │
│ │ Status: deployed │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ MATCH CRITERIA │ │
│ │ Namespace: database │ │
│ │ Verbs: insert, update, delete, alter │ │
│ │ Resources: production.*, prod.* │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ CONDITIONS │ │
│ │ Environment: production │ │
│ │ Risk Threshold: >= 40 │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ ACTION │ │
│ │ Decision: REQUIRE_APPROVAL │ │
│ │ Approval Level: 3 │ │
│ │ Timeout: 3600 seconds │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Policy Decision

A policy decision is the outcome of evaluating an action against policies:

DecisionDescriptionUse Case
ALLOWAction proceeds immediatelyLow-risk, explicitly permitted actions
DENYAction is blockedHigh-risk, prohibited actions
REQUIRE_APPROVALAction queued for human reviewMedium-risk actions needing oversight
ESCALATEAction routed to senior approversCritical actions needing executive review
CONDITIONALAction allowed if conditions metContext-dependent permissions

Risk Score

A risk score is a 0-100 value representing the potential impact of an action:

┌─────────────────────────────────────────────────────────────────────────────┐
│ RISK SCORE BREAKDOWN │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Total Risk Score: 72/100 (HIGH) │
│ │
│ Category Breakdown: │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Security ████████████████████████████░░░░ 75/100 (35% weight) │ │
│ │ Data ██████████████████████░░░░░░░░░░ 65/100 (30% weight) │ │
│ │ Compliance ████████████████████████████████ 80/100 (20% weight) │ │
│ │ Financial ██████████████████░░░░░░░░░░░░░░ 55/100 (15% weight) │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ Weighted Calculation: │
│ (75 × 0.35) + (65 × 0.30) + (80 × 0.20) + (55 × 0.15) = 72.0 │
│ │
│ Risk Factors: │
│ - security_high_risk: Credential access detected │
│ - compliance_high_risk: Production environment │
│ - data_medium_risk: Customer database access │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Evaluation Context

The evaluation context contains all information about an action being evaluated:

context = {
# User information
"user_id": "user-123",
"user_email": "analyst@company.com",
"user_role": "analyst",

# Action information
"action_type": "database_query",
"resource": "production.customers",
"namespace": "database",

# Environment information
"environment": "production",
"client_ip": "192.168.1.100",
"timestamp": "2026-01-20T14:30:00Z",

# Session information
"session_id": "sess-abc123",
"agent_id": "customer-support-bot"
}

Pattern Matching

Patterns determine when a policy applies to an action:

Exact Match

{
"namespace_patterns": ["database"]
}

Matches only namespace == "database"

Wildcard Match

{
"resource_patterns": ["production.*", "*.customers"]
}
  • production.* matches production.users, production.orders
  • *.customers matches prod.customers, staging.customers

Contains Match

{
"resource_patterns": ["*pii*", "*credential*"]
}

Matches any resource containing "pii" or "credential"

Multiple Patterns (OR Logic)

{
"verb_patterns": ["insert", "update", "delete"]
}

Matches if verb is "insert" OR "update" OR "delete"

Conditions

Conditions add requirements beyond pattern matching:

Time-Based Conditions

{
"conditions": {
"time_range": {
"start_hour": 9,
"end_hour": 17,
"timezone": "America/New_York"
}
}
}

Policy only applies between 9 AM and 5 PM Eastern

Role-Based Conditions

{
"conditions": {
"user_role": "admin"
}
}

Policy only applies to users with admin role

Environment Conditions

{
"conditions": {
"environment": "production"
}
}

Policy only applies in production environment

Combined Conditions (AND Logic)

{
"conditions": {
"environment": "production",
"user_role": "analyst",
"time_range": {
"start_hour": 18,
"end_hour": 6
}
}
}

All conditions must be met for policy to apply

Priority

Priority determines policy evaluation order:

┌─────────────────────────────────────────────────────────────────────────────┐
│ POLICY PRIORITY ORDER │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Evaluation Order (lowest priority number first): │
│ │
│ Priority 10: "emergency-block-all" │
│ ↓ (Checked first - if matches, stops here) │
│ Priority 25: "pii-data-protection" │
│ ↓ (Checked second) │
│ Priority 50: "production-database-protection" │
│ ↓ (Checked third) │
│ Priority 75: "standard-approval-workflow" │
│ ↓ (Checked fourth) │
│ Priority 100: "default-policy" │
│ ↓ (Checked last) │
│ No Match: Default decision (REQUIRE_APPROVAL) │
│ │
│ IMPORTANT: First matching policy wins - evaluation stops │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Policy Lifecycle

Policies go through defined states:

┌─────────────────────────────────────────────────────────────────────────────┐
│ POLICY LIFECYCLE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌──────────┐ ┌──────────┐ │
│ │ DRAFT │ ───> │ TESTING │ ───> │ DEPLOYED │ ───> │ ARCHIVED │ │
│ └─────────┘ └─────────┘ └──────────┘ └──────────┘ │
│ │ │ │ │
│ │ │ │ │
│ v v v │
│ Not active Dry-run only Active & enforced Inactive │
│ Editable Can modify Version locked Read-only │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
StateActiveEditableDescription
draftNoYesBeing created/modified
testingDry-runYesTesting with real traffic
deployedYesNoActive and enforced
archivedNoNoRetired, kept for audit

Risk Categories

Four categories assess different risk dimensions:

Security Risk

  • What it measures: Access and privilege risks
  • Indicators: Admin actions, credential access, permission changes
  • Weight: 35% of total score
security_indicators = [
"admin", "privilege", "access", "credential",
"password", "token", "key", "certificate"
]

Data Risk

  • What it measures: Data sensitivity and exposure
  • Indicators: PII, customer data, confidential information
  • Weight: 30% of total score
data_indicators = [
"pii", "personal", "private", "confidential",
"customer", "user", "sensitive"
]

Compliance Risk

  • What it measures: Regulatory and policy risks
  • Indicators: Audit requirements, policy violations
  • Weight: 20% of total score
compliance_indicators = [
"audit", "compliance", "regulatory", "legal",
"sox", "hipaa", "gdpr", "pci"
]

Financial Risk

  • What it measures: Business impact risks
  • Indicators: Billing, payments, revenue, transactions
  • Weight: 15% of total score
financial_indicators = [
"money", "payment", "financial", "billing",
"transaction", "purchase", "invoice"
]

Context Multipliers

Context factors modify base risk scores:

ContextMultiplierDescription
Production environment1.5xHigher impact
Staging environment1.2xMedium impact
Development environment0.8xLower impact
Admin user1.4xElevated privileges
Service account1.3xAutomated access
External access2.0xOutside network
After hours1.3xUnusual timing
Bulk operation1.6xLarge-scale impact

Approval Levels

Risk scores map to approval requirements:

Risk ScoreLevelApproversTypical SLA
90-100L5Executive60 minutes
80-89L4Senior Manager30 minutes
70-79L3Manager15 minutes
50-69L2Team Lead10 minutes
25-49L1Peer Review5 minutes
0-24L0Auto-approvedImmediate

Advanced Concepts

Policy Conflict Detection

When multiple policies could apply, conflicts are detected:

┌─────────────────────────────────────────────────────────────────────────────┐
│ CONFLICT DETECTION EXAMPLE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Policy A (Priority 50): │
│ Resource: production.customers │
│ Action: DENY │
│ │
│ Policy B (Priority 75): │
│ Resource: *.customers │
│ Action: ALLOW for role=admin │
│ │
│ CONFLICT DETECTED: │
│ Both policies match "production.customers" │
│ Policy A (DENY) would override Policy B (ALLOW) │
│ │
│ RESOLUTION: │
│ Policy A wins due to lower priority number (50 < 75) │
│ Admin users would be DENIED, not ALLOWED │
│ │
│ RECOMMENDATION: │
│ Add condition to Policy A to exclude admin role, or │
│ Lower Policy B priority to ensure admin access │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Natural Language Parsing

The engine can parse natural language policy descriptions:

Input:

"Block any agent from deleting customer data in production databases"

Parsed Output:

{
"decision": "DENY",
"namespace_patterns": ["database"],
"verb_patterns": ["delete"],
"resource_patterns": ["*customer*"],
"conditions": {"environment": "production"},
"confidence": 0.85
}

Caching Strategy

Policy evaluation results are cached for performance:

┌─────────────────────────────────────────────────────────────────────────────┐
│ CACHING STRATEGY │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Cache Key Format: │
│ SHA256(user_role:action_type:resource:namespace:environment) │
│ │
│ TTL Strategy: │
│ Standard risk (< 70): 300 seconds │
│ High risk (>= 70): 60 seconds │
│ │
│ Cache Invalidation: │
│ - Policy created/updated/deleted │
│ - Manual cache clear via API │
│ - TTL expiration │
│ │
│ Cache Bypass: │
│ - Emergency evaluations │
│ - Audit-mode evaluations │
│ - Force-refresh flag │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

Fail-Closed Design

When errors occur, the engine defaults to safe behavior:

Error TypeDefault Behavior
Database unavailableDENY (fail-closed)
Cache failureContinue without cache
Policy parsing errorSkip policy, log error
Risk calculation errorUse maximum risk (95)
TimeoutREQUIRE_APPROVAL

Best Practices

Policy Design

  1. Start with DENY by default: Create explicit ALLOW policies
  2. Use specific patterns: Avoid broad wildcards
  3. Layer policies: Multiple targeted policies > one catch-all
  4. Document intent: Use clear descriptions
  5. Test before deployment: Use dry-run mode

Priority Management

  1. Reserve low priorities (1-25): For critical security rules
  2. Use middle range (26-75): For business logic
  3. Default policies (76-100): For catch-all behavior
  4. Leave gaps: Allow room for new policies

Condition Usage

  1. Combine conditions carefully: All must match (AND logic)
  2. Test edge cases: Time zones, role changes
  3. Document conditions: Explain why each condition exists
  4. Review periodically: Conditions may become stale

Compliance

Policy concepts support compliance with:

  • SOC 2 CC6.1: Logical access security
  • PCI-DSS 7.1: Access control policy
  • NIST 800-53 AC-1: Access control policy
  • HIPAA 164.312: Access control
  • GDPR Article 5: Data processing principles