AI for product managers Running it

Lesson 9 of 9

The agent harness.

Everything around the model that turns it into a working product, and how every part of this course fits together in one shopper’s question.

By Nagesh Koritala, product manager October 2026

  • About 15 minutes
  • 7 parts
  • 6 quick questions
  • A worksheet
A large sheet labeled the harness. In its center, the model, in red. Around it, eight parts, each with the lesson that covers it: the loop and the planner (lesson 2), tools (lesson 3), memory and state (lesson 9), context management (lessons 1 and 9), guardrails (lesson 6), evals (lesson 5), and observability (lesson 7). A note: same model, different harness, different product. The harness everything around the model The looplesson 2The plannerlesson 2Toolslesson 3Memoryand statelesson 9Contextmanagementlessons 1 and 9Guardrailslesson 6Evalslesson 5Observabilitylesson 7 The modelfrom a provider same model, different harness, different product

Before you start

The made-up furniture store’s assistant passed every test in the lab. Then a shopper writes: “Last week I told you my hallway door is 30 inches. Can the Harbor sofa fit, and can it get here by Saturday?” The assistant replies: “Happy to help! What’s your door width?” It’s the same model that aced the demo. Before you read on: what do you think went wrong? Write it in one sentence.

It stays on this device only. You’ll see it again at the end.

In this lesson, you’ll learn to

  • Explain what an agent harness is, and why the same model can perform very differently in different harnesses
  • Follow one shopper’s question through every part of an AI product, from context to evals
  • Decide what goes into the context window, what gets summarized, and what is fetched only when needed
  • Choose what an assistant should remember across sessions, and what it should forget
  • Plan long-running tasks with progress notes, checkpoints, and stopping conditions
  • Weigh build against buy, and run a launch-readiness check before an AI feature ships

Key terms

Agent harness
Everything around the model that turns it into a working product. Also called scaffolding.
Context engineering
Deciding, at every step, which information goes into the model’s context window and which stays out.
Compaction
Summarizing an older part of a conversation and continuing with the summary, so a long task fits in the context window.
Memory
Information saved outside the context window and brought back in a later turn or session, such as a shopper’s saved room size.
State
Where a task stands right now: the plan, what’s done, what’s next, and the results so far.
Checkpoint
A planned pause where the work is saved, and often where a person reviews it before the agent goes on.
Stopping condition
A rule that ends a run: the job is done, a limit is reached (such as a maximum number of steps or a spending limit), or a person is needed.

The idea

When an AI feature fails, the first instinct is to blame the model and try a newer one. Sometimes that helps. Often it doesn’t, because the model was never the problem. The shopper in the opening story told the assistant her door width. The harness just never put it back in front of the model.

This lesson brings the course together. You’ll walk one shopper’s question through every part you’ve learned, then go deeper on what only this lesson covers: context, memory, long tasks, build or buy, and launch readiness. The furniture store is still made up.

The lesson, in seven parts

  1. What the harness is, and why it matters as much as the model.

    In lesson 1 you saw that an AI product is a model plus everything your team builds around it. That “everything around it” has a name: the harness. Some engineers call it the scaffolding. Anthropic’s Applied AI team now uses a short definition of an agent: “LLMs autonomously using tools in a loop.” The harness supplies the loop, the tools, and everything else the model can’t do on its own.

    Here’s why that matters to you. In January 2025, Anthropic wrote about SWE-bench, a public test of real software engineering tasks that scores the model and its scaffolding together. Their words: “The performance of an agent on SWE-bench can vary significantly based on this scaffolding, even when using the same underlying AI model.” Same model. Different harness. Different results.

    Erik Schluntz and Barry Zhang, describing an agent they built for that test, wrote that they “actually spent more time optimizing our tools than the overall prompt.” Small harness decisions add up. Here are the parts:

    PartAt the made-up furniture storeLesson
    The loopKeeps going until both questions are answered2
    The planner“Check the door, stock, and delivery, then answer”2
    ToolsDoorway-size check, stock check, delivery date check3
    SubagentsA helper that compares three sofas4
    Memory and stateThe shopper’s saved door width and shortlist9
    Context managementThe Harbor’s page goes in; the catalog stays out1 and 9
    GuardrailsNo delivery date the check didn’t return6
    EvalsReal questions with known-good answers5
    ObservabilityEvery step of every answer, saved as a trace7
    Cost and speedSimple questions go to a smaller model8

    Made-up example. Teams group these parts differently, and some count subagents and cost controls as part of the loop; what matters is that someone owns each one.

    Look at the opening story again. The model could answer the doorway question. Memory and context management failed to give it the door width. That’s a harness bug, and no model upgrade would fix it.

  2. One question, through every part.

    Now walk the shopper’s question through a harness that works, with the lesson for each part:

    • The shopper asks. She’s signed in, so the harness knows who’s asking.
    • It builds the context (lessons 1 and 9): the system prompt, her saved door width, the Harbor’s product page, and the last few turns. The full catalog stays out.
    • The model plans (lesson 2). Two questions need two checks: will it fit, and can it arrive by Saturday?
    • It calls tools (lesson 3): the doorway-size check, then the stock and delivery date checks. Each result goes back into the window, and the loop repeats until both are answered.
    • Guardrails check the draft (lesson 6). Is every date one the delivery check returned? Is every measurement from the product page? Is anything private showing?
    • It answers: “The Harbor won’t fit through a 30-inch door, but the Harbor Modular will. The Harbor Modular’s earliest delivery to you is Monday, not Saturday.”
    • The trace is recorded (lesson 7): every step, tool call, and result, so a wrong answer can be traced to where it went wrong.
    • Evals score it (lesson 5). Samples of real traces are checked against your criteria, by people or an automated grader, and failures become new test cases with known-good answers.
    One shopper’s question, in eight numbered steps. Top row, left to right: 1, the shopper asks; 2, build the context (lessons 1 and 9); 3, plan the next step (lesson 2); 4, call tools (lesson 3). A dashed arrow from tools back to planning: repeat until done. Then down to the bottom row, right to left: 5, check guardrails (lesson 6); 6, answer with facts; 7, record the trace (lesson 7); 8, score it with evals (lesson 5). A note: cost and speed apply at every step, lesson 8. 1Shopperasksthe question2Build thecontextlessons 1, 93Plan thenext steplesson 24Calltoolslesson 35Checkguardrailslesson 66Answerwith factsthe reply7Recordthe tracelesson 78Score itwith evalslesson 5 repeat until done cost and speed apply at every step (lesson 8)
    One question, eight steps, and the lesson for each. Made-up example.

    Under all of it runs lesson 8: every step costs tokens and time. If your team uses an AI gateway, every model call in this walk-through passes through it. When something goes wrong, this walk-through is your map. Ask which step it went wrong in.

  3. Context engineering: what goes into the window.

    In September 2025, Anthropic’s Applied AI team described context engineering as “the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference.” In plain words: at every step, someone decides what the model gets to see. That’s the prompt, plus tool results, memory, documents, and the conversation so far.

    Why not send everything? Lesson 1 introduced context rot: as the window fills, recall gets worse. The same team says models have an “attention budget,” and every token spends some of it. Their principle: find “the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome.” Each piece of information ends up in one of three places:

    Context engineering at the made-up furniture store, in three columns. In the window now: the system prompt, the Harbor sofa’s product page, the shopper’s door width of 30 inches, and the last few turns. Shortened, summarized or cleared: the earlier chat and old tool results become a short note. Fetched only when needed: the full catalog, the delivery policy, and order history. A note: the fewest facts that get the answer right. In the windownowSystem promptHarbor pageDoor: 30 inchesLast few turnsShortenedsummarized or clearedEarlier chatOld tool resultsFetched onlywhen neededFull catalogDelivery policyOrder history A short note the fewest facts that get the answer right
    Three places information can go. Made-up example from the furniture store.
    • In the window now: what this step needs. For the doorway question, the Harbor’s measurements and the door width, not the whole catalog.
    • Shortened: compaction summarizes an older stretch of conversation and carries on with the summary. Anthropic warns that overly aggressive compaction can lose “subtle but critical context whose importance only becomes apparent later.” A lighter touch is clearing old tool results the model has already used.
    • Fetched only when needed: the article calls this “just in time.” The agent keeps a pointer, like a product ID, and loads details with a tool when a step needs them. It saves room but is slower, so some teams load the basics up front and fetch the rest.
    • A question for your engineers: “For our five most common questions, what exactly is in the window?” If nobody knows, start there.
  4. Memory across sessions: what to keep, what to forget.

    A model doesn’t remember last week on its own. Memory is something the harness builds: it saves information outside the window and puts the right piece back when it’s needed. In the opening story, the door width was saved but never put back.

    Anthropic’s memory tool documentation shows one common pattern. The model asks to save or read a note, and your application does the storing: “You control where and how the data is stored through your own infrastructure.” Its safeguards are your job too, like stripping sensitive data before it’s written and deleting memories nobody has used in a long time.

    Privacy law points the same way. In the European Union, the GDPR says personal data should be “limited to what is necessary” and kept no longer than necessary, and in certain cases people can have it erased. Rules differ by country, so check with your privacy and legal team. A useful test: does it help the shopper next time, and would they expect you to keep it?

    InformationA sensible choiceWhy
    Door width and room size she savedKeep, and show it to herShe chose to share it, and it saves measuring again
    Her sofa shortlistKeep, with a way to clear itLets her pick up where she left off
    The full chat transcriptDon’t keep in memoryMost of it won’t help next time
    Payment card detailsNever put in assistant memoryNot needed for advice, and a serious risk if exposed
    A guess about her incomeDon’t storeShe didn’t share it and wouldn’t expect it kept

    Made-up example. Check your own rules with your privacy and legal team.

    Two more product decisions: can shoppers see and delete what’s remembered? And when a memory may be stale, like a door width from before they moved, does the assistant confirm it first? “You told me your door is 30 inches. Is that still right?” prevents a big mistake.

  5. Long-running tasks and checkpoints.

    Not every job fits in one answer. Say the made-up store asks an agent to check all 3,000 product pages for missing or conflicting measurements. That takes many context windows. In a November 2025 Anthropic article, Justin Young names the core problem: each new session “begins with no memory of what came before,” like engineers working in shifts who arrive knowing nothing of the last shift.

    His team saw three failures: the agent tried to do too much at once and ran out of room; a later session saw progress and declared the job done; and work was marked complete without proper testing. Summarizing alone wasn’t enough. What helped:

    • Write the full list of work first, with every item marked not done, so no session can declare victory early.
    • Work on one item at a time.
    • End every session by writing progress notes and saving the work, so the next session can read what happened.
    • Start every session by reading those notes and running a quick check that nothing is broken.
    A long-running task in four steps, left to right: session 1, session 2, a checkpoint, and session 3. Each session reads the progress notes, checks a batch of pages, and writes the notes. At the checkpoint, a person approves fixes before they ship. Below, one shared strip: progress notes, what’s done and what’s next. A note: each session starts with no memory, so the notes carry the work. Session 1reads the noteschecks a batchwrites the notesSession 2reads the noteschecks a batchwrites the notesCheckpointa personapproves fixesbefore they shipSession 3reads the noteschecks a batchwrites the notes Progress notes: what’s done, what’s next each session starts with no memory, so the notes carry the work
    Each session reads the notes, does one batch, and writes the notes. A checkpoint lets a person approve. Made-up example.

    Schluntz and Zhang add two controls. Agents can “pause for human feedback at checkpoints or when encountering blockers,” and teams often add stopping conditions, like a maximum number of steps. At the store, a person approves every measurement fix before it goes live, and each run stops after a set number of pages or a set spend (lesson 8). You decide where the pauses go. A good rule of thumb: pause before anything a customer will see, or anything hard to undo.

  6. Build, buy, or something in between.

    Sooner or later someone asks: build our own harness, or buy one? It’s rarely all or nothing. You’re choosing how much of the harness your team writes.

    Schluntz and Zhang note that frameworks make it easy to start, but “they often create extra layers of abstraction that can obscure the underlying prompts and responses, making them harder to debug.” They suggest starting with the provider’s API directly, and understanding the code under any framework you use. Anthropic’s Applied AI team puts it simply: “do the simplest thing that works.”

    OptionWhat you getWhat to watch
    Buy a ready-made assistantThe fastest startCan you see traces, run your evals, and control guardrails and memory?
    Build on a framework or agent SDKA head start on the loop and toolsDoes your team understand what it does underneath?
    Build directly on a model APIThe most control and visibilityMore engineering time; you own every part

    General trade-offs, not a ranking. It depends on your team, timeline, and how central the feature is.

    Whichever you choose, your product data, evals, guardrail decisions, and the launch call stay yours. When a vendor demo looks great, run it on your own questions and ask to see the trace of a wrong answer. If you can’t see why it was wrong, you can’t fix it.

  7. A launch-readiness checklist.

    Bring this checklist to a launch review. You don’t need perfect answers. You do need an answer, and an owner, for each line.

    Ask

    • The customer problem it solves is written down, with the product metric that will show it helped and when you’ll check it after launch (lesson 1).
    • The job and the never-do list are written down (lessons 1, 6).
    • Facts come from data someone owns (lesson 1).
    • The loop has stopping conditions; long tasks have checkpoints (lessons 2, 9).
    • Risky tool actions need a person’s approval (lesson 3).
    • Evals on real questions pass the bar agreed in advance (lesson 5).
    • Guardrails are tested against expected attacks and mistakes (lesson 6).
    • Every answer leaves a trace, and someone reviews them (lesson 7).
    • Cost and wait per answer are inside your limits (lesson 8).
    • What’s remembered is visible and deletable (lesson 9).
    • There’s an off switch, and a person customers can reach.

    Avoid

    • “It worked in the demo.” (A demo is a handful of answers, not your customers’ thousands.)
    • “We’ll add evals after launch.” (Then nobody can say what “good enough” meant.)
    • “Let’s remember everything, just in case.” (More memory means more risk and more noise in the window.)

    A checklist doesn’t make a product safe on its own. It makes sure the right questions were asked before customers find the gaps.

With AI: Harness work is where AI can help you most as a product manager. Paste a trace of a bad answer into an assistant and ask it to point to the step where things went wrong, or ask it to walk your feature through the launch checklist and list what’s unknown. Then check its reasoning against the trace yourself. It can find likely suspects quickly; you still decide what’s true.

Check your understanding

Answer each one in your head or on paper first. Then open the answer to check.

1What is an agent harness?

Everything around the model that turns it into a working product: the loop, planner, memory and state, tools, context management, guardrails, evals, and observability.

2Why can the same model perform very differently in two products?

Because results depend on the model and its harness together. Anthropic noted that SWE-bench scores can vary significantly with the scaffolding, even with the same model.

3What’s the guiding principle of context engineering?

Put the smallest set of high-signal information in the window that gets the job done. More isn’t better, because recall degrades as the window fills.

4What’s the difference between compaction and memory?

Compaction summarizes the older part of a conversation so the current task fits in the window. Memory saves information outside the window, so it can be brought back in a later turn or session.

5Name two habits that help long-running tasks survive a fresh session.

Any two of: list all the work first, marked not done; do one item at a time; end each session with progress notes; start each session by reading them and checking nothing is broken.

6You’re buying a ready-made assistant. Name two things you’d check first.

Any two of: whether you can see its traces, run your own evals, set your own guardrails, and control what it remembers.

Practice: map a harness and judge launch readiness

The made-up furniture store wants its assistant to handle a new job: “Help me plan a whole living room, over a few visits.” Using the worksheet below:

  1. Walk one shopper question through each part of the harness.
  2. Sort information into: in the window, summarized, fetched when needed.
  3. List what it remembers between visits, what it never keeps, and how shoppers delete it.
  4. Name one checkpoint and one stopping condition.
  5. Mark each launch checklist line ready, not ready, or unknown, with an owner.
Show a model answer

Question: “My room is 12 by 14 feet and I like the Harbor. What else would fit?” Context: system prompt, saved room size, the Harbor’s page, last few turns; the catalog is searched with a tool, not loaded. Summarized: earlier visits, kept as a short note of what she liked and ruled out. Tools: room planner, product search, stock check. Guardrails: measurements only from product pages; no delivery promise without the delivery check. Memory: keep room size and shortlist (visible, deletable, confirmed after three months); never payment details. Checkpoint: the shopper approves the plan before anything goes in the cart. Stopping condition: at most ten tool calls, then ask the shopper. Launch: evals ready; traces ready; memory deletion not ready (owner: account team); cost per answer unknown (owner: engineering lead). Verdict: not ready until deletion works. (Made-up example.)

Back to where you started

The short answer

The agent harness is everything around the model that turns it into a working product: the loop, the planner, memory and state, tools, context management, guardrails, evals, and observability. The model writes the words; the harness decides what it sees, what it can do, and what it remembers. Much of what makes an AI product good or bad lives there, and you shape every part.

Go back to your sentence. If you blamed the model, that’s a very common first guess, and now you have a better one. The model never saw the door width. The harness saved it but didn’t put it back in the window. Fixing that is a product decision about memory and context, and it’s yours to make.

Common mistakes

New product managers on AI features often:

  • Blame the model for problems that live in the harness.
  • Send everything into the context window, and pay for it in cost, speed, and quality.
  • Remember everything about customers, without deciding what’s needed or how it’s deleted.
  • Let long tasks run without progress notes, checkpoints, or a stopping condition.
  • Buy a ready-made assistant without checking that their team can see its traces and run their own evals on it.

Try this today

Pick any AI assistant you use, at work or at home, and look at it as a harness:

  1. Tell it a fact about yourself, start a new chat, and see whether it remembers. Then find where you can delete what it saved.
  2. Ask something that needs fresh information, like today’s weather. Does it use a tool, and say so?
  3. Run the launch checklist on one AI feature at your company.

Worksheet: harness map and launch check

HARNESS MAP

The customer's question (in their words):

Context:
  In the window now:
  Summarized or cleared:
  Fetched only when needed:

Plan and loop steps:
Stopping condition (steps, time, or spend):

Tools, and which need a person's approval:

Memory:
  Keep:
  Never keep:
  How customers see and delete it:

Long tasks: where progress notes live; checkpoints:

Build or buy: can we see traces, run our evals, set our guardrails?

LAUNCH CHECK (ready / not ready / unknown, owner)
  Job and never-do list (L1, L6):
  Data owned and correct (L1):
  Loop limits and checkpoints (L2, L9):
  Tools described; risky actions approved (L3):
  Evals pass the agreed bar (L5):
  Guardrails tested (L6):
  Traces recorded and reviewed (L7):
  Cost and wait inside limits (L8):
  Memory visible and deletable (L9):
  Off switch and a human to reach:

Verdict:

Questions people ask

What is an agent harness?

It’s everything around an AI model that turns it into a working product: the loop that runs it, the planner, memory and state, tools, context management, guardrails, evals, and observability. Some engineers call it the scaffolding.

What is context engineering?

Deciding which information goes into the model’s context window at each step, and which stays out. Anthropic describes it as the natural progression of prompt engineering: it covers everything that lands in the window, including tool results, memory, documents, and message history.

How do AI assistants remember things between conversations?

The model doesn’t remember on its own. The product saves information outside the context window and puts it back in later, for example with a memory tool. The team decides what is saved, where, for how long, and how people can delete it.

What is context compaction?

Summarizing the older part of a long conversation or task, then continuing with the summary, so the work fits in the context window. The risk is losing a detail that turns out to matter later.

Should we build or buy an AI agent?

It depends on your team, timeline, and how central the feature is. Buying is fastest; building gives the most control. Whichever you choose, make sure you can see traces, run your own evals on your own questions, and control guardrails and memory.

Sources and further reading

All lessons

Keep going

You’ve finished the course.
Now you can see the whole product.

Nine lessons, one assistant, and every part around the model: the loop, tools, subagents, evals, guardrails, traces, cost, and the harness that holds them together. Go back to lesson 1 and reread it. You’ll see it differently now.

Got a question this lesson didn’t answer? Email me. I read every note.

The course as one picture. In the middle, the model, taught in lesson 1. Around it, one part per lesson: 2 the loop, 3 tools, 4 subagents, 5 evals, 6 guardrails, 7 observability, 8 cost and speed. Around everything, a dashed frame: the harness, lesson 9. 9The harness: all of it 2 The loop 3 Tools 4 Subagents 5 Evals 6 Guardrails 7 Observability 8 Cost and speed 1 The modelhow it works