LogIn
I don't have account.
Sponsored -55%
Tarkan Top Brand

Tarkan Portable Folding Laptop Desk with Drawer, Cup & Tablet Holder (Black)

Foldable · Anti-slip strip · 60 × 40 cm · No assembly

★★★★★ 4.2 (7,877) 1K+ bought last month
₹899 M.R.P. ₹1,999Save ₹1,100
Buy Now
Adℹ

Harness Engineering Explained: What It Is, Why It Matters and How It Works (With Real Examples)

Rahul Singh
236 Views

#artificial-intelligence

#ai

#prompt-engineering

#ai-agents

#harness-engineering

Amazon Pay offer
Adℹ

If you have followed AI news in 2026, you have probably seen a new term everywhere harness engineering. It is being called the next big skill after prompt engineering and context engineering. Big companies like OpenAI and AWS are building products around it. Engineers on LinkedIn and X are debating it every week.

But most articles on this topic use heavy language and skip the basics. This article explains harness engineering in plain words, shows the real problem it solves, walks through how it works step by step and gives you real examples you can actually learn from. By the end, you will know:

  • What a "harness" means in AI
  • What harness engineering is and where the term came from
  • What problem it solves and why it matters right now
  • How it works, step by step
  • Two real world examples (one from AWS, one from OpenAI)
  • How to talk about this topic in an interview, with rough timing
  • Common mistakes people make
  • FAQs

Let's start with the basics.

What Is a Harness in AI?

Think about a horse. A horse is strong and fast. But without a saddle, reins and a bridle, it will run wherever it wants. The harness is what turns that raw strength into something useful and controlled. The rider decides the direction. The harness makes sure the horse's power actually goes there. An AI model works the same way.

A large language model (like GPT or Claude) is powerful. It can write, reason and plan. But on its own, it just produces text. It cannot:

  • Remember what happened in a task from yesterday
  • Call an API and retry if it fails
  • Check its own output against a rule or a schema
  • Know which files or tools it is allowed to touch
  • Stop itself when it is going in the wrong direction

A harness is the system built around the model that handles all of this. It is the code, rules, tools, memory and checks that sit between the raw model and the real task.

In simple words:

Harness = everything around the model that makes it actually work in the real world.

This idea is often written as a short formula that most engineers use today: Agent = Model + Harness

The model does the thinking. The harness does everything else :- memory, tool calls, permission checks, retries and validation.

A simple picture of the flow:

User → Harness → Model → Tools → Validators → Response

The user's request does not go straight to the model. It first passes through the harness, which adds context, memory and rules. The model then reasons and decides what to do. If it needs a tool, the harness runs that tool call. Before anything goes back to the user, a validator checks the output. Only then does the final response get sent back.

What Is Harness Engineering?

Harness engineering is the practice of designing and building that harness. It covers things like:

  • What instructions and rules you give the agent (system prompts, guideline documents)
  • What tools and APIs the agent can call
  • How the agent remembers past context (short term and long term memory)
  • How you check the agent's output before it is trusted
  • How you control cost, time and number of steps the agent can take
  • How you log and monitor what the agent is doing
  • When a human needs to step in and approve something

Where did the term come from?

The term became popular after OpenAI published an engineering post in February 2026, written by engineer Ryan Lopopolo. In that post, OpenAI's Codex team shared a five-month experiment where they built and shipped a real internal software product about one million lines of code with zero lines written directly by a human. Every line of application code, tests, CI configuration and documentation was written by their AI coding agent, Codex. Humans only steered the work. they did not write the code by hand.

The interesting part was not that the AI wrote code. It was how the team made this reliable. They did not get better results by writing longer prompts. They got better results by building a proper system around the model repository knowledge, rules the agent had to follow, automated checks and feedback loops. OpenAI called this system the "harness," and the name stuck.

Soon after, Mitchell Hashimoto (known for building Terraform and Ghostty) summed up the whole idea in one short formula that spread fast across the AI community:

Agent = Model + Harness

Later, Martin Fowler's team at Thoughtworks (the post was written by Birgitta Böckeler) added more structure to the idea. They split harness components into two simple types:

  • Guides rules that shape the agent before it acts. Examples: system prompts, instruction files, coding guidelines.
  • Sensors checks that catch problems after the agent acts. Examples: automated tests, output validators, evaluation scripts.

This "guides and sensors" way of thinking is now a common way engineers describe harness design.

Why Does Harness Engineering Matter Now?

Here is the real reason this topic became important in 2026: AI models are becoming similar to each other.

A year or two ago, picking the "best" model made a huge difference. Today, top models from different companies score close to each other on most benchmarks. So the model itself is no longer the biggest lever for getting better results. The harness is.

LangChain, a well-known company that builds AI agent tools, shared research showing that changing only the harness while keeping the exact same model moved a coding agent from rank #30 to rank #5 on a public benchmark. Nothing about the model changed. Only the system around it changed: the tools it could use, how directory context was given to it, how outputs were checked and how time budgets were enforced.

This is why teams at companies like Stripe and GitHub adopted harness thinking so quickly. It gives them a way to improve results without waiting for a better model to be released.

In short, harness engineering solves this problem:

A raw model is not reliable enough for real work on its own. The harness is what turns an unreliable model into a dependable agent that can be trusted with real tasks.

Harness Engineering vs Prompt Engineering vs Context Engineering

People often mix these three up. Here is the simple difference:

  • Prompt engineering writing the right words to get a good single response from a model.
  • Context engineering deciding what information to put inside the model's context window so it has the right facts to work with.
  • Harness engineering building the full system around the model: tools, memory, checks, permissions, retries and monitoring, across an entire task or workflow, not just one response.

Prompt engineering and context engineering are both part of a harness. But a harness is much bigger. It is the whole environment the agent lives and works in.

Here is a side-by-side comparison:

Prompt Engineering Context Engineering Harness Engineering
Scope A single message to the model What information goes into the context window The full system around the model, across a whole task
Goal Get a better single response Give the model the right facts at the right time Make the agent reliable, safe and repeatable in production
Includes Instructions, examples, tone, format Retrieved documents, memory snippets, tool outputs Prompts, context, tools, memory, validation, limits, logging
Time horizon One request One request or one session An entire task or many tasks over time
Example Rewriting a prompt to get a cleaner JSON output Adding the right past ticket history before asking for a support reply Building the tool router, retry logic and validators for a support agent

In short: prompt engineering fixes how you ask. Context engineering fixes what the model knows. Harness engineering fixes the whole system the model operates inside.

How Harness Engineering Works, Step by Step

Building a harness is not one single thing. It usually comes together in these steps:

Step 1: Define what the agent is allowed to do You write a system prompt or instruction document. This sets the agent's role, its tone and hard rules it must follow. This is a "guide" in Fowler's language.

Step 2: Give the agent tools You connect the tools the agent needs for example, a search tool, a database tool or a way to call other agents. You also decide which tools are turned on by default and which ones a user can turn on later.

Step 3: Add memory You decide what the agent should remember. Short term memory covers the current task. Long term memory lets the agent recall facts from earlier sessions, like user preferences or past decisions.

Step 4: Add permission and identity controls You decide what the agent can access, using whose identity and for how long. This matters a lot when the agent is calling other systems on a user's behalf.

Step 5: Add checks (sensors) You build validation steps that run after the agent produces output for example, checking that generated code compiles or that a JSON response matches a required format.

Step 6: Add limits You set budgets maximum tokens, maximum time, maximum number of steps so the agent cannot run forever or cost too much.

Step 7: Add observability You track what the agent did, which tools it called and what it cost. This is needed to debug problems and to improve the harness later. In a production system, observability usually covers five things:

  • Tracing a step-by-step record of everything the agent did in a task, in order, so you can replay what happened.
  • Tool execution logs which tools were called, with what input and what came back.
  • Cost monitoring tokens used and money spent, per request and over time, so costs do not silently grow.
  • Evaluation pipelines automated tests that regularly check the agent's output quality, not just once, but on an ongoing basis as the model or prompts change.
  • Failure analysis a way to look back at failed or flagged tasks and find the actual root cause, so it can be fixed in the harness rather than patched with a one-off prompt tweak.

Without this, you cannot tell why an agent failed. You can only guess.

Step 8: Allow runtime changes Good harnesses let you change some of the above at run time, not just at deployment time. For example, letting a user pick a different model or turn on an extra tool while using the agent.

A more detailed picture of a production harness:

User
   │
   ▼
Harness
├── Memory
├── Prompt / Guides
├── Tool Router
├── Validator
├── Guardrails
└── Logger / Observability
   │
   ▼
LLM (reasoning)
   │
   ▼
Response

Each box inside the harness is a separate, replaceable piece. You can swap the model, add a new tool or tighten a guardrail without touching the rest of the system. This is what makes a harness easier to improve over time than one giant prompt.

Now let's see this in a real example.

Real World Example 1: Building a Harness with AWS AgentCore

This example comes from a real engineering blog post about a prototype agent platform called Loom, built by engineer Heeki Park and shows both a custom harness and AWS's new managed harness feature for AgentCore.

The setup (deploy time)

At deployment, the agent is created using a configuration file, not by writing custom code for every agent. The config includes:

  • The system prompt (persona, instructions and guidelines combined into one)
  • The model to use
  • A list of tools (MCP servers) the agent can call, with authentication details
  • A list of other agents it can talk to
  • Whether the agent has memory turned on and which memory store to use

This means a new agent can be created just by changing a JSON file no new code, no new deployment pipeline. This is a huge time saver and it also makes the agent safer, because you are not running untrusted, freshly-written code for every new agent.

The setup (run time)

Here is where it gets interesting. At deploy time, you set the defaults. But when a real user is using the agent, they might want to:

  • Pick a different model than the default (for example, a faster or cheaper one)
  • Turn on an extra tool they personally need

So the system also accepts a request at run time with fields like:

  • model_id override the default model, but only from an approved list
  • connector_ids a list of extra tools to attach just for this one request

This means the agent's defaults are set by an administrator, but each user still has some choice, within safe limits.

The tricky part: adding tools while the agent is running

When a user turns on a new tool that needs a personal API key (for example, a search tool), the system asks the user for their key exactly when they turn the tool on not before and not later when the tool is actually called.

Why does the timing matter? If you ask for the key too early, most users will ignore it, because they have not decided yet that they actually want the tool. If you wait until the tool is actually called, the user might have already walked away from their screen and the agent gets stuck waiting for a permission it cannot get. Asking right when the user turns the toggle on is the point where the user is most likely to say yes and be present to answer.

Moving to a managed harness

After building this custom system, the same engineer also tried AWS's new managed harness feature for Bedrock AgentCore. Instead of building and hosting all of the above by hand, you can create a harness with one command, passing in the system prompt, model, tools and memory settings:


aws bedrock-agentcore-control create-harness \
  --harness-name "loom-harness-example" \
  --system-prompt "persona, instructions, guidelines" \
  --model "us.amazon.nova-2-lite-v1:0" \
  --max-iterations 75 \
  --max-tokens 16384 \
  --tools '[{"type": "remote_mcp", "name": "exa", ...}]' \
  --memory '{...}'

And at run time, you can send a request that overrides the model or adds a tool for just that one call, similar to the custom system, but without having to build and maintain any of the underlying plumbing yourself.

The real benefit reported was speed: the custom-built agent took about one minute to deploy, while the managed harness took about twenty seconds. That is the value of a managed harness most of the repeated, boring plumbing work is already done for you.

Real World Example 2: OpenAI's Codex Team

The second real example is the one that started the whole trend.

OpenAI's Codex team ran a five-month internal experiment. They built a real software product with daily internal users and external alpha testers where every single line of code was written by their AI agent, Codex, not by a human. This included application logic, tests, CI/CD configuration, documentation and internal tooling.

They estimated this was about ten times faster than writing the same product by hand. The team was clear that this was not because the model magically got smarter. It worked because of the harness they built around Codex, which included:

  • Repository knowledge files (often called AGENTS.md) that act like an onboarding guide for the agent, similar to onboarding a new human engineer
  • Executable rules and structural checks, so the agent's output could be automatically checked, not just trusted
  • Observability, so engineers could see what the agent was doing and why
  • A habit of asking, whenever the agent made a mistake, "what capability, context or structure is missing?" instead of just "let's write a better prompt"

This last point is probably the most useful takeaway from the whole harness engineering trend: when an AI agent fails at a task, the fix is usually not a cleverer prompt. The fix is usually a missing piece of the harness a tool it did not have, a check that should have caught the mistake or a rule it was never given.

When NOT to Use a Complex Harness

A full harness, with memory, tool routing, validators and observability, is not needed for every use case. Adding all of this to a simple task just adds cost and delay for no real benefit.

You probably do not need a heavy harness for:

  • A simple chatbot that answers general questions with no real actions or side effects
  • A basic FAQ bot that answers from a fixed, small set of documents
  • A single API wrapper that takes one input, calls one API and returns the result
  • A one-shot summarizer that reads one document and returns one summary, with no follow-up steps

For these cases, a good prompt and maybe some light context engineering is enough. Start simple. Add harness pieces only when you actually see a real problem for example, the agent keeps calling the wrong tool or its output format keeps breaking downstream systems. Build the harness to fix a real, observed failure, not because it sounds impressive.

Trade-offs: What a Harness Costs You

A harness makes an agent more reliable, but it is not free. Before adding one, weigh these trade-offs:

  • Higher latency every extra step (memory lookup, validation, guardrail checks) adds time before the user gets a response.
  • Increased operational cost more tool calls, more logging and more validation steps all add up in compute and token cost.
  • Greater engineering complexity more moving parts means more code to maintain, more failure points and a steeper learning curve for new engineers on the team.
  • More testing requirements a harness with tools, memory and validators needs its own test suite. You are no longer just testing a prompt; you are testing a system.

The right amount of harness is the smallest one that solves your actual reliability problem. More is not automatically better.

How to Talk About Harness Engineering in an Interview

If you are preparing for a system design or AI engineering interview in 2026, this topic can come up, especially if the role touches on agentic systems, LLM-based products or platform engineering. Here is how to fit it into your interview time well.

Suggested time allocation, if this comes up as a sub-topic in a 45–60 minute system design round:

  • 1–2 minutes: Give the one-line definition "Agent = Model + Harness" and why it matters (models are converging, so the harness is the real differentiator).
  • 2–3 minutes: List the core components tools, memory, permissions, validation, budgets, observability. Do not just name them; give one line on why each one matters.
  • 3–5 minutes: Walk through one real example end to end, like the deploy-time vs run-time config pattern shown above. Interviewers like a concrete example much more than a list of buzzwords.
  • 1–2 minutes: Mention trade-offs for example, build your own harness (more control, more engineering work) vs use a managed harness like AWS AgentCore's harness feature (faster to ship, less control).

Total: roughly 8–12 minutes if the interviewer wants a deeper discussion. If it is just a quick sub-question inside a bigger system design question, 2–3 minutes with a clear definition and one example is enough. Do not go longer than this unless the interviewer is clearly interested and keeps asking follow-ups in most interviews, this is a supporting topic, not the whole question.

If asked "how would you improve an AI agent that keeps failing," the strongest answer is the OpenAI lesson above: check what is missing in the harness (a tool, a rule, a check) rather than jumping straight to "let's improve the prompt."

Common Mistakes to Avoid When Building a Harness

  • Treating prompt engineering as the whole solution. A good prompt cannot fix a missing tool or a missing permission check.
  • No limits on cost or steps. Without a max token or max step budget, an agent can loop or run up a large bill.
  • Asking for credentials at the wrong time. Asking too early gets ignored. Asking too late can block the agent while the user is not around.
  • No validation step. If nothing checks the agent's output, small mistakes can silently become big problems.
  • No logging. If you cannot see what tools the agent called and why, you cannot debug it when it goes wrong.
  • Hardcoding everything at deploy time. Users often need to pick a different model or add a tool without waiting for a new deployment.

FAQs

1. Is harness engineering the same as prompt engineering?

No. Prompt engineering is about writing good instructions for a single response. Harness engineering is about the full system around the model tools, memory, checks and limits across an entire task.

2. Who created the term "harness engineering"?

It became widely known after OpenAI published an engineering post in February 2026, written by Ryan Lopopolo, about their Codex team's experiment. Mitchell Hashimoto turned the idea into the short formula "Agent = Model + Harness," and Martin Fowler's team at Thoughtworks added more structure with the "guides and sensors" framing.

3. Why does the harness matter more than the model now?

Because top AI models are performing closer to each other on benchmarks than before. When models are similar, the system built around the model becomes the main thing that decides whether an agent actually works well.

4. What are "guides" and "sensors" in a harness?

Guides are rules that shape the agent before it acts, like system prompts or instruction files. Sensors are checks that catch problems after the agent acts, like automated tests or output validators.

5. Do I need to build my own harness or can I use a managed one?

Both options exist. Building your own harness gives you full control and flexibility but takes real engineering time. Managed options, like AWS's harness feature for Bedrock AgentCore, are much faster to set up but give you less control over the internals.

6. Is harness engineering only for coding agents?

No. It applies to any AI agent customer support agents, data agents, research agents and more. The Codex example is about coding, but the same ideas (tools, memory, checks, limits) apply to any agent doing real work.

7. How much should I talk about this in an interview?

As a rough guide, 2–3 minutes if it is a small part of a bigger question and up to 8–12 minutes if the interviewer wants a full discussion with a real example. Always end with one concrete example rather than only definitions.

Conclusion

Harness engineering is not really a brand new idea. Engineers have always built systems around raw components to make them reliable this is just that same idea, applied to AI models. What changed in 2026 is that this finally got a name, a formula (Agent = Model + Harness) and real public examples showing how much it actually matters.

If you are working with AI agents in any way building them, reviewing them or just talking about them in interviews the biggest shift to make is this: stop asking "which model should I use?" and start asking "what does my harness look like?" That is the question that actually decides whether your agent works.

Trending Developer Reads

Responses (0)

Write a response

CommentHide Comments

No Comments yet.

"},"4":{"id":4,"name":"ZEBRONICS Blanc mouse ad","otherData":"{}","contentFormat":2,"content":"
Sponsored -53%
Zebronics #1 Best Seller

ZEBRONICS Blanc Slim Wireless Mouse — Rechargeable, BT + 2.4GHz (Black)

Up to 1600 DPI · Silent clicks · 63g · Multicolor LED

★★★★★ 4.0 (9,512) 5K+ bought last month
₹376 M.R.P. ₹799Save ₹423
Buy Now
"},"2":{"id":2,"name":"Crousal Ads","otherData":"{}","contentFormat":2,"content":"
Sponsored -34%
iQOO Amazon's Choice

iQOO Z10 Lite 5G — Cyber Green, 4GB RAM, 128GB Storage

Dimensity 6300 · 50MP Sony AI Camera · 6000 mAh · IP64

★★★★★ 4.0 (2,052) 500+ bought last month
₹18,997 M.R.P. ₹28,999Save ₹10,002
Buy Now
"},"1":{"id":1,"name":"Banner Ads","otherData":"{}","contentFormat":2,"content":"\n
\n \n \n \"Amazon\n \n
"}}},"blogDetails":{"isWriter":false,"likes":0,"isLikedByUser":false,"tagIds":[306,307,356,397,540],"tags":[{"id":306,"name":"Artificial Intelligence","maskingName":"artificial-intelligence","isFeatured":false},{"id":307,"name":"AI","maskingName":"ai","isFeatured":false},{"id":356,"name":"Prompt Engineering","maskingName":"prompt-engineering","isFeatured":false},{"id":397,"name":"AI Agents","maskingName":"ai-agents","isFeatured":false},{"id":540,"name":"Harness Engineering","maskingName":"harness-engineering","isFeatured":false}],"comments":[],"bookmark":{"isBookmarked":false,"count":0},"author":{"userId":"MjlfNF84LVs1OF0ybi10Q19BTmdlX19JdA==","name":"Rahul Singh"},"viewCount":235,"showBannerImage":false,"seoTags":"Harness Engineering, Harness Engineering AI, What is Harness Engineering, AI Harness, AI Agent Harness, Agent Model Harness, Agent = Model + Harness, Harness Engineering tutorial, Harness Engineering guide, Prompt Engineering vs Harness Engineering, Context Engineering vs Harness Engineering, AI Agent Architecture, AI Agents, LLM Agents, Agentic AI, AI Engineering, OpenAI Codex, AWS AgentCore, Bedrock AgentCore, Ryan Lopopolo, Mitchell Hashimoto, Martin Fowler, Thoughtworks, Guides and Sensors, AI Guardrails, AI Memory, AI Tool Calling, AI Validation, AI Observability, AI Monitoring","content":"

If you have followed AI news in 2026, you have probably seen a new term everywhere harness engineering. It is being called the next big skill after prompt engineering and context engineering. Big companies like OpenAI and AWS are building products around it. Engineers on LinkedIn and X are debating it every week.

\n

But most articles on this topic use heavy language and skip the basics. This article explains harness engineering in plain words, shows the real problem it solves, walks through how it works step by step and gives you real examples you can actually learn from. By the end, you will know:

\n\n

Let's start with the basics.

\n

What Is a Harness in AI?

\n

Think about a horse. A horse is strong and fast. But without a saddle, reins and a bridle, it will run wherever it wants. The harness is what turns that raw strength into something useful and controlled. The rider decides the direction. The harness makes sure the horse's power actually goes there. An AI model works the same way.

\n

A large language model (like GPT or Claude) is powerful. It can write, reason and plan. But on its own, it just produces text. It cannot:

\n\n

A harness is the system built around the model that handles all of this. It is the code, rules, tools, memory and checks that sit between the raw model and the real task.

\n

In simple words:

\n
\n

Harness = everything around the model that makes it actually work in the real world.

\n
\n

This idea is often written as a short formula that most engineers use today: Agent = Model + Harness

\n

The model does the thinking. The harness does everything else :- memory, tool calls, permission checks, retries and validation.

\n

A simple picture of the flow:

\n
User → Harness → Model → Tools → Validators → Response\n
\n

The user's request does not go straight to the model. It first passes through the harness, which adds context, memory and rules. The model then reasons and decides what to do. If it needs a tool, the harness runs that tool call. Before anything goes back to the user, a validator checks the output. Only then does the final response get sent back.

\n

What Is Harness Engineering?

\n

Harness engineering is the practice of designing and building that harness. It covers things like:

\n\n

Where did the term come from?

\n

The term became popular after OpenAI published an engineering post in February 2026, written by engineer Ryan Lopopolo. In that post, OpenAI's Codex team shared a five-month experiment where they built and shipped a real internal software product about one million lines of code with zero lines written directly by a human. Every line of application code, tests, CI configuration and documentation was written by their AI coding agent, Codex. Humans only steered the work. they did not write the code by hand.

\n

The interesting part was not that the AI wrote code. It was how the team made this reliable. They did not get better results by writing longer prompts. They got better results by building a proper system around the model repository knowledge, rules the agent had to follow, automated checks and feedback loops. OpenAI called this system the \"harness,\" and the name stuck.

\n

Soon after, Mitchell Hashimoto (known for building Terraform and Ghostty) summed up the whole idea in one short formula that spread fast across the AI community:

\n

Agent = Model + Harness

\n

Later, Martin Fowler's team at Thoughtworks (the post was written by Birgitta Böckeler) added more structure to the idea. They split harness components into two simple types:

\n\n

This \"guides and sensors\" way of thinking is now a common way engineers describe harness design.

\n

Why Does Harness Engineering Matter Now?

\n

Here is the real reason this topic became important in 2026: AI models are becoming similar to each other.

\n

A year or two ago, picking the \"best\" model made a huge difference. Today, top models from different companies score close to each other on most benchmarks. So the model itself is no longer the biggest lever for getting better results. The harness is.

\n

LangChain, a well-known company that builds AI agent tools, shared research showing that changing only the harness while keeping the exact same model moved a coding agent from rank #30 to rank #5 on a public benchmark. Nothing about the model changed. Only the system around it changed: the tools it could use, how directory context was given to it, how outputs were checked and how time budgets were enforced.

\n

This is why teams at companies like Stripe and GitHub adopted harness thinking so quickly. It gives them a way to improve results without waiting for a better model to be released.

\n

In short, harness engineering solves this problem:

\n
\n

A raw model is not reliable enough for real work on its own. The harness is what turns an unreliable model into a dependable agent that can be trusted with real tasks.

\n
\n

Harness Engineering vs Prompt Engineering vs Context Engineering

\n

People often mix these three up. Here is the simple difference:

\n\n

Prompt engineering and context engineering are both part of a harness. But a harness is much bigger. It is the whole environment the agent lives and works in.

\n

Here is a side-by-side comparison:

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Prompt EngineeringContext EngineeringHarness Engineering
ScopeA single message to the modelWhat information goes into the context windowThe full system around the model, across a whole task
GoalGet a better single responseGive the model the right facts at the right timeMake the agent reliable, safe and repeatable in production
IncludesInstructions, examples, tone, formatRetrieved documents, memory snippets, tool outputsPrompts, context, tools, memory, validation, limits, logging
Time horizonOne requestOne request or one sessionAn entire task or many tasks over time
ExampleRewriting a prompt to get a cleaner JSON outputAdding the right past ticket history before asking for a support replyBuilding the tool router, retry logic and validators for a support agent
\n

In short: prompt engineering fixes how you ask. Context engineering fixes what the model knows. Harness engineering fixes the whole system the model operates inside.

\n

How Harness Engineering Works, Step by Step

\n

Building a harness is not one single thing. It usually comes together in these steps:

\n

Step 1: Define what the agent is allowed to do You write a system prompt or instruction document. This sets the agent's role, its tone and hard rules it must follow. This is a \"guide\" in Fowler's language.

\n

Step 2: Give the agent tools You connect the tools the agent needs for example, a search tool, a database tool or a way to call other agents. You also decide which tools are turned on by default and which ones a user can turn on later.

\n

Step 3: Add memory You decide what the agent should remember. Short term memory covers the current task. Long term memory lets the agent recall facts from earlier sessions, like user preferences or past decisions.

\n

Step 4: Add permission and identity controls You decide what the agent can access, using whose identity and for how long. This matters a lot when the agent is calling other systems on a user's behalf.

\n

Step 5: Add checks (sensors) You build validation steps that run after the agent produces output for example, checking that generated code compiles or that a JSON response matches a required format.

\n

Step 6: Add limits You set budgets maximum tokens, maximum time, maximum number of steps so the agent cannot run forever or cost too much.

\n

Step 7: Add observability You track what the agent did, which tools it called and what it cost. This is needed to debug problems and to improve the harness later. In a production system, observability usually covers five things:

\n\n

Without this, you cannot tell why an agent failed. You can only guess.

\n

Step 8: Allow runtime changes Good harnesses let you change some of the above at run time, not just at deployment time. For example, letting a user pick a different model or turn on an extra tool while using the agent.

\n

A more detailed picture of a production harness:

\n
User\n   │\n   ▼\nHarness\n├── Memory\n├── Prompt / Guides\n├── Tool Router\n├── Validator\n├── Guardrails\n└── Logger / Observability\n   │\n   ▼\nLLM (reasoning)\n   │\n   ▼\nResponse\n
\n

Each box inside the harness is a separate, replaceable piece. You can swap the model, add a new tool or tighten a guardrail without touching the rest of the system. This is what makes a harness easier to improve over time than one giant prompt.

\n

Now let's see this in a real example.

\n

Real World Example 1: Building a Harness with AWS AgentCore

\n

This example comes from a real engineering blog post about a prototype agent platform called Loom, built by engineer Heeki Park and shows both a custom harness and AWS's new managed harness feature for AgentCore.

\n

The setup (deploy time)

\n

At deployment, the agent is created using a configuration file, not by writing custom code for every agent. The config includes:

\n\n

This means a new agent can be created just by changing a JSON file no new code, no new deployment pipeline. This is a huge time saver and it also makes the agent safer, because you are not running untrusted, freshly-written code for every new agent.

\n

The setup (run time)

\n

Here is where it gets interesting. At deploy time, you set the defaults. But when a real user is using the agent, they might want to:

\n\n

So the system also accepts a request at run time with fields like:

\n\n

This means the agent's defaults are set by an administrator, but each user still has some choice, within safe limits.

\n

The tricky part: adding tools while the agent is running

\n

When a user turns on a new tool that needs a personal API key (for example, a search tool), the system asks the user for their key exactly when they turn the tool on not before and not later when the tool is actually called.

\n

Why does the timing matter? If you ask for the key too early, most users will ignore it, because they have not decided yet that they actually want the tool. If you wait until the tool is actually called, the user might have already walked away from their screen and the agent gets stuck waiting for a permission it cannot get. Asking right when the user turns the toggle on is the point where the user is most likely to say yes and be present to answer.

\n

Moving to a managed harness

\n

After building this custom system, the same engineer also tried AWS's new managed harness feature for Bedrock AgentCore. Instead of building and hosting all of the above by hand, you can create a harness with one command, passing in the system prompt, model, tools and memory settings:

\n
\naws bedrock-agentcore-control create-harness \\\n  --harness-name \"loom-harness-example\" \\\n  --system-prompt \"persona, instructions, guidelines\" \\\n  --model \"us.amazon.nova-2-lite-v1:0\" \\\n  --max-iterations 75 \\\n  --max-tokens 16384 \\\n  --tools '[{\"type\": \"remote_mcp\", \"name\": \"exa\", ...}]' \\\n  --memory '{...}'\n
\n

And at run time, you can send a request that overrides the model or adds a tool for just that one call, similar to the custom system, but without having to build and maintain any of the underlying plumbing yourself.

\n

The real benefit reported was speed: the custom-built agent took about one minute to deploy, while the managed harness took about twenty seconds. That is the value of a managed harness most of the repeated, boring plumbing work is already done for you.

\n

Real World Example 2: OpenAI's Codex Team

\n

The second real example is the one that started the whole trend.

\n

OpenAI's Codex team ran a five-month internal experiment. They built a real software product with daily internal users and external alpha testers where every single line of code was written by their AI agent, Codex, not by a human. This included application logic, tests, CI/CD configuration, documentation and internal tooling.

\n

They estimated this was about ten times faster than writing the same product by hand. The team was clear that this was not because the model magically got smarter. It worked because of the harness they built around Codex, which included:

\n\n

This last point is probably the most useful takeaway from the whole harness engineering trend: when an AI agent fails at a task, the fix is usually not a cleverer prompt. The fix is usually a missing piece of the harness a tool it did not have, a check that should have caught the mistake or a rule it was never given.

\n

When NOT to Use a Complex Harness

\n

A full harness, with memory, tool routing, validators and observability, is not needed for every use case. Adding all of this to a simple task just adds cost and delay for no real benefit.

\n

You probably do not need a heavy harness for:

\n\n

For these cases, a good prompt and maybe some light context engineering is enough. Start simple. Add harness pieces only when you actually see a real problem for example, the agent keeps calling the wrong tool or its output format keeps breaking downstream systems. Build the harness to fix a real, observed failure, not because it sounds impressive.

\n

Trade-offs: What a Harness Costs You

\n

A harness makes an agent more reliable, but it is not free. Before adding one, weigh these trade-offs:

\n\n

The right amount of harness is the smallest one that solves your actual reliability problem. More is not automatically better.

\n

How to Talk About Harness Engineering in an Interview

\n

If you are preparing for a system design or AI engineering interview in 2026, this topic can come up, especially if the role touches on agentic systems, LLM-based products or platform engineering. Here is how to fit it into your interview time well.

\n

Suggested time allocation, if this comes up as a sub-topic in a 45–60 minute system design round:

\n\n

Total: roughly 8–12 minutes if the interviewer wants a deeper discussion. If it is just a quick sub-question inside a bigger system design question, 2–3 minutes with a clear definition and one example is enough. Do not go longer than this unless the interviewer is clearly interested and keeps asking follow-ups in most interviews, this is a supporting topic, not the whole question.

\n

If asked \"how would you improve an AI agent that keeps failing,\" the strongest answer is the OpenAI lesson above: check what is missing in the harness (a tool, a rule, a check) rather than jumping straight to \"let's improve the prompt.\"

\n

Common Mistakes to Avoid When Building a Harness

\n\n

FAQs

\n

1. Is harness engineering the same as prompt engineering?

\n

No. Prompt engineering is about writing good instructions for a single response. Harness engineering is about the full system around the model tools, memory, checks and limits across an entire task.

\n

2. Who created the term \"harness engineering\"?

\n

It became widely known after OpenAI published an engineering post in February 2026, written by Ryan Lopopolo, about their Codex team's experiment. Mitchell Hashimoto turned the idea into the short formula \"Agent = Model + Harness,\" and Martin Fowler's team at Thoughtworks added more structure with the \"guides and sensors\" framing.

\n

3. Why does the harness matter more than the model now?

\n

Because top AI models are performing closer to each other on benchmarks than before. When models are similar, the system built around the model becomes the main thing that decides whether an agent actually works well.

\n

4. What are \"guides\" and \"sensors\" in a harness?

\n

Guides are rules that shape the agent before it acts, like system prompts or instruction files. Sensors are checks that catch problems after the agent acts, like automated tests or output validators.

\n

5. Do I need to build my own harness or can I use a managed one?

\n

Both options exist. Building your own harness gives you full control and flexibility but takes real engineering time. Managed options, like AWS's harness feature for Bedrock AgentCore, are much faster to set up but give you less control over the internals.

\n

6. Is harness engineering only for coding agents?

\n

No. It applies to any AI agent customer support agents, data agents, research agents and more. The Codex example is about coding, but the same ideas (tools, memory, checks, limits) apply to any agent doing real work.

\n

7. How much should I talk about this in an interview?

\n

As a rough guide, 2–3 minutes if it is a small part of a bigger question and up to 8–12 minutes if the interviewer wants a full discussion with a real example. Always end with one concrete example rather than only definitions.

\n

Conclusion

\n

Harness engineering is not really a brand new idea. Engineers have always built systems around raw components to make them reliable this is just that same idea, applied to AI models. What changed in 2026 is that this finally got a name, a formula (Agent = Model + Harness) and real public examples showing how much it actually matters.

\n

If you are working with AI agents in any way building them, reviewing them or just talking about them in interviews the biggest shift to make is this: stop asking \"which model should I use?\" and start asking \"what does my harness look like?\" That is the question that actually decides whether your agent works.

","categoryId":306,"subCategoryId":306,"contentFormat":5,"blogId":182,"userId":"MjlfNF84LVs1OF0ybi10Q19BTmdlX19JdA==","title":"Harness Engineering Explained: What It Is, Why It Matters and How It Works (With Real Examples)","url":"harness-engineering-explained-what-it-is-why-it-matters-and-how-it-works-with-real-examples","bannerImage":"","seoDescription":"Harness Engineering Explained: Complete Guide with Examples, Architecture & Interview Questions (2026)","generatedOn":"2026-08-10T20:01:54","updatedOn":"2026-08-10T20:01:54"},"popularContents":[{"id":153,"title":"Visa Software Engineer 1 (SDE-1) Interview Experience | CodeSignal OA + Graph-Based Technical Rounds","url":"visa-software-engineer-1-sde-1-interview-experience-codesignal-oa-graph-based-technical-rounds","description":null,"seoDescription":" Ace your Visa SDE-1 interview with this complete interview experience covering CodeSignal OA, graph coding rounds, hiring manager questions and tips.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292574Z","viewCount":0},{"id":130,"title":"Rippling SDE-2 Interview Experience (4+ Years Experience) | Offer Received | Coding, LLD & System Design","url":"rippling-sde-2-interview-experience-4-years-experience-offer-received-coding-lld-system-design","description":null,"seoDescription":"Detailed Rippling SDE-2 interview experience with complete 5 rounds, coding questions, rules engine design, system design and preparation tips.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292529Z","viewCount":0},{"id":197,"title":"My Adobe SDE Interview Experience (Aug 2026) 5 Rounds, Selected","url":"my-adobe-sde-interview-experience-aug-2026-5-rounds-selected","description":null,"seoDescription":"Real Adobe SDE interview: 5 rounds, 4 DSA problems (Rotate Array, BSTs, Kth Smallest Matrix), code review & behavioral round. Full solutions + tips.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292634Z","viewCount":0},{"id":122,"title":"Zepto SDE-1 Interview Experience (Backend Developer) : Real DSA, LLD, Chess Game Design","url":"zepto-sde-1-interview-experience-backend-developer-real-dsa-lld-chess-game-design","description":null,"seoDescription":" Zepto SDE-1 Backend Interview Experience covering DSA, Dynamic Programming, LLD, API Design, DB Schema, OOP & Product Company Rounds.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292517Z","viewCount":0},{"id":139,"title":"Blinkit (Eternal) SDE-1 Interview Experience (June 2026) – Offer Received","url":"blinkit-eternal-sde-1-interview-experience-june-2026-offer-received","description":null,"seoDescription":"Blinkit SDE-1 interview experience with a 30 LPA offer. Covers House Robber DP, ticket booking system design, culture fit round and tips.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292557Z","viewCount":0},{"id":135,"title":"Spinny SDE-1 Interview Experience (Selected)","url":"spinny-sde-1-interview-experience-selected","description":null,"seoDescription":"Spinny SDE-1 Interview Experience (Selected) | 4 Rounds Breakdown: Coding, LLD, Java, SQL + Real Interview Questions","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292542Z","viewCount":0},{"id":35,"title":"Cursor vs Copilot : Which AI Coding Assistant Wins in 2025?","url":"cursor-vs-copilot-which-ai-coding-assistant-truly-wins-in-2025","description":null,"seoDescription":"Compare Cursor vs GitHub Copilot on speed, context awareness, multi-file support, pricing and code quality to choose the best AI coding assistant for developers","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292455Z","viewCount":0},{"id":83,"title":"Uber SDE 2 Interview Experience (5 Rounds, Selected) - Complete DSA Questions with solution, System Design & Managerial Round","url":"uber-sde-2-interview-experience","description":null,"seoDescription":"Uber SDE 2 interview experience with 5 rounds, real DSA questions, system design, coding round, and preparation tips to crack Uber interviews.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292502Z","viewCount":0},{"id":171,"title":"Meesho SDE-1 Backend Interview Experience (Remote | 3 Round) - Rejected","url":"meesho-sde-1-backend-interview-experience-remote-3-round-rejected","description":null,"seoDescription":"Read a real Meesho SDE-1 Backend interview experience covering the online assessment, DSA interview, machine coding round, LLD questions and preparation tips.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292587Z","viewCount":0},{"id":173,"title":"Uber SDE-2 Interview Experience : LLD, HLD, DSA & Hiring Manager Round","url":"uber-sde-2-interview-experience-lld-hld-dsa-hiring-manager-round","description":null,"seoDescription":"Read a real Uber SDE-2 interview experience covering DSA, low-level design, high-level system design, behavioral rounds, hiring freeze and key takeaways.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0292619Z","viewCount":0}],"latestContents":[{"id":219,"title":"6 Tools That Made My Life Easier as a Software Engineer","url":"6-tools-that-made-my-life-easier-as-a-software-engineer","description":null,"seoDescription":"The 6 developer tools I use daily as a software engineer: Git, VS Code, Docker, Postman, Chrome DevTools, and AI assistants, with real tips, mistakes, and trade","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314372Z","viewCount":0},{"id":218,"title":"When Should a Business Use Multiple AI Agents Instead of One?","url":"when-should-a-business-use-multiple-ai-agents-instead-of-one","description":null,"seoDescription":"Single agent or multi-agent AI? Learn the 4 signals that justify splitting agents by knowledge, permissions, and risk, plus routing and handoff tips.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314416Z","viewCount":0},{"id":216,"title":"AI in Clinical Trials Market Estimated to Experience a Hike in Growth by 2035","url":"ai-in-clinical-trials-market-estimated-to-experience-a-hike-in-growth-by-2035","description":null,"seoDescription":"The exclusive information about market dynamics serves as a valuable guide to predict economic scenarios and initiatives taken to enhance future growth. Our mar","contentType":5,"generatedOn":"2026-10-14T22:56:17.031447Z","viewCount":0},{"id":217,"title":"AI in Clinical Trials Market Estimated to Experience a Hike in Growth by 2035","url":"ai-in-clinical-trials-market-estimated-to-experience-a-hike-in-growth-by-2035","description":null,"seoDescription":"The exclusive information about market dynamics serves as a valuable guide to predict economic scenarios and initiatives taken to enhance future growth. Our mar","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314485Z","viewCount":0},{"id":215,"title":"What Happens When an AI Agent Doesn't Know the Answer?","url":"what-happens-when-an-ai-agent-doesnt-know-the-answer","description":null,"seoDescription":"Most AI agents fail quietly. They guess instead of saying \"I don't know.\" Here's how to design better fallback and human-handoff behavior.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314584Z","viewCount":0},{"id":214,"title":"Greedy Algorithms Explained: How They Work, When They Fail and How to Use Them","url":"greedy-algorithms-explained-how-they-work-when-they-fail-and-how-to-use-them","description":null,"seoDescription":"Learn greedy algorithms step by step with C# code Dijkstra, Huffman coding, knapsack and MSTs plus when greedy fails and how to prove it's correct","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314602Z","viewCount":0},{"id":213,"title":"Amazon SDE II Interview Experience (Bangalore, Selected) ~ Aug 2026","url":"amazon-sde-ii-interview-experience-bangalore-selected-aug-2026","description":null,"seoDescription":"Amazon SDE II interview experience from Bangalore covering 4 rounds, DSA, LLD, system design, Leadership Principles, coding questions and selection.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314616Z","viewCount":0},{"id":212,"title":"How to Get 10x Better AI Answers Without Writing Better Prompts : 10 Proven Techniques","url":"how-to-get-10x-better-ai-answers-without-writing-better-prompts-10-proven-techniques","description":null,"seoDescription":"Get better AI answers without complex prompts. Learn 10 practical techniques using context, examples, tools, feedback, and verification.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314629Z","viewCount":0},{"id":211,"title":"I Interviewed for a Microsoft SDE I Role. Here's Everything That Happened.","url":"i-interviewed-for-a-microsoft-sde-i-role-heres-everything-that-happened","description":null,"seoDescription":"My real Microsoft SDE I interview experience, all 4 rounds, the exact DSA problems with fully tested solutions, the WhatsApp system design round","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314644Z","viewCount":0},{"id":140,"title":"PolicyBazaar Software Development Engineer (SDE) Interview Experience | DSA, Core CS & System Design","url":"policybazaar-software-development-engineer-sde-interview-experience-dsa-core-cs-system-design","description":null,"seoDescription":"Detailed PolicyBazaar SDE interview experience covering 3 rounds: DSA coding, core CS assessment and system design with key learnings and insights.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0314659Z","viewCount":0}],"relatedContents":[{"id":75,"title":"AI Productivity Trends 2026: What Experts Reveal","url":"ai-productivity-trends-2026-what-experts-reveal","description":null,"seoDescription":"Explore AI productivity trends 2026, including AI agents, automation, and workplace shifts shaping the future of AI productivity and work efficiency.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0444344Z","viewCount":0},{"id":74,"title":"Best AI Tools for Productivity in 2026","url":"best-ai-tools-for-productivity-in-2026","description":null,"seoDescription":"Best AI tools for productivity in 2026. Discover top AI apps to save time, automate work, and boost efficiency with smart AI productivity tools.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0444362Z","viewCount":0},{"id":58,"title":"Impact of AI on Software Developers: Are Developer Jobs Safe in the Future?","url":"impact-of-ai-on-software-developers-are-developer-jobs-safe-in-the-future","description":null,"seoDescription":"Will AI replace programmers? Learn how AI coding tools are reshaping software development and what developers must do to stay relevant.","contentType":5,"generatedOn":"2026-10-14T22:56:17.0444375Z","viewCount":0},{"id":44,"title":"Top 12 AI Skills to Learn in 2026: The Ultimate Career Roadmap","url":"top-12-ai-skills-to-learn-in-2026-the-ultimate-career-roadmap","description":null,"seoDescription":"Master the top 12 AI skills in 2026 to future-proof your career. From Agentic AI to MLOps, discover the essential technical and strategic skills for the AI era.","contentType":5,"generatedOn":"2026-10-14T22:56:17.044439Z","viewCount":0},{"id":43,"title":"What Is a Coding Assistant? A Complete Guide for Modern Developers","url":"what-is-a-coding-assistant","description":null,"seoDescription":"","contentType":5,"generatedOn":"2026-10-14T22:56:17.044441Z","viewCount":0},{"id":39,"title":"Top 10 AI Coding Tools Every Developer Should Learn in 2026","url":"top-10-ai-coding-tools-every-developer-should-learn-in-2026","description":null,"seoDescription":"","contentType":5,"generatedOn":"2026-10-14T22:56:17.0444426Z","viewCount":0},{"id":153,"title":"Agentic AI : The Rise of Autonomous Digital Agents How They Work, Why They Matter and What’s Next","url":"agentic-ai-the-rise-of-autonomous-digital-agents-how-they-work-why-they-matter-and-whats-next","description":null,"seoDescription":"Explore how Agentic AI autonomous AI systems powered by LLMs and reinforcement learning. Agentic AI The Rise of Autonomous Digital Agents How They Work Why They Matter and What’s Next","contentType":2,"generatedOn":"2026-10-14T22:56:17.0444439Z","viewCount":0}]}}},"source":{"isMobile":false}}; window.__CLIENT_RENDER__ = false;