Skip to content

AI 302 · Module 1

What Is an Agent Harness?

Agents can already reason, plan and use tools. Why do they still need a harness?

Start Section 1
0 / 5 completed
Sync my progressJoin a session to keep progress across devices and share it with your instructor

Info

After you join, your completed lesson numbers are sent to your instructor together with your learner code, so they can see your progress. Use the codes your instructor gave you, and do not enter your name, company secrets or other personal data. Progress is kept with the rest of that session's data.

Learning objectives

  • Explain what an Agent Harness is and how it differs from Agent logic
  • Describe the harness as a runtime control layer between a trigger, the agent and its tools
  • Distinguish Agent reasoning, Workflow logic, Harness control, Tool responsibility and Human control
  • Name the tool, verification, human and failure boundaries that a harness enforces
  • Explain what can go wrong without a harness: opaque execution, lost state, duplicated actions, cascading failures, unbounded context and runs that cannot be resumed
  • Choose one real system, described with simulated data, to carry through the whole course

Problem and need

8 min

The demo works. Then it runs for a week.

In AI 202 and AI 301 you designed agents that plan, reason and work in teams. A design like that can look excellent in a demo. This course asks what happens next: when the work runs for a long time, holds state, calls tools that can fail, and produces results that someone must be able to trust. The core question is: agents can already reason, plan and use tools, so why do they still need a harness?

Work scenario (simulated)

An agent processes incoming purchase requests overnight: it reads each request, checks it against the budget rules, drafts an approval note and sends a notification. On the second night a network error interrupts it after it has sent 40 notifications. Someone restarts it, and it starts again from the first request, so 40 people receive a second notification. In the morning nobody can tell which requests were finished, which were skipped, or why one request was approved twice. The agent reasoned well at every step. The problem was everything around the steps.

  • Nobody could see what the run had done or where it stopped
  • The progress of the run was not saved, so the restart began from the beginning
  • Repeating the run repeated actions that should happen only once
  • No one had defined when a person should be asked, or when the run should stop

Warning

A better prompt or a stronger model does not fix these problems. They are not about what the agent thinks. They are about how its execution is controlled. That controlling structure is the subject of this course.

Key takeaway: A capable agent is not the same as a reliable system. Reliability comes from how execution is controlled, not only from how well the agent reasons.

Core concepts

10 min

Agent logic and Agent Harness

Two different questions are being answered whenever an agent system runs. Agent logic answers: what should I do next? An Agent Harness answers: how do we safely execute, track, pause, verify, resume, recover and control what happens next? The harness is the runtime control layer that wraps the agent.

The harness layer: from trigger to tools
  1. Trigger: a user request, a schedule, an event or an incoming document starts a run
  2. Agent Harness: holds the State, runs the control loop, saves checkpoints, applies verification and human controls, handles retry and recovery, and records what happened
  3. Agent / Model: decides what to do next inside the limits the harness sets
  4. Tools / Data / Environment: the outside systems the agent acts on, reached only through the harness

Text equivalent: the diagram is a vertical stack read from top to bottom. A trigger starts a run. The run goes into the Agent Harness, which contains seven parts: State, Control Loop, Checkpoints, Verification, Human-in-the-Loop, Retry and Recovery, and Observability. The harness then calls the Agent or Model, and the agent acts on Tools, Data and the Environment. Control and results travel back up through the same harness, so nothing reaches the outside world, and nothing returns from it, without passing through the harness.

Agent logic compared with Agent Harness (simulated purchase request example)
Agent logicAgent Harness
Main questionWhat should I do next?How do we safely run, track, pause, verify, resume and recover?
Concerned withReasoning, planning and choosing an actionState, control, limits, evidence and human involvement
ExampleDecide that this request needs a budget check before approvalRecord that the request is in the budget-check step, stop after three failed attempts, and ask a person if the amount is over the limit
If it is weakThe agent makes poor choicesGood choices are still lost, repeated, hidden or left without oversight

Info

The harness is not a replacement for the agent and not a particular product. It is a design layer, and the concepts in this course apply whether you build it yourself or use a framework.
Check yourself

Which statement best describes the difference between Agent logic and an Agent Harness?

Which statement best describes the difference between Agent logic and an Agent Harness?

Key takeaway: Agent logic asks what to do next. The harness controls how execution is carried out, tracked and recovered, and it sits between the trigger, the agent and the tools.

12 min

Who controls what: five kinds of responsibility

When you look at a real system, each piece of behavior belongs to one of five kinds of responsibility. Being able to classify them is the first harness skill, because a control placed in the wrong layer either does not work or works only by luck.

Five kinds of responsibility (simulated purchase request examples)
KindWhat it isExample
Agent reasoningThe model deciding, interpreting or generatingDecide that a request describes a software subscription and not a hardware purchase
Workflow logicThe designed sequence of steps for the taskFirst check the budget, then draft the note, then notify
Harness controlRuntime rules about execution itselfSave progress after each request; stop after three failed attempts; do not send a notification twice
Tool responsibilityWhat an outside system does or refuses to doThe budget system rejects a request for an unknown cost centre
Human controlA person decides, approves or overridesA manager approves any request above the agreed amount

Belongs to the agent

  • Interpreting the request
  • Choosing the next action within the workflow
  • Writing the draft text

Belongs to the harness

  • Knowing which step the run is in
  • Deciding whether to retry, stop or ask a person
  • Recording what happened, so it can be resumed and reviewed
  • Workflow logic says what the steps are; harness control says how the running of those steps is governed
  • A Tool may enforce its own rules, but the harness must still handle what happens when the Tool says no or fails
  • Human control is a deliberate design element. It is not what remains when automation gives up
  • If a rule must hold even when the model makes a mistake, it belongs in the harness or in a tool, not in the prompt alone

Info

Some behavior can be defended in two layers. What matters is that you can say which layer owns it and what happens if that layer fails.
Check yourself

A team writes in the agent prompt: "Never send the same notification twice." Which is the most reliable design?

A team writes in the agent prompt: "Never send the same notification twice." Which is the most reliable design?

Key takeaway: Classify behavior as Agent reasoning, Workflow logic, Harness control, Tool responsibility or Human control. Put a rule that must always hold in the harness or a tool, not only in the prompt.

Why a harness, and its boundaries

10 min

Why a harness: what breaks without one

The harness matters because of what happens when it is missing. Compare the same simulated overnight run with and without one.

Without a harness

  • Execution is opaque: nobody knows what happened or where it stopped
  • State may be lost, so an interruption means starting over
  • Retries may duplicate actions that should happen once
  • A failure in one step can cascade into the next
  • Context may grow without control
  • Humans do not know when to step in
  • A long task cannot be resumed

With a harness

  • Each step and its outcome are recorded and can be reviewed
  • Progress is saved so the run can continue from a known point
  • Retries follow a policy and avoid repeating irreversible actions
  • A failure is contained and routed to recovery or a person
  • Working context is kept within a budget
  • Defined points ask a person to review or approve
  • A run can pause, resume or stop safely
Four boundaries a harness enforces (simulated examples)
BoundaryThe question it answersExample
Tool boundaryWhich tools and actions may this run use?The agent may read the budget table but may not change it
Verification boundaryWhat must be checked before a result is accepted?A drafted note must name the cost centre and the amount before it is sent
Human boundaryWhen must a person review, approve or take over?Any request above the agreed amount waits for a manager
Failure boundaryWhat happens when something goes wrong, and how far may it spread?After three failed attempts the run stops and reports, without touching later requests

Info

Implementation example (not the only model): a stateful framework such as LangGraph can express a harness as a graph. There the harness state is the graph state, each step is a node, and the control that chooses the next step is an edge. This is one way to build it. The concepts in this course hold whichever tool you use, and later modules add more examples clearly labelled as examples.

Human-AI-Human: a person defines the task, the limits and the points where they will be asked, the agent works inside those limits, and a person reviews the outcome and remains responsible for it.

Check yourself

A run is interrupted halfway and the system restarts it from the beginning, repeating actions that had already taken effect. Which harness capability is most clearly missing?

A run is interrupted halfway and the system restarts it from the beginning, repeating actions that had already taken effect. Which harness capability is most clearly missing?

Key takeaway: Without a harness, execution is opaque, state is lost and actions repeat. A harness enforces the tool, verification, human and failure boundaries, and a person stays responsible.

Practice and apply

10 min

Practice: Agent Logic or Harness?

Activity 1 gives you 8 simulated design decisions. For each, choose one: Agent reasoning, Workflow logic, Harness control, Tool responsibility or Human control, and say why. Some cases can reasonably be read two ways; what matters is that you can explain your reasoning. Please do not enter real company secrets, client personal data or any unauthorized sensitive information in this exercise.

8 design decisions (decide for yourself)
CaseDesign decisionThink about
1Decide whether an incoming email is a complaint or a questionWho or what interprets meaning?
2Always run the budget check before the approval note is draftedIs this the designed sequence or runtime control?
3Save the current step after each request so a restart does not begin from the startWhat must survive an interruption?
4Reject a purchase request for a cost centre that does not existWhich system owns this rule?
5A manager approves any request above the agreed amountWho holds the decision?
6Stop the run after three failed attempts on the same stepWho limits the run itself?
7Choose a friendly or a formal tone for the replyIs this reasoning or control?
8Record every tool call and its result so the run can be reviewed afterwardWhat makes the run understandable later?
  • Agent reasoning: the model interprets, decides or generates
  • Workflow logic: the designed order and content of the steps
  • Harness control: runtime rules about state, limits, checks, recovery and recording
  • Tool responsibility: something an outside system does or enforces
  • Human control: a person decides, approves or overrides
  1. Apply: choose one real system for the whole course
    Pick an agent system or agentic workflow that could run for a long time, hold state, call tools that can fail, or need review. Every later module practices on it, and it ends up in your Agent Harness & Reliability Canvas.
  2. Describe it with simulated data
    Write only what the system is for and how it works, with no real names, client personal data or company secrets. If it involves sensitive content, describe a simulated version.
  3. Write the goal and the first harness question
    One sentence for the goal, then answer: what would we most need to know, control or recover if a run of this system were interrupted halfway?
Check yourself

You need to pick one system for the whole course. Which is the best fit?

You need to pick one system for the whole course. Which is the best fit?

Key takeaway: Human-AI-Human: a person defines the task and the controls, the agent works within them, and a person reviews the result and stays responsible for it.

What next?