AI harness engineering is the practice of building the orchestration layer around an AI model — the tools, context, control flow, and verification that turn a raw LLM into a useful agent. The principles:
1. Context is the budget
Every token in the window competes. Curate aggressively: load on demand, summarize aging history, evict what is stale. The harness’s job is to put the right context in front of the model at the right time, not all the context.
2. Tools shape capability
A model with a hammer sees nails. Tool design — names, descriptions, schemas, error messages — is prompt engineering. A well-named tool with a tight schema beats a clever instruction every time.
3. Determinism where possible, judgment where needed
Control flow (loops, fan-out, retries, gating) belongs in code. Synthesis, ambiguity resolution, and tradeoff calls belong to the model. Don’t ask the model to count to ten; don’t ask code to decide if a PR is risky.
4. Verification over assertion
“Looks right” is not done. Build feedback loops — tests, type checks, runtime probes, adversarial reviewers — that produce evidence the model and harness can consume. A model that can’t see its mistakes will repeat them.
5. Reversibility shapes autonomy
Match the blast radius of an action to how confident you are. Local edits are cheap; force-pushes are not. Sandbox, dry-run, and stage destructive operations; require human confirmation at the boundary.
6. Failures are structural, not exceptional
Models hallucinate, tools time out, contexts overflow. Design for graceful degradation: schemas that retry on mismatch, agents that return null instead of poisoning a batch, budgets that hard-cap runaway loops.
7. Observability is non-optional
You can’t debug what you can’t see. Log prompts, tool calls, token counts, branch decisions. The harness should make its own behavior legible — to humans and to subsequent model turns.
8. The model is one component
The harness fills the gaps the model has — memory, persistence, multi-step planning, parallelism, recovery. Don’t try to prompt your way around a structural problem; build the scaffolding.
9. Composition beats monolith
Subagents with narrow scopes outperform one mega-prompt. Pipelines, judge panels, and adversarial verifiers exploit parallelism the model can’t access alone.
10. Match the harness to the user’s intent
A quick question deserves a quick answer; a deep audit deserves fan-out. Over-orchestrating is its own failure mode — burning tokens and time on machinery the task didn’t need.
Throughline
The model is the engine, the harness is the vehicle. Most of what makes an agent feel competent is harness work, not model work.