███╗   ███╗ ██╗   ██╗  ██████╗ ███████╗ ██╗
████╗ ████║ ╚██╗ ██╔╝ ██╔════╝ ██╔════╝ ██║
██╔████╔██║  ╚████╔╝  ██║      █████╗   ██║
██║╚██╔╝██║   ╚██╔╝   ██║      ██╔══╝   ██║
██║ ╚═╝ ██║    ██║    ╚██████╗ ███████╗ ███████╗
╚═╝     ╚═╝    ╚═╝     ╚═════╝ ╚══════╝ ╚══════╝
DemoAcademyPricing
Sign inBook a meeting

Building the harness · August 23, 2026 · 8 min

Output schemas are completion contracts

Most agent frameworks treat a schema as validation applied after the fact. Treat it instead as the definition of done — the run ends the moment a valid result is written — and three unrelated problems disappear at once: unbounded loops, unresumable runs, and work nobody can grade.

By Islam Hachimi, Founder

Ask a bookkeeper when they have finished the month and you get a clear answer: when the books balance and every question they could not answer is written down and sent to you.

Nobody says "when I ran out of things to do."

But that is what most AI systems do. The work ends when the AI stops taking actions, or when it hits a limit on how many steps it is allowed. Both of those describe the AI. Neither describes the job.

Work with no definition of done versus work with one
Running out of steps is not the same thing as being finished.

Checklist, not report card

Most systems check the work afterwards, like marking homework. We do the opposite. We write down what "done" means first, and the job ends the moment that list is satisfied.

Sounds like a small change. It fixes three separate problems.

1. You know whether it actually finished

When AI stops on its own, you cannot tell why. Maybe it did the job. Maybe it got confused. Maybe it wrote a nice summary of what it was about to do and called that done. All three look the same from outside.

With a definition of done, there is no guessing. Either the required pieces are there or they are not.

2. "I can't do this yet" becomes a real answer

This is the important one, and it is backwards from what you would expect.

If "done" only describes success, then a system that cannot do the job has two choices: fail, or make something up. AI leans hard toward making something up, because producing believable-looking answers is exactly what it is built to do.

Let "we can't do this yet, and here is what we need" be a valid answer, and the AI stops having to fake it.

One detail we had to learn the hard way. When something was not measured, the number has to be missing, not zero. Zero means we looked and found none. Missing means we did not look. A customer cannot tell those apart unless you are careful — and that difference is the whole trustworthiness of the number.

3. You can check the work before anyone sees it

A wall of text can only be judged by reading it. Work with a known shape can be checked automatically, before it goes anywhere near a customer.

Here is the one we care about most. When our system works out why an invoice has not been paid, one of the possible answers is "the client is unhappy about something."

When that is the answer, we send the client nothing. It goes straight to the business owner.

The reason is not technical at all. If someone has a complaint they have not told you about yet, sending them a payment reminder turns a fixable disagreement into a real fight. No automated message should ever be the thing that does that.

You cannot enforce a rule like that on a paragraph of text. You can enforce it on an answer.

If you want it, require it

The most useful thing we learned: if you want the AI to do something, make it part of what "done" means. Do not just ask nicely in the instructions.

We wanted our reports to end with "here is what to do next" instead of just numbers. Asking for it worked sometimes. Requiring it worked every time.

Same with the plain-English summary the customer actually reads. It is not a nice extra at the end. It is one of the things that has to exist before the job counts as finished.

What it does not fix

A definition of done tells you the work is complete. It does not tell you it is correct. You can get a perfectly complete, perfectly formatted, completely wrong answer.

What it does buy you is that everything after this point — the owner's review, the customer's portal, the invoice — is dealing with something real instead of hoping. That is not the same as being right. But nothing else works until you have it.

Everything described here is in the kernel that runs Mycel — the scheduler, the wedges, the guards, and the tests that hold them.

Read the kernel →More writing →

Read next

  • Services are data, not codeA bookkeeping service in our system is a JSON manifest, a folder of markdown, and an output schema. No module, no deploy, no engineer. The consequence that matters is not speed — it is that domain expertise stops being something only a programmer can add.
  • One config for every task is the original sin"Build a website for this business" and "decide the next step on this overdue invoice" are not the same job, and giving them the same tools, permissions and credentials is how an agent system becomes unsafe. Three shapes, and a build run that can never hold a send token.
  • Fulfilment is not one shotReal service work is not a single prompt. A weekly visibility report is twelve independent measurements and one aggregation; a month-end close is strictly sequential and stops dead without a bank statement. Both need a run that can suspend itself as a row and resume days later.

Take the client you turned down last month.

Describe what you deliver and the first draft exists before you have finished your coffee.

Start 7 days free

The first AI delivery firm. You sign.

All systems operational

Ask an AI about us

  • Claude
  • ChatGPT
  • Perplexity

It reads the site and answers on its own. We do not get to edit what it says.

Product

  • What you get
  • Pricing
  • Changelog
  • What it runs
  • Free reports
  • Product map
  • Team
  • Blog
  • Glossary
  • AI Visibility Index
  • Sign in
  • Docs

Compare

  • vs ChatGPT, Claude, or whichever tab is already open
  • vs Grok Bot and the AI-employee platforms
  • vs Hiring an account manager
  • vs Profound
  • vs Otterly
  • vs Building it yourself
  • vs Zapier & n8n
  • vs Temporal
  • vs LangGraph
  • vs CrewAI & AutoGen
  • All comparisons

Legal

  • Privacy
  • Sub-processors
  • Terms
  • DPA
  • Security
███╗   ███╗ ██╗   ██╗  ██████╗ ███████╗ ██╗
████╗ ████║ ╚██╗ ██╔╝ ██╔════╝ ██╔════╝ ██║
██╔████╔██║  ╚████╔╝  ██║      █████╗   ██║
██║╚██╔╝██║   ╚██╔╝   ██║      ██╔══╝   ██║
██║ ╚═╝ ██║    ██║    ╚██████╗ ███████╗ ███████╗
╚═╝     ╚═╝    ╚═╝     ╚═════╝ ╚══════╝ ╚══════╝