Harness Engineering?
How do we move from building an AI model application to building a reliable AI system?
When I started working on agentic AI systems, I initially thought that most of the work was about choosing a good LLM, writing a good system prompt, and connecting a few tools.
The more I worked on agents, the more I realized that this is only a small part of the problem.
An agent can have a very capable model and still fail because it has the wrong context, poor tool interfaces, no persistent state, weak validation, or too many permissions.
This is where Harness Engineering becomes interesting.
From Prompt Engineering to Harness Engineering
I see three different levels of engineering around an LLM.
Prompt Engineering
Prompt engineering focuses mainly on the instructions given to the model.
The goal is to improve a model interaction by changing:
- instructions
- examples
- roles
- output formats
- constraints
It is important, but it mainly focuses on the input to the model.
Context Engineering
Context engineering goes one step further.
Instead of asking only:
βWhat should I tell the model?β
the question becomes:
βWhat information should the model have at this specific step?β
This includes:
- conversation history
- retrieved information
- memory
- tool results
- previous actions
- summaries
- intermediate state
The context becomes something that needs to be actively managed.
Harness Engineering
Harness engineering expands the scope again.
Now the question is:
βHow should the whole system around the model operate?β
The harness controls things such as:
- where the agent executes
- which tools it can use
- what context it receives
- how its state is maintained
- how agents communicate
- how failures are handled
- how results are verified
- what actions are allowed
- how execution is monitored
A Useful Mental Model
One idea that helped me understand the concept is:
The model provides intelligence, while the harness provides the environment in which that intelligence can actually work.
This is useful because a raw LLM does not automatically have a workspace, memory, tools, permissions, execution capabilities, or feedback loops.
Those capabilities have to be designed around the model.
The ETCLOVG Framework
The paper Agent Harness Engineering: A Survey proposes a seven-layer taxonomy called ETCLOVG:
- E β Execution Environment & Sandbox
- T β Tool Interface & Protocol
- C β Context & Memory Management
- L β Lifecycle & Orchestration
- O β Observability & Operations
- V β Verification & Evaluation
- G β Governance & Security
The first four layers form the structural core of the harness, while Observability, Verification, and Governance act as a control layer around it.

I find this classification useful because it gives a practical way to ask:
βWhat is missing from my agent system?β
Instead of simply saying that an agent is unreliable, we can try to identify which layer is responsible for the problem.
1. Execution Environment & Sandbox
The first question is simple:
Where is the agent actually allowed to act?
An agent that can execute code, modify files, install packages, or access the network needs an execution environment.
This can be:
- a container
- a sandbox
- a virtual machine
- a browser environment
- a restricted runtime
- a repository workspace
The survey highlights three important reasons for sandboxing:
- Security
- Reproducibility
- Liveness
A sandbox provides a middle ground:
The agent can act autonomously, but only inside a controlled boundary.
Agent
β
Workspace
β
Sandbox
βββ Files
βββ Tools
βββ Limited network
βββ Limited permissions
2. Tool Interface & Protocol
An agent becomes much more useful when it can interact with the outside world.
LLM
β
βββ filesystem
βββ terminal
βββ database
βββ browser
βββ Git
βββ APIs
But simply giving an agent many tools is not necessarily a good design.
A better approach is often:
User request
β
Tool selection
β
Relevant tools only
β
Agent execution
More tools does not necessarily mean more agent capability.
3. Context & Memory Management
A model can only reason over the information that is available to it.
Short-term β Current task / active context
Mid-term β Session state
Long-term β Persistent memory
Instead of sending everything to the LLM, we want:
Everything
β
Selection β Filtering β Compression
β
Relevant context
β
LLM
4. Lifecycle & Orchestration
For a real task, the execution looks like:
User request β Planning β Context construction
β Tool selection β Execution β Observation
β Validation β Retry / Continue / Delegate
β Final result
For multi-agent systems:
Orchestrator
/ | \
Context Tool Validator
Agent Agent Agent
\ | /
Final Result
If one agent can solve the problem reliably, adding more agents introduces latency, tokens, and more failure points.
5. Observability & Operations
Without traces, we may only see: βAgent returned the wrong answer.β
With observability, we can inspect:
Trace
βββ LLM call
βββ Context size
βββ Tool selection
βββ Tool latency
βββ Tool result
βββ Retry
βββ Validation
βββ Final response
Minimum to monitor: Latency Β· Token usage Β· Cost Β· Tool calls Β· Errors Β· Retries Β· Context size Β· Success rate
6. Verification & Evaluation
Producing an output is not necessarily the same as completing the task correctly.
Agent writes code β Run tests β Agent sees result β Agent corrects code
is generally better than:
Agent writes code β Everything finishes β Human discovers failure
The first approach creates a feedback loop.
7. Governance & Security
What is the agent allowed to do?
Instead of:
Agent β Database β Everything
we want:
Agent β Policy β Permission Check β Allowed Query β Database
Humans Steer, Agents Execute
Humans steer. Agents execute.
The engineer increasingly works on environments, constraints, interfaces, feedback loops, evaluation, architecture, and policies β while the agent operates inside those boundaries.
Documentation Is Part of the Harness
A good repository should expose its knowledge clearly:
AGENTS.md β Architecture β Design decisions
β Execution plans β Implementation β Tests
Instead of putting hundreds of instructions into a single prompt, the agent can discover the information it needs progressively.
Harness Engineering in Aptico
This is where I find the concept particularly useful for Aptico CLI.
The ETCLOVG model gives a useful way to reason about its architecture:
ETCLOVG
βββ E β Execution environment
βββ T β Tools and interfaces
βββ C β Context engineering and memory
βββ L β Agent orchestration
βββ O β Observability and LLMOps
βββ V β Validation and evaluation
βββ G β Governance and security

For every new capability in Aptico, I can ask:
Does it affect execution? β E
Does it introduce a new tool? β T
Does it require new context? β C
Does it change orchestration? β L
Can we observe it? β O
Can we verify it? β V
Is it secure? β G
What I Would Take Into a Real Project
- Start with boundaries, not agents β define what the system can and cannot access before creating agents.
- Treat context as a resource β build a Retrieve β Rank β Filter β Compress β Inject pipeline.
- Every important action should have feedback β Action β Observation β Validation β Correction.
- Design tools for agents β a human-friendly API is not automatically an agent-friendly tool.
- Make failures observable β if you canβt answer what did it see, decide, call, return, debugging becomes guesswork.
- Build governance early β permissions should be part of the architecture from the beginning.
- Keep the harness modular β swap model, tools, context strategy, memory, or verifier without rewriting.
Final Thought
The main thing I take from Harness Engineering is that building an agent is not simply about connecting an LLM to a few tools.
The real engineering challenge is building the environment around the model.
Don't ask only: "Which model should I use?"
Also ask:
"Where will it execute?"
"What will it see?"
"What can it do?"
"How will it remember?"
"How will I know what happened?"
"How will I verify the result?"
"What happens when it fails?"
"What is it allowed to do?"
References
- Li, J. et al. Agent Harness Engineering: A Survey, 2026.
- OpenAI. Harness engineering: leveraging Codex in an agent-first world, 2026.
- LangChain. The Anatomy of an Agent Harness, 2026.