Formal Definition
Harness engineering has four formal aspects, each addressing a different failure mode of AI agents:
Constrain: Limit what the agent can do. Architectural rules, dependency boundaries, forbidden patterns, file access restrictions.
Inform: Give the agent the right context. Constraint documents, skill files, codebase conventions, few-shot examples.
Verify: Check the agent’s output before it ships. Linters, type checkers, tests, multi-agent review, human review gates.
Correct: Fix problems automatically when possible. Self-healing loops, auto-formatting, error retry with feedback, entropy cleanup agents.
Key insight: Most teams start with Inform (writing CLAUDE.md) and skip the other three. A complete harness addresses all four aspects. The order matters: constrain first (prevent bad outputs), then inform (guide good outputs), then verify (catch what slipped through), then correct (fix automatically).