I am building a production-style inference PoC across Kubernetes, NVIDIA Triton, execution backends, and GPUs. I am also using a coding agent to implement parts of it.
That creates a second engineering problem:
How do I let an agent make meaningful progress without allowing it to wander, repeat the same mistakes, weaken tests, or quietly spend GPU money?
Running an agent in a loop is easy:
whilenot done: call_agent()
The useful work is everything around that loop.
The harness decides what the agent may work on, how much it may spend, what counts as success, what happens after failure, and how another engineer resumes the work later.
This post covers the harness I am using for the inference project. Not the framework. The control system around it.
This is a living engineering note. The control model is implemented, and the first real slice has run: a ResNet18 model exported to ONNX, validated against its PyTorch reference, and served through a Triton CPU container end-to-end. Three blocks below contain evidence from that first runtime slice. The fourth contains control-plane evidence: the GPU budget gate remained closed, so there is deliberately no paid benchmark yet.
TL;DR
1
One bounded item
Each run claims one finite unit of work.
2
Externalized state
Project truth lives outside the conversation.
3
Independent verification
The worker cannot approve its own change.
4
No blind retries
Deterministic failures are not repeated unchanged.
5
Hard budgets
Time, retries, commands, and GPU cost are bounded.
6
Failures become memory
Useful defects become regressions or preflight checks.
The agent writes code. The harness controls progress.
Why a Plain Loop Breaks
A long-running coding task spans multiple context windows, commands, failures, and partial implementations.
Uncontrolled loop
Change files→Fail→Retry→Drift→Declare success
vs
Harnessed loop
Claim→Preflight→Patch→Verify→Checkpoint
The next session should not have to reconstruct what was attempted, what actually worked, which failure was already investigated, or whether the repository is still healthy.
The problem is not only model capability. The problem is missing execution structure.
The Harness Architecture
I separate four responsibilities.
The harness is a control plane around the coding agent, not another coding agent.
Human engineer
Architecture, decomposition, acceptance, experiments, risk, and interpretation.
Harness supervisor
State, commands, timeouts, retry policy, limits, error history, and checkpoints.
Worker agent
Bounded implementation, tests, routine refactoring, and documentation updates.
Verifier
Outcome checks, regressions, policy enforcement, evidence, and final pass/fail.
The important boundary: The agent that produced the change does not decide whether the change is correct.
1. One Loop, One Work Item
The agent never receives: Build the complete Triton inference platform.
It receives something closer to:
{"id":"M1-06","title":"Add Triton model-readiness verification","status":"pending","acceptance":["Triton server reports live","Expected model reports ready","Missing model produces a useful diagnostic","Verification terminates within 90 seconds","Existing harness regression tests pass"]}
A small work item gives us a reviewable patch, a finite verification surface, a clear stopping point, a clean rollback boundary, and a useful handoff artifact.
while work_remains(): item = claim_one_work_item() preflight(item) run_worker(item) result = run_verifier(item)if result.passed: create_green_checkpoint(item)else: route_failure(item, result)
The agent can propose completion. Only the verifier can move the item to passed.
2. State Lives Outside the Conversation
Conversation history is useful context. It should not be the project database.
I use the word verifier for three different layers of authority. They should not be collapsed into a single LLM call.
Primary gate
Deterministic verifier
Tests, schemas, probes, numerical comparisons, process cleanup, budgets, metrics, and policy checks. If this layer fails, the work does not pass.
Secondary critic
Model reviewer
A fresh-context reviewer inspects intent, omissions, overengineering, test integrity, and operational risks. It cannot override deterministic failure.
Risk authority
Human judgment
Paid GPU work, destructive tests, architecture changes, benchmark fairness, and public claims remain human decisions.
The same underlying model can be useful as the secondary reviewer when it receives a fresh context, a fixed rubric, the original acceptance contract, the exact diff, and test evidence. It is still a critic—not proof.
Evidence 1 — How the verifier layers behaved
From the first run
M1 showed why verification needs layers. Deterministic checks found two issues; human review showed that one was a verifier false positive. A model review was unnecessary.
Work itemServe ONNX ResNet18 through Triton CPU and verify the result.
Blocked: identical deterministic failure already observed.
Required change:
Update the model configuration or exported tensor contract.
Evidence 2 — The failure the harness refuses to repeat
Mechanism proven
The repeat guard originally existed only in a test. I moved it into the harness and probed it with a deterministic verifier failure: the first attempt ran, while unchanged retries were blocked.
Fingerprintsha256:9fb3779f…, stable after normalizing timestamps, paths, and memory addresses.
Blocked actionThe same verifier command with the same repository and environment state.
Reopen conditionA relevant code, configuration, environment, or tensor-contract change.
Permanent controlRegression tests verify that identical failures remain blocked until state changes.
5. Budget Is Part of Correctness
A functionally correct harness that can leave an A100 running overnight is not correct.
Enabling GPU access is necessary, but never sufficient.
worst_case_cost = timeout_hours * gpu_hourly_price
if worst_case_cost > remaining_budget:raise BudgetExceeded(f"Maximum run cost ${worst_case_cost:.2f} "f"exceeds remaining budget ${remaining_budget:.2f}")
The error ledger preserves the incident. The regression prevents its return. The preflight prevents another engineer from encountering it in the first place.
What Collaboration Looks Like
The harness changes the quality of team handoffs.
Weak handoff
"I tried a few things. Check the branch and the logs."
→
Harnessed handoff
Work item, current state, last green commit, failure class, evidence path, budget consumed, and next decision.
That shape is not hypothetical. The handoff below is a real one from this project — durable enough that the next session resumes from state, not from chat history.
People stop collaborating through memory and chat history. They collaborate through explicit intent, durable state, bounded changes, reproducible evidence, and green checkpoints.
Evidence 4 — A handoff package for the next session
Ready to test
The repository now contains enough durable state for a fresh session to resume without the original conversation. The remaining test is whether the recipient selects the correct next action from these artifacts alone.
handoff @ 27c32c2
state M0 green; M1 CPU path passed
contract verification/contracts/M1-model-correctness.yaml
evidence results/golden-path/<stamp>/
decisions harness/decisions.md
resume make golden-path ARCH=resnet18
next freeze tolerance, then run ARCH=resnet50
to prove fresh recipient resumes without chat history
The Minimum Useful Harness
You do not need a complex multi-agent framework to begin.
1
Feature ledger
Bounded work items and acceptance criteria.
2
Progress log
An append-only record of what happened.
3
Command runner
Timeouts, process cleanup, and structured output.
4
Independent verifier
Outcome checks outside the worker's control.
5
Error fingerprint
A way to stop unchanged deterministic retries.
6
Zero-default budget
Explicit approval for paid or risky operations.
Bringing This Into an Existing Repository
In a greenfield repository, the harness defines the initial operating system. In a mature repository, it should first discover the one already present: tickets encode intent, CI encodes verification, CODEOWNERS encodes authority, release approvals encode risk, and postmortems encode failure memory.
The first step is not replacing those controls. It is making them explicit and letting the agent operate through them.
What the Harness Does Not Own
The harness does not decide whether Triton is the right serving layer, which experiment matters, whether a benchmark is fair, whether p99 latency is acceptable, or whether the result generalizes to production.
Owner
Responsibility
Human
Architecture, hypotheses, acceptance, and interpretation.
Agent
Bounded implementation.
Deterministic tools
Tests, measurements, and limits.
Harness
State, orchestration, evidence, and recovery.
I do not need the agent to be infallible. I need the development system around it to make failures visible, bounded, and recoverable.
Conclusion
The interesting shift is not that agents can write more code. It is that we now need to engineer the system in which they write code.
For this inference PoC, the coding agent is replaceable. A different model can claim the next work item tomorrow.
The durable assets are the specification, acceptance criteria, decisions, checkpoints, error memory, and experiment evidence.
Three blocks report evidence from the ONNX → Triton runtime slice. The budget block reports an enforced non-event: the system refused paid GPU execution under a zero budget.
A loop keeps the agent running. A harness makes the work trustworthy.