Align your AI · 03
Align your AI Harness
Mohammad Ali Shehral
The reasons left with the chat
A developer asks a coding assistant to compare two tools, Redis and Memcached, for storing user sessions, and picks one inside the chat. Weeks later, a new teammate cannot find out why, or what else was considered1. The code keeps the decision, not the reasons.
The harness decides what the model sees
The harness is the software around a model. It sets the instructions the model reads, the tools it can call, the notes it can open, and when it stops to ask you. Anthropic calls its own agent toolkit a general-purpose agent harness2. An agent that never sees why the team chose its tool has to guess when the choice comes up again.
A request is not a rule
If you run a model with tools or memory, part of its harness is yours. So is a choice: which rules the model is asked to follow, and which the harness enforces.
Claude Code, Anthropic's coding agent, draws that line in its documentation. Standing instructions, the notes it reads at the start of every session, are context, not enforced configuration. How they are written affects how reliably Claude follows them. To block an action regardless of what Claude decides, the documentation points to a hook, a small script the harness runs itself3.
A gate stops what a request can miss
In the figure, a marker runs toward an action, such as deleting a file. Under Ask, the model reads the rule, misses it on this run, and the marker goes through, leaving only a log line. Under Enforce, the harness shuts the gate and the marker stops.
The opening scene comes from my paper Continuum, written with three co-authors1 and presented in a conference talk.
My open-source plugin, Theoria, sits on the Ask side: its hook logs each pause for the researcher and blocks nothing4.
Sources
-
Shehral, Ravi, Trivedi and Bayat, “Continuum: Automated Construction and Retrieval of Software Decision Knowledge Graphs from Developer-AI Conversations”, ASE 2026 Industry Showcase. https://doi.org/10.1145/3832783.3834535. Accessed 2026-10-13. ↩ ↩2
-
Anthropic, “Effective harnesses for long-running agents”. https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents. Accessed 2026-10-13. ↩
-
Claude Code Docs, “How Claude remembers your project”. https://code.claude.com/docs/en/memory. Accessed 2026-10-13. ↩
-
shehral/theoria repository, checkpoint hook script. https://github.com/shehral/theoria/blob/main/hooks/scripts/checkpoint-gate.sh. Accessed 2026-10-13. ↩