Security
~9 min readUpdated: December 2026

Agent Control as Code: Declarative Cross-Plane Governance

Agent Control as Code ACaC Declarative Cross-Plane Governance in Smoke Monkey

Agent Control as Code (ACaC, arXiv:2612.03493) is a formal declarative specification that unifies agent governance across reasoning harnesses, authorization gateways, coordination planes, and execution targets. Modeling rules over four primitives N = (H, M, T, O)—hard policies, mandates, defeasible tenets, and post-action obligations—ACaC compiles to Cedar and KedgeSpec with zero invariant violations across 11,114 TLC states and 0/25 unnecessary escalations vs. 19/25 for prose rules.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

Agent Control as Code: Declarative Cross-Plane Governance: Agent Control as Code (ACaC, arXiv:2612.03493) is a formal declarative specification that unifies agent governance across reasoning harnesses, authorization gateways, coordination planes, and execution targets. Modeling rules over four primitives N = (H, M, T, O)—hard policies, mandates, defeasible tenets, and post-action obligations—ACaC compiles to Cedar and KedgeSpec with zero invariant violations across 11,114 TLC states and 0/25 unnecessary escalations vs. 19/25 for prose rules. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Exampleacac-governance-harness.ts
acac-governance-harness.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Bind Smoke Monkey Harness permission gates to compiled ACaC (H, M, T, O) policy envelopes
const agent = createAgent({
agentId: 'acac-governed-operator',
provider: 'openai-compatible',
baseUrl: 'http://127.0.0.1:8000/v1',
model: 'Qwen/Qwen3-8B',
workspacePath: process.cwd(),
permissions: {
read_file: 'allow',
write_file: 'ask', // Hard policy H: protected config paths require explicit approval
run_command: 'ask', // Mandate M + Obligation O: emit HMAC audit receipt post-commit
},
});
async function main() {
const result = await agent.run(
'Validate deployment manifest against ACaC policy.yaml, run preflight capacity reservation, and log post-action obligation receipt.'
);
console.log('ACaC governed execution:', result.summary);
}
main().catch(console.error);
Video Guides

Watch: Related Video Guides

Guardrails with LangChain: A Complete Crash Course for Building Safe AI Agents

Security & AI Governance: Reducing Risks in AI Systems

What Is Agent Control as Code (ACaC)?

Agent Control as Code (ACaC) treats operational agent safety rules the way Infrastructure as Code treats cloud topology: one declarative source of truth compiled deterministically to every execution plane. When rules are scattered across system prompts, gateway configs, and tool wrappers, teams suffer normative modality confusion—causing either authority drift (admitting forbidden writes) or discretion loss (blocking valid delegated actions).

Verification / Study BenchmarkProse / Uncoordinated BaselineCompiled ACaC + KedgeSpec
Cedar bounded-state oracle match—6,144 / 6,144 states (5/5 defects caught)
Concurrent burst invariant violations (30 trials)100 / 150 rounds (12/5 oversubscribed)0 / 150 rounds (peak 5 <= cap 5)
Unnecessary escalations (BAL, GPT-5.6 / fable-5)19 / 25 & 6 / 250 / 25 (with structured preflight)
Hard-frontier authorized completions11 / 60 (10 / 59 protocol)60 / 60 (55 / 55 filtered)

The Four ACaC Primitives: H, M, T, and O

ACaC models every rule as a four-tuple N = (H, M, T, O) so compilers preserve exact modality semantics across planes:

  1. Hard Policies (`H`): Non-overridable invariants enforced at the authorization gateway and preflight layer (for example, production DB drop blocks or capacity caps).
  2. Mandates (`M`): Affirmative requirements that restrict candidate plan admissibility until satisfied.
  3. Defeasible Tenets (`T`): Preference graphs composed with strongly connected component (SCC) cycle semantics—guidance that yields safely when overridden by higher-priority constraints.
  4. Post-Action Obligations (`O`): Event-time duties triggered upon commit (such as audit HMAC persistence, lock release, and ack-drop recovery).

Prose Instructions Are Not Cross-Plane Firewalls

In ACaC's replay study, prose-only system instructions triggered 19/25 unnecessary escalations on GPT-5.6 and 11/60 authorized resolutions on hard-frontier tasks, whereas deterministic preflight envelopes hit 60/60.

Reproducible Declarative ACaC Policy & Cedar Projection

Structure cross-plane rules declaratively so your Smoke Monkey Harness preflight check and Cedar gateway enforce the exact same contract:

yaml
# acac-policy.yaml — Unified N = (H, M, T, O) governance contract
version: "1.0"
hard_policies:
  - id: H1_no_unbounded_capacity
    resource: "gpu_slot_pool"
    constraint: "active_reservations <= max_capacity(5)"
  - id: H2_protect_prod_env
    action: "write_file"
    deny_path_glob: "**/.env.production"
mandates:
  - id: M1_preflight_required
    require_before: ["deploy_service", "migrate_db"]
    check: "cedar_allow && capacity_reserved"
tenets:
  - id: T1_prefer_read_only_triage
    priority: 10
    defeasible: true
obligations:
  - id: O1_hmac_audit_receipt
    on_commit: ["deploy_service", "migrate_db"]
    deadline_ms: 5000
bash
# Compile declarative policy and verify Cedar/Z3 bounds
cedar validate --policies acac-compiled.cedar --schema kedge-schema.cedarschema
Google Search Questions & Answers

Frequently Asked Questions

Q:What is the difference between authority drift and discretion loss in ACaC?

Authority drift occurs when an agent plane admits an action forbidden by global policy N; discretion loss occurs when an overly conservative plane blocks an action that N actually permits.

Q:Why does ACaC split rules into H, M, T, and O instead of one allow/deny list?

Confusing hard boundaries (H) with defeasible preferences (T) or post-commit obligations (O) causes planes to miscompile guidance into hard blocks or drop required audit/cleanup duties.

Q:What is the runtime latency overhead of ACaC governance checks?

In warm-cache E3 and E4 benchmarks, KedgeSpec typed revalidation runs in 238.6 microseconds (median) and full SHA-256 cached capacity reservation runs in 3.105 ms median.

Q:How does ACaC relate to Smoke Monkey Harness permissions?

Smoke Monkey Harness enforces deterministic pre-execution permission gates (allow/ask/deny) in code outside the LLM prompt, directly implementing ACaC hard-policy enforcement at the tool boundary.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness