Features
Policy Engine
Dynamic Governance & Rule Enforcement
Policy Engine
The ABS Policy Engine is the core decision-making component of the ABS Kernel. It evaluates every agent action against a set of active policies to determine whether to ALLOW, DENY, or ESCALATE the operation.
Architecture
The engine operates on a Fail-Close principle: if a policy cannot be evaluated or an error occurs, the default action is to block.
Decision Flow
- Event Ingestion: The engine receives an
EventEnvelopecontaining the agent's intent, payload, and metadata (see Decision Envelope). - Sanitization: Input safeguards remove PII and check for prompt injection.
- Policy Evaluation: The active policy for the event type is executed.
- Risk Scoring: A risk score (0-100) is calculated based on:
- Static Rules: Regex matches, keyword blocks.
- Contextual Analysis: Velocity checks, anomaly detection.
- Sequence Analysis: Recognition of dangerous workflows.
- Trust Score: Historical reputation of the agent.
- Verdict:
- ALLOW: Risk score < 30.
- ESCALATE: Risk score 30-79 (requires human approval).
- DENY: Risk score >= 80 or explicit block.
- Immutable Log: The decision is signed and recorded in the Write-Ahead Log (WAL).
1. Policy Structure
All policies are defined in YAML and follow the ABS Schema 2.1.
apiVersion: abs/v2
kind: Policy
metadata:
name: financial-safeguards
version: 1.0.0
spec:
target:
agents: ["*"]
tools: ["stripe_api", "bank_transfer"]
rules:
- id: "limit-high-value"
description: "Block transfers over $10k without approval"
condition:
type: "json_path"
path: "$.arguments.amount"
operator: "gt"
value: 10000
action: "ESCALATE"
- id: "block-offshore"
description: "Prevent transfers to non-approved jurisdictions"
condition:
type: "regex"
path: "$.arguments.destination_country"
pattern: "^(KY|VG|PA)$" # Cayman, BVI, Panama
action: "DENY"2. Policy Actions
| Action | Behavior | HTTP Response |
|---|---|---|
| ALLOW | Request proceeds to LLM/Tool. | 200 OK |
| DENY | Request is blocked immediately. | 403 Forbidden |
| ESCALATE | Pauses execution. Sends webhook to admin. | 202 Accepted |
| REDACT | Modifies payload (PII stripping) and proceeds. | 200 OK (Modified) |
3. Dynamic Context (Redis)
Policies can reference dynamic state using the ${ctx.*} syntax:
- id: "velocity-check"
condition:
type: "rate_limit"
key: "${ctx.agent_id}"
limit: 10
window: "1m"
action: "DENY"