Reference Implementation

Explore and contribute to the ACR reference implementation

Start with a 3-minute workflow walkthrough, then run the reference implementation in a local development environment. The ACR Standard defines the requirements; this implementation is an evolving example for testing, learning, and contribution.

Docker Compose v2

Gateway, OPA, PostgreSQL, Redis and kill switch run as containers

Git

To clone the reference implementation repository

Python 3.11 or 3.12

In a local virtual environment, with the package installed from source

Ports 8000, 8181, 8443, 5432, 6379

Free on the host for the local stack

Reference Implementation

What you will see: all four runtime decisions

Before you set up the stack, watch the decision paths and console traces you will work with locally: ALLOW, DENY, MODIFY and ESCALATE in a customer-support workflow.

A narrated customer-support workflow showing all four ACR runtime decisions (ALLOW, DENY, MODIFY and ESCALATE) and the trace records the operator console keeps for each one.

Development demonstration with synthetic customer data. It does not establish production readiness or conformance to the ACR Standard. It shows selected controls from four pillars (P1, P2, P4, P6). Drift detection, timed containment and kill-switch behavior are not shown.

Duration 3:17, narrated, with on-screen captions. Customer-support screens illustrate the agent workflow; console screens show the recorded decision traces.

Transcript
  1. 0:00Define what an agent may do. Enforce it when it acts. Preserve the evidence. That's ACR. Here's how it works in a customer support workflow.
  2. 0:11A customer asks for a one hundred and fifty dollar refund. Identity and Purpose Binding connects this registered support agent to its approved tools.
  3. 0:22Behind the workflow is the ACR operator console. This is Execution Observability: each request has a recorded decision and a unique trace ID.
  4. 0:35First, the agent requests the customer record. The policy allows this read, so the lookup runs and returns the information needed to continue. Here is that same request in the console. The saved decision is allow, and its trace ID links the action to the evidence.
  5. 0:55Next, consider a forbidden action: deleting a customer. This is Behavioral Policy Enforcement. ACR denies the request before the protected tool runs. The customer record stays untouched. The console shows the exact reason: this support agent is not allowed to delete customers. There is no successful deletion.
  6. 1:20Now a separate fifty dollar refund contains an email address in its note. ACR removes the private email before execution, while preserving the amount and the purpose of the request. The saved trace shows modify, the redacted note, and the unchanged fifty dollar amount. This is email redaction, applied before the tool receives the request.
  7. 1:47Back to the one hundred and fifty dollar refund. This policy requires approval above one hundred dollars. Human Authority takes over. ACR pauses execution, and the agent waits for an authorized review. The recorded decision is escalate. This approval request ID connects the paused action to the review that follows.
  8. 2:12An authorized approval is recorded for this request. That approval releases only the waiting action. ACR then executes the approved request and records the result. The same trace ID connects the decision, approval, and execution.
  9. 2:31Here is the actual approval API response. Its status is approved. The execution result records refund issued for one hundred and fifty dollars, linked to that same request.
  10. 2:45This workflow highlights selected controls from four ACR pillars. The full framework also includes Autonomy Drift Detection, and Self-Healing and Containment. Those are separate control paths, beyond the actions shown here.
  11. 3:02Allow routine work. Deny forbidden actions. Modify sensitive details. Escalate exceptions for approval. Define what an agent may do. Enforce it when it acts. Preserve the evidence.
Step 0

Development quickstart

Configure server-side operator keys, start the local stack, confirm readiness, then install the package into a virtual environment and run the sample agent. GET /acr/ready checks PostgreSQL, Redis and OPA; it does not test the independent kill service or protected execution. The default sample evaluates decisions only. Windows users should follow the repository's PowerShell instructions rather than this Bash syntax.

Standard v1.2.0

The normative ACR Standard (7 November 2026).

Software release v1.1.3

Latest published acr-control-plane release.

Reviewed snapshot: main at 7095383

Source used for these instructions. Its fixes are not part of v1.1.3.

Terminal
# Source-reviewed at main 7095383; not yet replayed end to end on a fresh machine.
# Requires: Bash, Docker Compose v2, Git, Python 3.11 or 3.12.
# The development key below must never be used in an exposed or production deployment.

# Terminal one
git clone https://github.com/AdamDiStefanoAI/acr-standard.git
cd acr-standard
git checkout 7095383b78146355d4a3f4f24adc53131f05c7db
cd implementations/acr-control-plane
cp .env.example .env

# Server-side operator keys (read by the gateway)
export OPERATOR_API_KEYS_JSON='{
  "dev-operator-key": {
    "subject": "dev-operator",
    "roles": ["agent_admin", "approver", "security_admin",
              "auditor", "killswitch_operator"]
  }
}'
export SERVICE_OPERATOR_API_KEY=dev-operator-key
docker compose up --build

# Terminal two, from the cloned repository root
cd implementations/acr-control-plane
curl --fail http://localhost:8000/acr/health   # GET, no body: expect "healthy"
curl --fail http://localhost:8000/acr/ready    # GET, no body: HTTP 200 when PostgreSQL, Redis and OPA pass
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .

# Client-side key used by the sample agent (distinct from the server variables above)
export ACR_OPERATOR_API_KEY=dev-operator-key
python examples/sample_agent/agent.py

# Operator console: http://localhost:8000/console (use the local operator key)

# Stop the stack and remove development credentials when finished
docker compose down -v
unset OPERATOR_API_KEYS_JSON SERVICE_OPERATOR_API_KEY ACR_OPERATOR_API_KEY
This setup is for local evaluation and pilots. It uses development defaults and has not been verified as a production deployment. Production use requires your own secrets (scripts/generate_secrets.py), TLS, high availability, and a review of the project's known limitations. See Control Plane Architecture for production patterns.
Adoption Playbook

Illustrative Adoption Plan

An illustrative plan. Durations are examples rather than a guaranteed deployment schedule, and each stage ends with evidence instead of a pass mark.

Week 1Isolate & Validate

Platform Team

Key Deliverable

Isolated or mirrored environment, dependencies validated, enforcement boundary documented

Success Criteria

Exit evidence: environment and versions recorded, readiness results retained, known bypass paths listed.

Tasks
  • Run the control plane against isolated or mirrored requests (there is no shipped observation-mode toggle)
  • Record the release or commit you deployed and any environment-specific changes
  • Run GET /acr/health and GET /acr/ready and keep the results
  • Document the boundary: which tool paths traverse the gateway and which do not
Week 2Register & Verify Decisions

BU Owners + Developers

Key Deliverable

Sample agents registered, manifests and Rego adapted, expected decisions verified

Success Criteria

Exit evidence: reproducible policy tests and correlation-linked decision records.

Tasks
  • Register sample agents with an owner, purpose and allowed tool list
  • Adapt the agent manifest and Rego together in Policy Studio: draft, validate, simulate, publish, activate
  • Verify expected allow, deny and escalate decisions with opa test policies/ -v and the console event log
Week 3Review & Tune

Security Operations

Key Deliverable

Denials reviewed through controlled policy changes, pending escalations dispositioned

Success Criteria

Exit evidence: reviewed exceptions, policy diffs and documented baseline scope.

Tasks
  • Review denials and change policy only through controlled, versioned releases
  • Approve or reject only pending escalations; confirm each records the operator
  • Set a risk-weighted false-positive objective (a low block rate alone does not show control effectiveness)
  • Document a drift baseline that meets the standard, or a human-approved temporary baseline; the 30-sample readiness threshold is not 30 days of representative behavior
Week 4Decide

All Teams + CISO

Key Deliverable

Documented decision to extend evaluation, remediate gaps or plan deployment

Success Criteria

Exit evidence: evidence index, unresolved gaps, responsible owners and deployment prerequisites. Production expansion is not an automatic success criterion.

Tasks
  • Export evidence bundles for pilot agents (GET /acr/evidence/{correlation_id})
  • List unresolved gaps with owners
  • Decide: extend evaluation, remediate gaps, or plan deployment
  • Before any conformance claim, complete an evidence-backed assessment of the defined system

Evidence to have at the end

  • Environment, versions, readiness results and known bypass paths
  • Reproducible policy tests and correlation-linked decision records
  • Reviewed exceptions, policy diffs and documented baseline scope
  • An evidence index with unresolved gaps, owners and deployment prerequisites
Use Case Walkthroughs

Worked Examples

One example matches the policy shipped with release v1.1.3. The other is an illustrative pattern you would need to write and test yourself.

Customer Support Agent

BU Owners, Product Managers, Support Operations

Shipped example policy (policies/acr/customer_support.rego, release v1.1.3)

A support agent looks up customers, sends emails, creates tickets, and issues refunds. Refunds above $100 must be approved by a human before they execute.

Without ACR

The agent can issue refunds of any size with no approval gate and no linked audit record.

With ACR

Each call is evaluated first. issue_refund with amount above 100 (dollars) escalates to the finance-approvals queue with a 240-minute SLA. delete_customer and billing access are denied. Emails containing SSN or card-number patterns are denied. These are demonstration defaults. Change and test the Rego policy and agent manifest together before using different tool names, currencies, thresholds, queues, or timeouts. The sample evaluates decisions; it does not connect to a real CRM, payment processor or email provider.

Shipped Rego (excerpt)
# Refunds over $100 require human approval
escalate if {
    input.action.tool_name == "issue_refund"
    input.action.parameters.amount > 100
}

escalate_queue := "finance-approvals" if {
    input.action.tool_name == "issue_refund"
    input.action.parameters.amount > 100
}

escalate_sla_minutes := 240 if {
    input.action.tool_name == "issue_refund"
    input.action.parameters.amount > 100
}

deny contains reason if {
    input.action.tool_name == "delete_customer"
    reason := "Customer deletion is a forbidden operation for support agents"
}

Incident Response Agent

Security Operations, SecOps Engineers, CISO

Illustrative design pattern. No shipped policy for this agent yet.

A SecOps agent triages alerts. It queries logs, creates tickets, and runs read-only investigative queries. Host isolation should require human approval unless model confidence is above an agreed threshold.

Without ACR

The agent can isolate hosts at any confidence level with no containment safeguard.

With ACR

A policy would escalate isolate_host below the threshold and deny destructive actions. Drift signals could feed containment, subject to calibration for your environment.

Starter policy brief (not Rego)
agent_id: "secops-001"
purpose: "incident_response"
allowed_tools:
  - create_ticket
  - read_only_log_queries
  - enrich_indicator
escalate:
  - tool: isolate_host
    when: confidence < 0.9
    queue: secops-approvals
deny:
  - delete_logs
  - modify_firewall_rules
Developer Guide

Python SDK Integration

For the local walkthrough, install the package from the checked-out source with python -m pip install -e . inside a virtual environment, then import from acr.sdk. The published acr-control-plane v1.1.3 package does not contain the newer fixes on main. The local example uses operator access only to register the demo agent and issue its token; in production, give the agent process a pre-provisioned short-lived agent token instead of an operator key.

1. Evaluate a decision

evaluate_action asks the control plane for a decision and returns it. Nothing executes. Your code must act on the decision and must not call the tool on deny or a pending escalation.

import os
from acr.pillar1_identity.models import AgentRegisterRequest
from acr.sdk import ACRClient

with ACRClient(base_url="http://localhost:8000",
               operator_api_key=os.environ["ACR_OPERATOR_API_KEY"]) as client:
    # Fail closed if dependencies are not ready
    client.get_health()   # GET /acr/health
    client.get_ready()    # GET /acr/ready (503 when not ready)

    client.ensure_agent_registered(AgentRegisterRequest(
        agent_id="customer-support-01",
        owner="[email protected]",
        purpose="Handle customer support tickets and issue resolutions",
        risk_tier="medium",
        allowed_tools=["query_customer_db", "send_email",
                       "create_ticket", "issue_refund"],
        forbidden_tools=["delete_customer"],
    ))

    session = client.issue_agent_session("customer-support-01")

    # Evaluate only: asks for a decision, executes nothing
    result = session.evaluate_action(
        tool_name="issue_refund",
        parameters={"customer_id": "C-12345", "amount": 150.00},  # dollars
        description="Refund for damaged order",
        context={"session_id": "sess-demo-001"},
    )

    print(result.decision, result.correlation_id)
    if result.decision == "escalate":
        print("Pending human approval:", result.approval_request_id)
    elif result.decision == "deny":
        print("Blocked:", result.reason)
    elif result.decision == "modify":
        print("Approved transformed action:", result.modified_action)
    # The workflow video shows all four decisions; the result fields above follow the SDK contract.

2. Protected execution (separate, optional path)

EXECUTE_ALLOWED_ACTIONS is false by default, so the gateway only returns decisions. Protected execution requires enabling the gateway execution path, configuring the target executor (examples/protected_executor runs mock tools after verifying gateway authorization), and preventing agents from reaching the underlying tool with independent credentials. When gateway execution is enabled, approving an escalation can execute the action immediately; do not call the tool again from the agent. The guard_tool wrapper below is an SDK convenience, not proof of an enforced trust boundary.

# Illustrative SDK wrapper. A real enforced boundary also needs the gateway
# execution path (EXECUTE_ALLOWED_ACTIONS=true), a protected executor that
# verifies gateway authorization, and no independent agent credentials to the tool.
import os
from acr.sdk import ACRClient, guard_tool, ACRDeniedError, ACREscalatedError

client = ACRClient(base_url="http://localhost:8000",
                   operator_api_key=os.environ["ACR_OPERATOR_API_KEY"])
session = client.issue_agent_session("customer-support-01")

def issue_refund(customer_id: str, amount: float) -> dict:
    # Mock tool for local evaluation. Runs only when ACR returns allow.
    return {"status": "refund_issued", "customer_id": customer_id, "amount": amount}

guarded_refund = guard_tool(issue_refund, session=session)

try:
    guarded_refund(customer_id="C-12345", amount=150.00)
except ACREscalatedError:
    # Held for human approval. An approver decides in the console or via
    # POST /acr/approvals/{id}/approve, which records the operator.
    pass
except ACRDeniedError:
    # Blocked by policy. Nothing executed.
    pass
Always fail closed. If the health or readiness check fails, or ACR is unreachable, do not proceed with the sensitive action. An agent that bypasses ACR when it is unavailable defeats the purpose of governance.
Contribute

Choose your first contribution

Start with a reproducible example, a policy test, or a documentation fix. Read the contribution guide, choose an open issue, and include your environment, reproduction steps and verification evidence. Do not include secrets or live customer data.

Open the contribution guide
Implementation Status

What the reference implementation has demonstrated

Versioned evidence for the open-source reference implementation, reviewed at main 7095383 on 2026-10-17 (release v1.1.3; Standard v1.2.0). This is preparation material, not a conformance level. A source file existing is not a passed control test.

Reference implementation requirement-to-evidence matrix
RequirementImplemented behaviorEvidenceStatusKnown limitation
Agent registration and short-lived agent tokenP1 · §15The sample registers a demo agent and issues a short-lived token used for evaluation calls.Recorded workflow demo (3:17); sample agent sourceDemonstrated (local demo)Demo uses operator access to register and issue the token. Production provisioning and attestation not evaluated.
Pre-execution policy denyP2 · §16A Rego policy denies delete_customer before any tool call.Recorded workflow demo (3:17) with console deny reason; sample Rego policyDemonstrated (local demo)Covers the sample policy only. Customer-support Rego tests are an open issue (#13).
Escalation holds execution until valid approval is recordedP6 · §20A $150 refund over the $100 threshold returns ESCALATE; nothing executes while pending. After an authorized approval, the approved request executes and the approval API response records the execution result under the same correlation ID.Recorded workflow demo (3:17); approval service sourceDemonstrated (local demo)Timeout behavior and no-duplicate-execution under protected execution need a controlled test.
Executor verifies gateway authorization before executionExecution boundary · §12examples/protected_executor verifies gateway authorization before running mock tools.Source reviewSource-reviewedMock tools only. EXECUTE_ALLOWED_ACTIONS is false by default. Preventing agents from reaching tools with independent credentials is a deployment responsibility.
Exportable evidence bundleP4 · §18Evidence ZIP with manifest.json, events.jsonl, checksums.sha256 and bundle.signature (HMAC-SHA256).Source reviewSource-reviewedDevelopment signing key is public; HMAC is not independent attestation or chain of custody. The approval record is supplied separately.
Output safeguardsP2 · §16Regex redaction of selected PII patterns in tool output.Source reviewSource-reviewedSelected patterns only. Not comprehensive input or output security coverage.
Drift detection against a representative baselineP3 · §17Inspected code defines four metrics and a 30-sample readiness threshold.Source review onlyNot evaluatedThe standard requires eight signal categories and a 30-day baseline. A 30-sample threshold is not evidence of either.
Kill switch stops protected execution within 30 seconds of activationP5 · §19Containment endpoints exist in source.None for the timing targetNot evaluatedActivation-to-enforcement timing and quarterly drills have not been demonstrated. A running service or CI result does not establish them.
MODIFY executes only the transformed action under bound authorityDecision model · §13A $50 refund whose note contains an email returns MODIFY; the email is redacted before the tool receives the request and the amount is unchanged.Recorded workflow demo (3:17); console traceDemonstrated (local demo)Shown for one email-redaction case. Binding execution authority to only the transformed action needs a controlled test.
One-use execution authority rejects replayExecution boundary · §12Partial source inspection did not establish this property.NoneControlled test neededThis is a test gap, not an exploit demonstration or a conformance failure.
Fail-secure behavior when durable logging failsP4 · §18Partial source inspection did not establish this property.NoneControlled test neededRequires a controlled failure-injection test in a declared environment.
Level 1, 2 or 3 conformanceConformance · §21No scoped assessment has been performed.NoneNot establishedUsing the repository does not establish conformance or certification.

Verification: main at 7095383, reviewed 2026-10-17. Recheck against the current repository before relying on any row.

Open Source

Reference Implementation

Open-source reference implementation for evaluating ACR runtime-control patterns, licensed under Apache 2.0. Review implemented controls, test evidence, and known limitations before making a conformance claim. Want to help? See the contribution guide and open tasks.

View on GitHub