---
title: "Discussion on \"What Is an AI Harness? A Simple Guide with Real Examples\" | Hashnode"
description: "Discussion on \"What Is an AI Harness? A Simple Guide with Real Examples\". Agent = Model + Harness. Learn the 6 parts, the agent loop, and how OpenAI and Anthropic use harnesses in real projects."
url: "https://hashnode.com/posts/what-is-an-ai-harness-a-simple-guide-with-real-examples/6ae6d809c9050aaa01da2929"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What Is an AI Harness? A Simple Guide with Real Examples](https://merakesh99.hashnode.dev/what-is-an-ai-harness-a-simple-guide-with-real-examples?utm_source=hashnode&utm_medium=feed)

Agent = Model + Harness. Learn the 6 parts, the agent loop, and how OpenAI and Anthropic use harnesses in real projects.

Nov 1 · 12 min read · merakesh99.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#ai-agents](https://hashnode.com/tag/ai-agents)
-   [#harness-engineering](https://hashnode.com/tag/harness-engineering)
-   [#llm](https://hashnode.com/tag/llm)
-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#llm-memory](https://hashnode.com/tag/llm-memory)
-   [#harnessengineering](https://hashnode.com/tag/harnessengineering)

## Written by

[Rakesh Sadhukhan](https://hashnode.com/@merakesh)

@merakesh · kolkata

  
[View profile](https://hashnode.com/@merakesh)

Software Developer

## Responses 1

Markdown supported · ⌘↵ to post

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Nov 1](https://hashnode.com/posts/what-is-an-ai-harness-a-simple-guide-with-real-examples/6ae6d809c9050aaa01da2929/comment/6ae7900ea8133a4bc712f693)

The small agent loop exposes a bookkeeping detail I would make explicit: it appends toolResult messages, but never adds the assistant message containing the corresponding tool calls to messages first. That can leave the next model call with results whose request context is missing.

I would persist the assistant reply and its call IDs before execution, then append one result for each call, including denials. A transcript-level check could validate that pairing independently of whether the generated code passes tests. The harness would then preserve both the work and the conversation that explains it.
