Fire In Belly

Agent Harness for Internal Workflows: What You Own Around the Model, and When to Build, Configure, or Rent It

14 min read

Two brown horses in rope halters and a padded draught harness

If you have commissioned an AI agent for an internal workflow, someone has probably told you that the model is the easy part and the harness is where the work is. They are right. An agent harness is everything around the model: the loop that calls it, the tools it may use, the files and memory it can read, the checks that run before and after each action, and the record of what happened. When an invoice-exception agent or a ticket-triage agent fails in production, the cause is usually in that layer, not in the model.

Most of what ranks for "agent harness" is written for engineers building coding agents. This guide is for the person who has to decide what the harness for one operations workflow must contain, whether to configure an existing one, rent a managed one, or build, and what to own so that the harness can be changed later without starting over.

The short answer

  1. Size the harness to the workflow. A short, single-session workflow needs a loop, a few narrow tools, a permission check, and a log. Long-running state, subagents, and an evaluator agent are for work that spans hours or many steps.
  2. Configure an existing harness by default. Build only when you can write the requirement down as a test that no existing option passes, and you have a named person to run what you build.
  3. Keep the run log and the credentials outside the harness, so either can survive the harness being replaced.
  4. Write down what model weakness each harness component exists to cover, and retest the list when you change models.
  5. Spend the project budget on written business context the agent can find, not on longer prompts.
  6. Make the handover include the configuration, the evaluation set, and that list of assumptions, not just a working agent.

What an agent harness is, in plain terms

LangChain's definition is the one most people now repeat: an agent is a model plus a harness, and if a piece of the system is not the model, it is the harness. That includes the system prompt, the tool and skill definitions, the filesystem or sandbox the agent works in, the orchestration logic, and the hooks that run deterministic checks. Google Cloud and Wikipedia describe the same layer, and Wikipedia gives another name for it: agent scaffolding.

A recent survey of agent system and harness design splits the harness into six parts, which is a useful checklist for a buyer:

  • what the agent can observe (tool results, files, screens, logs);
  • what goes into the model's context and when;
  • the control loop, including when to stop and when to hand off;
  • the actions it can take (API calls, file edits, browser steps);
  • where state, logs, and outputs are stored;
  • the verification and governance layer (tests, permission gates, budgets, rollback).

You can buy most of this. The Claude Agent SDK, the OpenAI Agents SDK, and LangChain's Deep Agents are all harnesses you configure rather than write; OpenAI's migration guide between the two SDKs is a useful side-by-side of how each one is laid out. What you cannot buy is the part that is specific to your workflow: which tools exist, what the agent is allowed to do with them, what "done" means, and the business rules it has to follow.

The parts one internal workflow actually needs

The engineering posts that made the term popular describe harnesses for agents that write software for hours. Anthropic's long-running harness uses an initializer agent, a progress file, and one feature at a time so that each new session can pick up where the last one stopped. Its later three-agent design adds a planner and a separate evaluator. Those are good answers to a hard problem. Most internal workflows do not have that problem.

Use the workflow's run length and the cost of a wrong action to decide what to include:

Harness partInclude it whenYou can usually skip it when
Narrow tools with typed inputsAlwaysNever
Permission check before each writeThe agent can change a record, send, or payThe agent only reads and drafts
Run log with inputs, tool calls, and resultsAlwaysNever
Budget limits on steps, time, and spendThe loop can retry or call paid APIsThe workflow is one or two calls
Durable state and a progress fileA run spans sessions or hoursA run finishes in one session
Separate evaluator or checkerThe task sits beyond what the model does reliably aloneA deterministic check (a total, a match, a schema) already proves the result
SubagentsIndependent subtasks would crowd one contextThe steps are sequential and short
Sandbox for code executionThe agent writes and runs code or scriptsThe agent only calls fixed tools

Anthropic's own conclusion about the evaluator supports this kind of sizing: the evaluator is worth the cost when the task sits beyond what the current model does reliably solo, and it is not a fixed yes-or-no decision. For an accounts payable exception agent, a script that checks the invoice total against the purchase order is a better evaluator than a second model.

The budget row deserves attention even in small workflows. The AWS sample methodology page on harness engineering describes a fintech case, the canonical case of its methodology, in which an agent retried an API call in a loop, ran up cost, and sent half-finished emails to customers, because there was no retry budget, timeout, or output gate. None of those controls needs a large harness. They need someone to decide the limits.

Configure, rent, or build

There are three realistic routes for the harness itself.

Configure an existing harness. Take an SDK or open-source harness and add your tools, permissions, prompts, and checks. The build-versus-buy chapter of one Claude engineering book ranks this above building from scratch: a configurable harness gives you most of the control of a build without owning the plumbing, adopted once a concrete need earns it. Stripe's internal agent, Kai, is a public example: Stripe built a Stripe-specific harness layer on top of Deep Agents, with a configuration layer where teams set up their own agents without touching the harness underneath. Stripe's engineering blog says the harness, sandbox, and access control are shared with its product-facing agents so internal work meets the same security bar.

Rent a managed harness. Hosted agent services run the loop, sessions, and sandboxes for you. This suits teams with no engineer to operate a runtime, as long as you can export the run history and the configuration. Citadel's build-versus-buy piece is from a managed-operations vendor, but its point about putting exportability in the contract applies whichever provider you pick.

Build. PADISO's guide gives a sensible test: build only when a specific requirement cannot be met by configuring or extending an existing option, and when a funded team will run what you build. "We want flexibility" does not qualify. "Every payment action must be checked against a run-specific approval record before it is sent" might, but only after you have confirmed that an existing harness cannot enforce it through a hook.

Practitioner opinion leans the same way. One small-business automation builder on X put it as rent one, customize a harness, assemble a no-code workflow, or build, starting at the highest level that solves the job. An investor on X said he had never been less bullish on agent harnesses as a product category because almost every pitch was broad. Both are opinions, but they point to the same buying rule: the value is in the narrow, workflow-specific layer, not in a new general harness.

Keep the run log and credentials outside the harness

Anthropic's Managed Agents post has a lesson that applies to any harness, whichever model it calls. Anthropic first ran the session, the harness, and the sandbox in one container. When a container failed, the session was lost, and when customers wanted the agent to reach systems in their own network, the design got in the way. They split the three apart. The session became an append-only log stored outside the harness, so a crashed harness can be restarted and resume from the last event. Credentials were kept out of the sandbox where generated code runs, so a prompt injection cannot simply read the agent's own environment and take the tokens.

The general rule for a buyer: keep the run log and the credentials outside the harness, so the harness can crash or be replaced without losing the run or exposing tokens to whatever the agent reads. OpenAI's migration guide from the Claude Agent SDK describes the same split in its own terms: a trusted application runtime owns the loop, approvals, secrets, guardrails, and tracing, and the sandbox is only for workspace and code execution.

The split does two jobs for you. It is the security boundary that limits what a compromised run can do. And it is what makes the harness replaceable. If the run history lives in your database and the tokens live in your vault, moving from one SDK to another is a migration of configuration. If both live inside a vendor's container, it is a rebuild.

Ask two questions of whoever builds your agent: where does the run log live, and can the process that reads untrusted content also read the tokens? The answers should be "in a store we control" and "no." Our guide on AI agent audit logs covers what that log should record.

Every component is an assumption about the model

Anthropic's harness design post states a principle that most build-versus-buy guides leave out: every component in a harness encodes an assumption about what the model can't do on its own, and those assumptions go stale as models improve. Their example is concrete. An earlier harness added context resets because one model tended to wrap up early as its context filled. On the next model the behaviour was gone, and the resets had become dead weight. When they tried to simplify the harness all at once, they could not tell which parts were load-bearing, so they removed one component at a time and measured the effect.

For a buyer, this turns into a maintenance practice. Treat every harness component as an assumption about what the model cannot do on its own, write that assumption down next to the component, and retest by removing one component at a time whenever you change models.

A short register is enough:

ComponentAssumption it encodesRemoval test
Second-model checker on extracted fieldsThe model misreads line items on scanned invoicesRun last month's 50 hard invoices without it and compare field accuracy
Step-by-step instructions for vendor matchingThe model will not find the right vendor record unaidedReplace with the tool and the matching rule only, then rerun the evaluation set
Hard stop after 12 tool callsThe model loops when a lookup returns nothingRemove the cap in a test run and count runs that exceed 12 calls

This needs two things. The first is a fixed evaluation set from your own workflow, so a removal test has something to measure against; our guide on hermetic trace replay gates covers how to replay real runs safely. The second is that the register has to be part of what you own, because the people who built the harness will not always be around when the model changes. Done this way, a model change lets you drop parts that cost time and tokens, and it also shows you when the new model needs a part you did not have before.

Business context is the input you will run short of

OpenAI's harness engineering post is about a team that shipped a product with no hand-written code, but its lesson on context applies to operations. The team tried one large instruction file and it failed, so they kept a short file of about 100 lines as a map and moved the real knowledge into structured documents the agent could find. They also wrote that a decision agreed in a Slack discussion is, if the agent cannot discover it, as unknown to the agent as it would be to a new hire three months later.

For an internal operations workflow, the scarcest harness input is written business context, such as exception rules and decisions that live in Slack, not more tooling or longer instructions. The rule that a supplier's credit notes always arrive a month late, the threshold above which finance wants a second approver, the customer who is billed in a different entity: these are what an agent gets wrong, and none of them is in the model.

A Hacker News commenter building a harness for accounting agents reported something that fits. Their team first wrote long, prescriptive skills, and found that the agent did better when given an internal command-line tool, guardrails, and access to context, and allowed to reason about the task. That is one team's experience, not a benchmark, but it matches the OpenAI lesson: give the agent a map and the facts, not a script.

In practice:

  • Budget time to write the exception rules and the decisions behind them into documents the agent can search. This is usually the slowest part of the project and the part that most improves results.
  • Keep the agent's standing instructions short and point to those documents.
  • When a reviewer corrects the agent, ask whether the correction is a missing fact. If it is, add the fact to the documents rather than adding another instruction.

Skills are one way to package that context; our guide on agent skills for internal operations covers when an SOP should become one.

What to ask for in the handover

Whether an internal team or a consultant builds the agent, the harness is what you will maintain. Ask for these items, in addition to the general points in our handover guide:

  • the harness configuration as files: system prompt, tool definitions, permission rules, hooks, and budget limits;
  • the name and version of the harness or SDK, and how to upgrade it;
  • the evaluation set and the command that runs it;
  • the assumption register, with the last result of each removal test;
  • where the run log is stored and how long it is kept;
  • where credentials are held and which process can use them;
  • the business context documents and who owns each one.

If a vendor cannot hand over the configuration and the evaluation set, you are renting a black box, and you should price the contract that way.

A worked example

The following is an illustrative example, not a client case. A 300-person distributor wants an agent that works the queue of invoices that failed automatic three-way matching.

The harness they need is small. The agent reads one exception at a time, looks up the purchase order and goods receipt through two read-only tools, checks the vendor's history, and drafts a resolution note with a proposed action. It does not post anything to the ledger; a person approves each action. There is a cap on tool calls and a run log in the finance team's own database. A deterministic check confirms that any proposed adjustment reconciles to the purchase order total. There are no subagents, no sandbox, and no evaluator model.

They configure an existing SDK rather than build, because nothing in the requirement fails that test. The assumption register has three lines, and the evaluation set is 80 past exceptions with known resolutions. Most of the project time goes into writing down the twelve exception rules the accounts payable team had never documented. When they move to a newer model six months later, they rerun the removal tests and drop the step-by-step vendor-matching instructions, which no longer change the result.

Where this fits with platform, skills, and guardrails

A harness is the runtime for one agent or one family of agents. If several teams are shipping agents, some harness parts (model access, logging, evaluation tooling) belong in a shared platform; our guide on AI platform engineering for internal workflows covers what to centralise and when.

If you want help sizing a harness for a specific workflow, or reviewing one that a vendor has proposed, our AI audit looks at the workflow, the risks, and the build route, and our AI workflow automation service builds and hands over the agent with the configuration, evaluation set, and assumption register described here.


About Fire In Belly: Independent senior engineering from Tallinn, Estonia. We design and build custom AI agents, AI workflow automation, and internal tools with the agent harnesses, run logs kept outside the model, and build-or-configure decisions described above, at published fixed prices. Schedule a call to discuss your next project.