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.

The ETCLOVG taxonomy: seven layers of agent harness engineering

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:

  1. Security
  2. Reproducibility
  3. 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

The Aptico CLI harness architecture

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

  1. Start with boundaries, not agents β€” define what the system can and cannot access before creating agents.
  2. Treat context as a resource β€” build a Retrieve β†’ Rank β†’ Filter β†’ Compress β†’ Inject pipeline.
  3. Every important action should have feedback β€” Action β†’ Observation β†’ Validation β†’ Correction.
  4. Design tools for agents β€” a human-friendly API is not automatically an agent-friendly tool.
  5. Make failures observable β€” if you can’t answer what did it see, decide, call, return, debugging becomes guesswork.
  6. Build governance early β€” permissions should be part of the architecture from the beginning.
  7. 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.