Harness Notes
Lecture 01

Strong models do not mean reliable execution

When capable agents fail, check the harness first: unclear tasks, missing context, broken environment, weak verification, or lost state.

Notes from Learn Harness Engineering - Lecture 01

diagnostic_loopfix harness first
Task specContextEnvironmentVerificationState
ExecuteObserve failureAttribute layerFix and rerun

Capability and reliability are different things.

As of late 2025, the strongest coding agents on SWE-bench Verified reach roughly 50-60% pass rates on carefully selected issues. Everyday work is messier: vague specs, implicit rules, missing tests, and state spread across sessions.

Bare run

Same Opus 4.5 prompt: 20 minutes, $9, core 2D retro game editor features did not work.

vs.

Full harness

Planner + generator + evaluator: 6 hours, $200, the game was fully playable. The model did not change.

Where agents actually get stuck

These are harness failures before they are model failures.

Vague requirements

"Add search" forces guesses about scope, pagination, highlighting, and behavior.

Implicit conventions

Rules in Slack or someone's head are invisible to the agent.

Incomplete setup

The agent burns context on dependency and version conflicts.

No verification

Without executable checks, the agent declares done when it feels done.

State loss

Long tasks fail when each new session rediscovers the project from scratch.

Key terminology

Use these labels to debug failures without jumping straight to "try a better model."

Capability gapBenchmark performance versus real-world task performance.
HarnessInstructions, tools, environment, state management, and verification feedback.
Harness-induced failureThe model could do the task, but the execution environment is structurally defective.
Verification gapDistance between the agent's confidence and actual correctness.
Definition of DoneCompletion criteria verified by command: tests, lint, typecheck, build.

Fix the harness first.

Attribute every failure.

Map it to task spec, context, environment, verification, or state management.

Write Definition of Done.

Make completion executable, not subjective.

Add AGENTS.md.

Document stack, architecture conventions, and verification commands in the repo root.

Keep a failure log.

After a few rounds, the recurring bottleneck becomes obvious.

Completion criteria:
- New endpoint: GET /api/search?q=xxx
- Supports pagination, default 20 items
- Results include highlighted snippets
- All new code passes pytest
- Type checking passes: mypy --strict

Evidence from real runs

50-60%

SWE-bench Verified pass rate for strongest agents in late 2025.

1M

Approximate lines of agent-generated code in OpenAI's five-month experiment.

1,500

PRs opened by three engineers using Codex.

60%

Better context efficiency after adding repo rules and verification in the FastAPI example.

OpenAI million-line experiment

Three engineers wrote no code themselves; Codex generated application logic, infrastructure, tooling, and documentation. The pattern was to break large goals into design, code, review, and test blocks, then strengthen the harness whenever something failed.

3.5 PRs/person/day

FastAPI team example

One-sentence prompting made the agent spend 40% of context exploring, use old SQLAlchemy syntax, and ship runtime errors. Adding AGENTS.md, verification commands, and ADRs made the same model succeed in all three independent runs.

same model, better harness
TAKEAWAY

Do not swap the model first. Treat every failure as a signal that one harness layer needs repair.