Engineering Principles · Agentic Development
Harness engineering: beyond vibe coding.
If an AI agent can generate ten changes before an engineer finishes reviewing one, the constraint has moved. The challenge is designing a system that makes good changes easy to verify and unsafe changes difficult to execute.
The failure mode
Green checks are not evidence when the checker is broken.
Imagine a coding agent tasked with fixing an expensive query analyzer. It makes a patch, runs the test script, and confidently reports success. The wrapper script exits with status zero even when a test command fails. The agent has optimized for a signal that never goes red.
This is a constructed example, not a reported incident. But the failure class is real: testing infrastructure, evaluators, and agent tool wrappers are software too. Before trusting them, deliberately introduce a failing assertion and confirm that the entire CI job fails.
A good prompt cannot compensate for a false-positive verifier. A different model reviewing the same false result is not an independent check.
The system
Six boundaries around an agent.
Write observable acceptance criteria, prohibited side effects, supported targets, and the expected behavior under uncertainty.
Provide versioned architecture notes, relevant source files, an authoritative build command, and explicit known constraints. Keep instructions concise enough to be followed.
Use a sandbox and least-privilege credentials. Drafting a PR should not imply write access to production databases or IAM.
Protect meaningful tests, run reproducible checks, and reserve external evaluation scenarios that implementation cannot edit to manufacture a pass.
Capture relevant diffs, test artifacts, decisions, and tool actions. Make failure diagnoses inspectable, without exposing secrets in logs.
Keep approval of consequential changes outside the code-generating agent. Require explicit, scoped authorization before changing production.
Workflow
A two-agent implementation is not automatically a two-person review.
An effective workflow may use one agent to propose acceptance tests, another to implement the behavior, and a third to review the diff. The separation helps only if the reviewer sees independent evidence and the implementer cannot rewrite the definition of success.
First ask the test author to demonstrate that new tests detect missing or incorrect behavior. Commit approved criteria separately. Let the implementation agent work in an isolated branch. Run tests plus previously withheld checks. Then review not only whether the code passes, but whether it changes any permissions, dependencies, error handling, or surrounding interfaces.
Strict red-green-refactor loops remain valuable for small deterministic functions. For broader infrastructure tasks, high-level acceptance tests and contract tests may precede the shorter unit-test cycles. Tests are evidence conditioned on the adequacy of their specification—not a proof of general correctness.
Concrete experiment
Make the agent fail safely before inviting it to succeed.
Consider a Python tool that recommends PostgreSQL index candidates from captured plans. The input files are read-only. The expected output is a report—not SQL executed against a live database.
Run the same scenarios after each model or prompt change. Compare outcomes, false positives, tool-call costs, and failure explanations. The goal is a reproducible evaluation record—not a persuasive agent demo.
Tradeoffs
Do not build a bigger harness than the risk requires.
A low-risk documentation update may need linting, link checks, and human review. A database migration needs dependency mapping, rollback or roll-forward procedures, isolated rehearsals, and production change authority. Applying the same expensive multi-agent process to every typo would make the workflow less useful.
Independent checks are imperfect: two agents can share training-derived blind spots, test fixtures can omit important production states, and automated policy gates can themselves be misconfigured. Higher-risk operations require stronger controls and real-world observation beyond a successful CI run.
Operational definition
What a successful harness actually produces.
- An unambiguous statement of intended and forbidden behavior.
- A reviewable, minimally scoped implementation diff.
- Reproducible verification with evidence the tests can fail.
- Clear permission boundaries and a record of tool actions.
- A bounded deployment decision, with a human accountable for approval.
The human engineer still needs to understand the system well enough to reject a flawed specification, recognize architectural damage, and challenge contradictory results.
Sources
Current research and foundational practice.
OpenAI — Harness Engineering: Leveraging Codex in an Agent-First World ↗
Anthropic — Claude Code Best Practices ↗
Anthropic — Demystifying Evals for AI Agents ↗
These sources describe evolving techniques; the six-boundary framework and example experiments above are DBRE.tech editorial synthesis, not a vendor-certified standard.
Engineering takeaway
The agent can write the patch. The harness must make the patch trustworthy.
For consequential changes, confidence comes from verified behavior, constrained authority, and evidence a human can independently examine.