Skip to content
Agentic Control Plane

Harness control patterns

Harness engineering became a named discipline this year. Martin Fowler’s site, Databricks, Augment Code, and a run of arXiv papers all describe an agent as a model plus everything around it: loop, context, tools, verification, memory, and controls.

Most of those write-ups give controls one line (“guardrails and permissions”) and move on to context management. This page covers the controls. We run a check on tool calls across many harnesses and keep a survey of what each harness ships natively. The same eight patterns show up in every harness under different names. Below, each one gets a short entry: what it is, where it holds, where it fails, and how it combines with the others.

One distinction organizes everything. Augment Code puts it as prompt-stated standards versus a linter that blocks the PR. The first is probabilistic compliance. The second is deterministic enforcement. Every pattern here is one or the other, and most control failures come from a probabilistic pattern doing a job that needed a deterministic one.

The eight patterns

1. Prompt rules

“Never push to main. Ask before deleting files.” These live in AGENTS.md, CLAUDE.md, .cursor/rules, or the system prompt.

Mechanism: the model reads the rule and usually follows it. Holds: for style, convention, and workflow steering, the things you’d tell a new teammate. It is cheap, portable, and needs no infrastructure. Fails: whenever following the rule matters. A 2026 enterprise-agent benchmark gave the same rule set as prompt text and as a code-owned gate. With prompt text, violations still reached the reader. With the gate, none did. Prompt rules also share the model’s context with anything an attacker managed to inject. Cursor’s docs say as much about .cursor/rules: they steer, they don’t enforce.

Use prompt rules for guidance, never for limits.

2. The permission prompt

The native ask: “Agent wants to run rm -rf ./build. Allow?”

Mechanism: the harness pauses the tool call and asks a human. Holds: as a last-resort backstop while someone is watching. Several harnesses also let an external policy inject its own questions here (coverage column: “can policy ask a human?”). Fails: on volume and on absence. Anthropic’s published data has humans catching 13.6% of dangerous commands at the prompt, versus 89% for their screening classifier. When nobody is present, harnesses differ on what an unanswered ask means: deny, hang, or approve. That is the empty-chair test below.

3. Pattern rules (allow/deny lists)

"rm *": "deny" in a settings file. Examples are Claude Code’s permissions.allow/ask/deny, Codex’s TOML profiles, Gemini CLI’s policy engine, and opencode’s last-match-wins rules.

Mechanism: the harness matches each tool call against declarative rules before dispatch. Holds: for crisp cases. Deny beats allow (Claude Code, Muse Code), explicit allows silence prompts, and org-managed scopes override local ones. The most mature systems, Claude Code’s layered scopes and Gemini’s five priority tiers, are expressive. Fails: three ways, all structural.

  • Respelling. A deny for rm -rf ~/ misses rm -r -f ~, bash -c "rm -rf ~", and the catastrophe after &&. This is the documented bypass class, reproduced across several harnesses. Cursor labels its own allowlist “best-effort, not a security boundary” after three CVEs.
  • Dialect drift. A deny written in settings.json doesn’t exist in config.toml or permission.yaml, so every added harness means re-deriving policy by hand.
  • Per-machine scope. The rules live with each install, so two engineers on one repo run whatever their machines accumulated.

4. The approval classifier

A model screens the tool call before, or instead of, the human. Examples are Claude Code’s auto mode, Codex’s Guardian reviewer, Cursor’s Auto-review, Hermes’s smart approvals, and fx’s model review.

Mechanism: calls the rules don’t settle go to an LLM judge that allows, denies, or escalates. Holds: against fatigue. 89% versus 13.6% is a real result, and every major harness shipped a variant in one season. The best deployments put the screen in front of the human ask rather than replacing it. Fails: two ways. First, no ledger: as of the August survey, no harness keeps a queryable record of what its classifier decided or why. The decisions exist only in session transcripts. Second, self-judging: the weakest form trusts the governed model’s own risk flag. Cline’s safe-command tier reads the model’s requires_approval field, so the classifier is the thing being screened. A classifier is a probabilistic pattern, so it needs a deterministic floor under it and a record behind it.

5. Lifecycle hooks (the interception seam)

PreToolUse fires before every tool call with the full input. Your process answers allow, ask, or deny.

Mechanism: the harness calls out of itself, deterministically, on every dispatch. This is the strongest in-harness pattern and the one converging fastest. Codex’s 2026 hooks are deliberately Claude Code-compatible, Cursor and Hermes honor the same decision shapes, Grok Build loads .claude/settings.json hooks directly, and dsh ships a bridge. The PreToolUse contract is becoming the shared standard. Holds: outside the model (prompt injection can’t argue with it), before execution, with the full arguments. In several harnesses hooks still fire under the yolo flag. Claude Code’s deny rules and hooks survive --dangerously-skip-permissions, and Grok Build’s fire even in always-approve mode. A 50-line hook is a real control, today, for free. Fails: at the edges you find in production.

  • Fail-open timeouts. Claude Code and Grok Build hooks fail open by default when the hook doesn’t answer (Grok’s core gives it 5 seconds), so a crashed control layer silently stops controlling. Claude Code 2.1.295 and later can opt into fail-closed with onFailure: "block". fx’s ACP-server seam fails closed. dsh denies unanswered asks in unattended runs, and a deny from its plugin stops the call.
  • Dialect drift again. Compatible is not identical. Grok Build reads Claude’s hook files but parses only its own decision vocabulary, so a config can load and silently not enforce.
  • Coverage gaps. A hook that doesn’t fire for MCP tools, subagents, or Code Mode sub-calls covers a subset and reports it as the whole (per-harness coverage).
  • Privilege. In Muse Code, the hook process runs outside the sandbox, so your enforcement layer has more privilege than the agent it constrains.

6. The sandbox

OS-level containment: Seatbelt, bubblewrap/seccomp, Landlock, nsjail. Writes are scoped to the workspace and network egress is off by default.

Mechanism: the kernel, not the harness, bounds what any process in the session can touch. Holds: as blast-radius control. It is the only pattern that limits damage after every other pattern has failed. Muse Code ships it on by default and refuses shell if the sandbox can’t be verified. Codex sandboxes on all three OSes. Fails: as a decision mechanism. A sandbox can’t tell a good git push from a bad one; it can only make the write set small. Most harnesses ship it off by default. Containment also has documented holes: hooks and MCP servers sit outside the Muse sandbox, and --disable-sandbox also forces full network egress. A sandbox bounds damage, and something else must still decide. Sandboxes and control planes is our longer treatment.

7. The proxy

Move enforcement out of the harness. The harness’s HTTP client or tool dispatch points at a chokepoint that every call must pass through.

Mechanism: enforcement at the network or gateway layer, below whatever the harness does or doesn’t ship. Holds: where in-process patterns can’t. No harness flag disables a proxy it must route through, and one policy in one dialect covers every harness behind it. It sits where the call already serializes. In our own April 2026 AgentGovBench run, the proxy pattern scored highest of three (45/48, versus 43 for hooks and about 40 for decorators). Those per-pattern scores have not been re-measured since, and we graded them ourselves. See /benchmark for the current daily score. A proxy is also the only pattern that naturally covers the MCP server side of the wire. Fails: on what it can’t see. A proxy watches serialized calls, so framework-internal handoffs and local side effects that never cross the wire need the hook pattern. Latency and availability also become policy properties. A slow or down chokepoint needs a defined failure mode, and fail open or fail closed is now your design decision rather than the harness’s.

8. The independent ledger

A record of every action that the agent’s own process didn’t write.

Mechanism: append-only, ideally off the machine that ran the agent, with the decision attached to each action (allowed by which rule, denied why, approved by whom). Holds: as the difference between a transcript and evidence. The question that exposes the gap is the one teams ask themselves about production agents: could you prove exactly what every agent did and why it was allowed? A session log written by the governed process, on the governed machine, editable by the flag that disabled the controls, cannot answer it. Fails: almost universally, by omission. In the August survey, exactly two harnesses keep a local append-only event log (dsh, Muse Code), and both live on the machine that ran the agent. No surveyed harness ships an off-machine decision ledger, and none records what its approval classifier decided. It is the least-shipped pattern and the one audits ask for first.

The two tests

Two questions sort any stack of these patterns faster than a feature comparison.

The escape hatch. Every harness has a flag: --yolo, --dangerously-skip-permissions, --force. Ask of each control you rely on whether it survives the flag. Prompt rules: no. Pattern rules: sometimes (Claude Code’s denys do; most don’t). Hooks: depends on the harness. Sandbox: usually off with the same flag. Proxy and off-machine ledger: yes, because they don’t live inside the thing the flag disables. What survives yolo mode walks through all eleven harnesses.

The empty chair. Run the agent with nobody watching and let it hit an approval. Deny-and-continue (dsh, Codex exec, Claude Code dontAsk, Gemini’s non-interactive resolve) is the right answer, and it’s newly common. Several harnesses still hang, and a few auto-approve. The empty-chair test is the pre-flight check for any unattended job, including every agent a fleet orchestrator spawns.

Composition: the enforcement ladder

Production stacks layer the patterns, and the layering has a shape.

  Pattern Kind Survives escape hatch? Empty chair
1 Prompt rules probabilistic no n/a
2 Permission prompt human no the problem
3 Pattern rules deterministic sometimes rules answer
4 Approval classifier probabilistic no judge answers, unrecorded
5 Lifecycle hooks deterministic harness-dependent hook answers (check the fail mode)
6 Sandbox deterministic usually not bounds damage, decides nothing
7 Proxy deterministic yes policy answers, defined
8 Independent ledger evidence yes (if off-machine) records whatever happened

Read it bottom-up. The deterministic, out-of-process patterns (7, 8) hold regardless of harness state. The in-harness deterministic patterns (3, 5, 6) do the low-latency work. The probabilistic patterns (1, 4) make the stack usable by steering the model and screening the noise, so the human ask (2) is rare enough to mean something.

The failure to design out is inversion: a probabilistic pattern as the only thing between the agent and a consequence. Examples are a prompt rule guarding production credentials, a model deciding its own risk, or a classifier with no floor and no ledger.

What stays above the harness

Even a generous grade for a single harness leaves four gaps: the record is self-authored, policy is per-machine, one flag undoes it, and rules don’t travel across harness dialects. A layer above the harness has to cover those, and that is the layer we build. The patterns stand on their own, though. Whether you assemble 1 to 8 from a harness’s native surfaces, from a 50-line hook you maintain yourself, or from a control plane, the same eight mechanisms and failure modes apply.

Companion pages: what each harness ships natively · what our layer intercepts per harness · the same survey for MCP servers · what is an agent harness.

Running coding agents? ACP records each tool call its hook sees and makes the dangerous shell commands (a force-push, destructive SQL, curl | sh) wait for you. One command, free up to 5 agents:

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  Getting started