Skip to content
← AI Native Development AI Native Development · Part 3 of 6

AI Harness Engineering — Software Engineering Beyond the Prompt

AI Harness Engineering: an agent loop with Plan, Act, Observe, Evaluate, Repeat and Tools

When we talk about AI today, much of our attention goes to the capabilities of models such as GPT, Claude and Gemini. But is a capable model alone enough to build reliable software or an agentic application?

This is where AI harness engineering becomes important.

What is an AI harness?

When we use an LLM on its own, it usually returns a response to our input. An agentic task involves more than a single response.

Suppose we ask AI: “Add a feature to this project and check that it works correctly.”

The AI needs to read files, change code, run tests, identify errors and fix them.

It might use an execution loop such as Read → Plan → Act → Observe → Evaluate → Repeat. Not every agentic workflow needs to follow exactly that sequence.

It is useful to distinguish the agent from its harness:

   
AI agent A system that decides what to do next to achieve a goal and uses the necessary tools.
AI harness The software infrastructure that supplies the agent’s execution environment, tools, context and controls, and manages its execution loop or workflow.

Put simply, the agent decides what to do next. The harness provides the facilities to carry out those decisions and control the process. In practice, some frameworks combine these responsibilities.

The harness also manages the process until the task is complete, a defined limit is reached or human intervention is needed.

It may include capabilities for context, memory, tools, security, permissions and evaluation.

The harnesses used by coding agents such as Claude Code and OpenAI Codex are examples.

Can we customize a harness?

Yes. We can customize an existing harness, such as Codex or Claude Code, to fit a project.

For example:

  • Rules — Architecture, coding standards and business rules.
  • Skills — Reusable workflows for the project.
  • MCP / tools — Connections to databases, APIs, logs and external systems.
  • Hooks — Automated tests and security checks.
  • Context and memory — Project documentation and technical decisions.
  • Evaluation and feedback — Checking results and improving them.

Much of this can be done without changing the harness’s source code.

Why build our own harness?

Imagine building a specialized AI agent for a banking application.

It may need strict security policies, local LLM use, language validation, sensitive data protection, audit logs, observability, compliance checks and human approval.

For such a use case, we could customize an existing harness or build a domain-specific harness using frameworks such as Google ADK or LangGraph.

The right approach depends on the requirements of the use case.

What should software engineers focus on?

We should pay attention to engineering the harness to fit the project, alongside writing prompts.

For example, we can add UI testing through Playwright, application-log access, project context through MCP and automated feedback loops.

Designing these well can reduce unnecessary iterations, optimize token use and development cost, and improve software quality and development efficiency.


Our goal is to maintain software quality while making the development process more efficient. The environment in which AI works needs careful engineering too. That is why harness engineering matters.

If this article was useful, share it with a friend. Share your thoughts and experiences with harness engineering as well.

We will explore another technical topic in the next article.