Harness engineering: laptop showing an AI agent workflow, with icons for instructions, memory, review, a limit on retries and human approval

Harness Engineering: What We Learned Running a Company With AI Agents

Harness engineering is the work of building everything around an AI model: the instructions it reads, the memory it keeps, the checks it must pass, the limits on how many times it can try again, and the person who approves what it does. We build a program that runs a small company with AI agents, and we use it every day to build our own products and run our own marketing. This article explains how our harness engineering works in practice, part by part, and what went wrong on the way.

What Claudius Corp is

Claudius Corp is a Windows desktop program made by DMSI. It lets one person run a small virtual company in which AI agents do the work. You set up departments and the roles you need, such as a developer, a tester, a content writer, an SEO specialist and an advisor who plans with you. Each role is a Claude Code agent with its own job description.

Work is organised as projects. Each project follows a workflow that you draw on screen. When one step is finished, the program starts the agent for the next step, gives it what it needs to know, and records what it did. A free 14-day trial is available on the Claudius Corp trial page.

We did not set out to build a “harness”. We set out to make AI agents do real work for a real company. Only later did we notice that most of what we had built has a name: harness engineering.

How Claudius Corp works as an agent harness

An agent harness is the system around an AI agent, and harness engineering is the work of designing it. In Claudius Corp the harness has eleven parts.

1. A company structure with roles

Departments hold roles. Each role has a job description, a choice of Claude model, and its own set of skills and tools. Skills and tools are kept in one catalogue and given to a role for the whole company, for one product, or for one project only. So the SEO specialist sees the SEO tools, and the developer does not.

2. A workflow engine

Every project runs on a workflow: a map of steps and the connections between them, drawn on screen. The engine knows several kinds of step:

  • work steps, where one agent does one job;
  • decision points, where the work stops until someone chooses the route: approve it, or send it back to an earlier step;
  • loops, for work that repeats, such as a marketing campaign that is planned again every day;
  • steps that run at the same time, such as an advisor who stays available while the other steps run;
  • end steps, for a project that is finished or cancelled.

A step starts only when the steps before it are finished. When an agent reports that its step is done, the engine moves the project forward and starts the next agent. A person can make the decisions at the decision points, or hand them to the advisor agent.

3. Task lists inside a step

A large build step is split into a list of tasks. A fresh agent takes one task, finishes it and records it, and the next agent takes the next one. The step cannot finish while any task on the list is still open. We learned to put every piece of required work on that list: a requirement that was only written in the step’s instructions was skipped three rounds in a row, and built in one round once it became a task.

4. A brief written for every start

An agent does not start from an empty chat. Before it starts, the program assembles its brief in layers: the role’s job description, approved lessons from earlier work, notes about the product, the state of the project, the instructions for this step, its skills and tools, and the rules for saving its work. The instructions for each step follow one pattern: the goal, what to read, the tasks, and what counts as finished. The brief has a size limit, and the program says so when a brief goes over it.

5. Memory that lives outside the chat

A chat forgets, so memory is a core part of harness engineering. The company keeps its memory in files and in a database:

  • notes about each product, which every agent working on that product receives;
  • lessons for each role, which an agent proposes at the end of its work and a person approves before any later agent sees them;
  • decision records that keep the reason for each decision, not only the decision;
  • a register of every document each step produced;
  • a change log, where each code change is recorded with its reason and linked to its commit.

6. A separate copy of the files for each agent

Each agent starts in its own folder: its own copy of the project files, plus a private folder for temporary work, and its brief tells it exactly where to save. The program can also give each role a list of folders it may read or write. One agent’s half-finished work cannot break another agent’s work. The changes are merged back when the agent finishes.

7. Checks by a different agent

The agent that builds something is not the one that judges it. A testing or review step reads the result and can send it back with a list of problems. Work can be sent back three times by default; the program refuses a fourth time and asks a person to decide.

8. Asking a person, at three levels

When an agent is stuck or unsure, it asks instead of guessing. It chooses a level: a question it can keep working around, a blocker that pauses its step, or an emergency that stops it at once. The answer is delivered back into its brief.

9. Watching the agents

The program watches every running agent. If an agent produces no output for a long time, or runs past its time limit, the program reports it to a person. It does not kill the agent or mark it as failed on its own, because an agent waiting for an answer looks the same as an agent that has crashed. The person decides.

10. Knowing which version is running

An agent reads the program’s source code, but the program that is actually running may be an older build. The program tells each agent which build is running and whether the code it is reading is newer. Without that, an agent can “prove” a fix by reading code that is not running yet.

11. Folders and file names with a structure

A company run by AI agents produces a large volume of files every day: specifications, reports, reviews, decisions, drafts, test evidence. Without order, that turns into chaos within weeks, so keeping it in order is part of harness engineering too. Nothing is saved just anywhere:

  • every product has its own folder, every project has its own folder inside it, and every role has its own folder inside the project;
  • the program tells each agent the exact folder where its output goes;
  • lasting records, such as specifications, decisions, reports and reviews, are saved through the program, which chooses the folder, keeps a backup and registers the record;
  • every file starts with the same short header: the project, the file, its version and what it is for;
  • file names carry the date and the version, so the newest one is obvious and older ones are never overwritten.

Months later, anyone, person or agent, can still find what was decided, when, and why.

Around these eleven parts there are planning tools: a calendar of dated actions, each with the role that prepares it, and a backlog where problems found outside a project’s scope are filed, so that they are recorded and not lost.

What our agent harness does not do

Our agents run without Claude Code’s usual request for permission before each command. The version we use today does not block any command. The next version adds a narrow check that blocks a few kinds of command, such as opening hidden windows or setting a program to start with Windows, and nothing else. It is not a general safety net. Folders work the same way: each agent starts in its own folder and is told where it may work, but because the permission requests are off, Claude Code does not stop it from reaching outside. Today those folder limits are instructions, not a lock. Our protection is the separate copy of the files, the limit on retries, and the rule that a person approves everything before it goes into production: a live website, a released program, a published post.

Harness engineering failures: what went wrong, and the rule we added

Most parts of our harness engineering are there because something went wrong without them.

A written rule was ignored three times

The agent that plans our marketing with us had a written rule: read the latest project notes before reporting where things stand. Three times in a row it did not. Each time it reported from an older summary, and each time the report was wrong in the same way. The old summary was well written and sounded certain, while the live data was only numbers. The rule existed, but it was not where the work starts. We moved it into the first instruction the agent reads, and added a second one: a round of work is not finished until the notes are updated. It is the first lesson of harness engineering: a rule works only where the agent meets it.

A limit that nothing enforced

A limit of three review rounds was written in the settings, but the program did not enforce it. Two projects went through 12 and 10 rounds of review. The later rounds found almost nothing new to fix; the reviewer was mostly reviewing the notes written in earlier rounds. Since August 2026 the program refuses the fourth round and asks a person. A limit that is only written down is not a limit.

A check that could not fail

A test script in Windows PowerShell 5.1 had a loop written for a list. When it received a single item, PowerShell did not treat it as a list, so the loop was skipped without any error. The script reported a pass for a file that had changed. A check that cannot fail looks exactly like a check that passed. We added this trap to the notes that every agent working on that product receives.

The same mistake, recorded thirteen times

Our agents kept asking the database for a column that did not exist. Between June and September 2026 they wrote down thirteen separate lessons about it, and one agent made the mistake three times in a single hour. Lessons stored where nobody reads them before working do not help. We now give every agent on that product one short rule: read the written description of the database before writing any query.

A change went live before anyone approved it

An agent whose task was only to test access to our website also applied SEO changes to three live posts. Nobody had approved them. Since then the rule is that nothing goes into production, whether website, software or published content, until a person has reviewed it. That rule is still written, not enforced by the program, and the first failure above shows what a written rule is worth.

Harness engineering lessons for a team starting with AI agents

  • Put each rule where the work begins, not in a document the agent may or may not open.
  • If work must be done, put it on the task list. An instruction is not a task.
  • Give every loop a limit that the program enforces, and decide in advance who takes over at the limit.
  • Let a different agent, or a person, judge the work.
  • Keep memory outside the chat, and keep the reason for each decision, not only the decision.
  • Keep a person in front of anything that is hard to undo, such as a software release or a change to a live website.
  • Test every check with an input that should make it fail.
  • Write down what your harness does not protect against.

You do not need all eleven parts to start with harness engineering. One agent with a clear brief, a limit on retries and a person approving the final step already covers most of this list.

Common questions

What is harness engineering?

Harness engineering is designing everything around an AI model so it can do reliable work: the instructions it reads, the checks it must pass, the limits on its retries, and the points where a person approves. It is about the system, not the model.

What is the difference between harness engineering and context engineering?

Context engineering is about what the model sees in a single request. Harness engineering is wider: it includes that context, and also the memory, checks, limits and human approvals around the model across many requests.

Do I need several agents to use harness engineering?

No. A single agent with a written brief, a limit on retries and a person approving the final step is already a harness. Claudius Corp uses one agent per role because that is how we chose to run a company, not because harness engineering requires it.

Can a team of AI agents work without supervision?

Not in our experience. Our agents do not ask permission for each command, so supervision comes from elsewhere: a separate copy of the files for each agent, a limit on review rounds, a program that reports agents that stop or run too long, and a person who approves everything before it goes into production.

What happens when an agent keeps failing a review?

In Claudius Corp, work can be sent back three times by default. The program refuses a fourth round and asks a person to decide.

Leave a Reply