{"version":1,"term":{"id":"harness-engineering","term":"Harness engineering","aliases":["Agent harness engineering"],"category":"Agents","definition":"Designing the execution environment around a model — repository conventions, automated verifiers, state files, sandboxes and feedback loops — so agents can complete multi-hour work reliably.","why":"Once frontier models can write solid code, the bottleneck moves from clever prompting to the environment that catches mistakes, enforces invariants and lets an agent verify its own output.","example":"A team wires lint rules, type checks, fast unit tests and a strict AGENTS.md into a repo so a coding agent runs the full check after every edit. When a migration breaks a schema invariant, the verifier fails immediately with the exact file and rule, and the agent fixes it before opening a PR.","caution":"Over-engineered harnesses can lock onto one model’s quirks and slow down a stronger successor; measure task completion rate whenever you add a constraint or upgrade the model.","tags":["builders","must-know"],"relatedTerms":["agent-harness","context-engineering","agents-md","agent-checkpointing"],"comparisons":[{"termId":"agent-harness","difference":"The agent harness is the runtime wrapper around the model; harness engineering is the broader discipline of shaping the repo, tests, tools and feedback loops the harness runs inside."},{"termId":"context-engineering","difference":"Context engineering decides which tokens enter each model call; harness engineering builds the verifiers, permissions, state stores and workflows outside the context window."}],"searchTitle":"Harness Engineering Explained: Building Environments for AI Agents","searchDescription":"What harness engineering is, how it differs from context engineering, and why tests, constraints and state matter more than prompt tweaks.","links":[{"label":"How AI agents fail in production","path":"/learn/agent-failure-modes"},{"label":"Claude Code, the operator’s way","path":"/learn/claude-code"}],"sources":[{"label":"OpenAI · Harness engineering: leveraging Codex in an agent-first world","url":"https://openai.com/index/harness-engineering/"},{"label":"Anthropic · Effective harnesses for long-running agents","url":"https://www.anthropic.com/research/effective-harnesses-for-long-running-agents"}],"updatedAt":"2026-11-28T09:01:33.023Z"},"previous":{"id":"handoff","term":"Handoff"},"next":{"id":"held-out-test-set","term":"Held-out test set"},"related":[{"id":"agent-harness","term":"Agent harness","page":true},{"id":"context-engineering","term":"Context engineering","page":true},{"id":"agents-md","term":"AGENTS.md","page":true},{"id":"agent-checkpointing","term":"Agent checkpointing","page":true}],"comparisons":[{"id":"agent-harness","term":"Agent harness","page":true,"difference":"The agent harness is the runtime wrapper around the model; harness engineering is the broader discipline of shaping the repo, tests, tools and feedback loops the harness runs inside."},{"id":"context-engineering","term":"Context engineering","page":true,"difference":"Context engineering decides which tokens enter each model call; harness engineering builds the verifiers, permissions, state stores and workflows outside the context window."}],"guides":[],"pages":["ab-testing","agent2agent","adversarial-attack","agent","agent-checkpointing","agent-client-protocol","agent-harness","agent-loop","agent-memory","agent-observability","agent-planning","agent-skill","agent-wallet","agentic","agentic-commerce","agents-md","agi","ai-adoption","ai-alignment","ai-copyright","ai-avatar","center-of-excellence","ai-citation","ai-crawler","ai-governance","ai-literacy","ai-overviews","ai-pilot","ai-roi","ai-safety","ai-slop","ai-strategy","ai-visibility","ai-washing","ai-watermarking","algorithmic-bias","api","artificial-intelligence","attention","augmentation","automation","autonomous-agent","background-agent","backpropagation","batch-api","benchmark","benchmaxxing","browser-agent","build-vs-buy","canonical-url","catastrophic-forgetting","centaurs-and-cyborgs","chain-of-thought","change-management","character-consistency","chatbot","chunking","clanker","coding-agent","computer-use","computer-vision","constitutional-ai","content-credentials","context-compaction","context-engineering","context-rot","context-window","controlnet","conversational-search","copilot","cost-per-token","data-contamination","data-labeling","data-moat","data-poisoning","decentralized-compute","deep-learning","deep-research","deepfake","delimiters","depin","diffusion-model","distillation","dpo","e-e-a-t","e-acc","embedding","emergent-abilities","entity","erc-8004","eu-ai-act","evaluation","explainability","factuality","few-shot-prompting","fine-tuning","forward-deployed-engineer","foundation-model","frame-interpolation","frontier-model","generative-ai","generative-engine-optimization","golden-dataset","gpt","gpu","gpu-poor","gradient-descent","graphrag","grounding","gtm-engineer","guardrails","hallucination","handoff","harness-engineering","held-out-test-set","human-evaluation","human-in-the-loop","hybrid-search","image-to-image","image-to-video","inference","inpainting","instruction-tuning","interpretability","jagged-frontier","jailbreak","knowledge-cutoff","knowledge-graph","kv-cache","large-language-model","latency","latent-space","leaderboard","least-privilege","lip-sync","llm-as-a-judge","llmops","llms-txt","local-llm","long-context","lora","machine-learning","max-tokens","mcp-server","meta-prompting","mixture-of-experts","moat","model","model-card","model-collapse","model-context-protocol","model-routing","motion-control","multi-agent-system","multimodal","music-generation","natural-language-processing","negative-prompt","neural-network","next-token-prediction","nist-ai-rmf","ocr","on-device-ai","one-shot-prompting","open-source-ai","open-weights","orchestrator","outpainting","overfitting","p-doom","parameters","peft","perplexity-metric","physical-ai","pii","post-training","pre-training","precision-and-recall","programmatic-seo","prompt","prompt-adherence","prompt-caching","prompt-chaining","prompt-engineering","prompt-injection","prompt-leaking","prompt-regression-testing","prompt-template","proof-of-personhood","provenance","quantization","query-fan-out","query-rewriting","rate-limit","react-pattern","reasoning-model","red-teaming","refusal","reinforcement-learning","reranking","responsible-ai","retrieval-augmented-generation","reward-model","rlhf","rlvr","robots-txt","role-prompting","sandbox","scaling-laws","seo","seed","self-consistency","self-critique","semantic-search","shadow-ai","share-of-voice","sitemap","small-language-model","spec-driven-development","speculative-decoding","speech-to-text","stochastic-parrot","stop-sequence","streaming","structured-data","structured-output","style-transfer","subagent","superintelligence","supervised-fine-tuning","sybil-attack","sycophancy","synthetic-data","system-instructions","temperature","test-time-compute","text-to-image","text-to-video","text-to-speech","bitter-lesson","time-to-first-token","token","tokenizer","tokens-per-second","tool-calling","tool-poisoning","top-p","topical-authority","total-cost-of-ownership","tpu","training","training-data","transformer","upscaling","vector-database","vector-search","vendor-lock-in","vibe-coding","vision-language-model","voice-cloning","webmcp","workflow","world-model","wrapper","x402","zero-click-search","zero-shot-prompting","zkml"],"card":"/images/cards/glossary/harness-engineering.png?v=07f1d545f81662a2"}