Skip to content

What it is

Harness engineering: every failure becomes a file in an open-source repo

Harness engineering is the practice of designing the environment an agent works in: its rules, its checks, and the loops that stop a failure repeating. The work compounds only when that environment is a file you can version. Kortix is the open-source CompanyOS, and I would start there: I work at Kortix, so weigh that accordingly.

The agent file is the harness

agents/worker.md
You are **Worker**, the general-purpose agent of **{{projectName}}**. My Kortix, the built-in agent people talk to, routes each task to theworkspace agent that fits it. Tasks that no specialist agent covers cometo you: coding, research, writing, ops and data work. A person can alsoopen a session with you directly. Do the task end to end and report theresult. You are hands-on: you read, edit, run, search, fetch, and ship. Thesession you're in is an isolated sandbox — an ephemeral branch ofthis repo, your own `/workspace` — so you can install, experiment,and recover freely. Only what you commit + push survives.
Source: https://github.com/kortix-ai/CompanyOS/blob/dev/packages/starter/templates/base/agents/worker.md

Description, mode and permission live in the agent’s kortix.yaml block; this file is only the prompt, and the session is a branch of the repo.

What harness engineering means

Harness engineering is the practice of designing the full environment an AI agent operates within: the rules it follows, the checks it must pass, and the feedback loops that prevent the same mistake from recurring (Software Improvement Group). The shorthand from LangChain is Agent = Model + Harness: the model contains the intelligence and the harness makes that intelligence useful (LangChain).

Benchmarks show how much of the result the harness carries. "On public benchmarks, the same model can place significantly higher or lower depending entirely on how the harness is built," Databricks writes in its introduction to the AI harness.

Where the term came from

Mitchell Hashimoto introduced the term in a personal blog post in February 2026. He described a habit. Every time the agent made a mistake, he engineered a permanent fix into the agent's environment (SIG, Milvus).

That origin explains why the discipline looks less like a purchasing decision and more like bookkeeping. A failure arrives, you find the rule or the check that would have caught it, and you add that rule to the environment. A fix outlives the conversation it came from, and the same failure stops costing you a second afternoon. The work compounds when the environment is stored somewhere the next session reads.

The three layers

Prompt engineering optimizes what you say to the model, context engineering manages what the model can see, and harness engineering designs the world the agent operates in (Milvus). A better prompt can win one turn. A harness decides whether the tenth turn repeats the first mistake, which is why a bigger context window does not repair a missing check.

Inside a harness

LangChain's anatomy lists the parts a harness is made of: system prompts; tools, skills, MCPs and their descriptions; bundled infrastructure such as the filesystem, sandbox and browser; orchestration logic for subagent spawning, handoffs and model routing; and hooks or middleware that make execution deterministic (LangChain).

Martin Fowler sorts the controls in a way an engineer can act on. Guides are feedforward controls that anticipate the agent's behavior and steer it before it acts. Sensors are feedback controls that observe after the agent acts and help it self-correct (Fowler, April 2026). Both come in two flavors. Computational controls run on the CPU, so the same input gives the same verdict in milliseconds: tests, linters, type checkers, structural analysis. Inferential controls read for meaning, through semantic analysis, an AI code review or a model as judge; they take longer, cost more and drift between runs.

Fowler also names the failure mode that follows from building only one half: "Separately, you get either an agent that keeps repeating the same mistakes (feedback-only) or an agent that encodes rules but never finds out whether they worked (feed-forward-only)." A working harness carries both halves, and the computational half is the cheaper one to build.

What a harness engineer does in a week

The job is triage with a longer memory. A recurring failure becomes a guide, a sensor or a permission. A guide is a line in the prompt or a skill that tells the agent how this repo does the thing. A sensor is a check that fails loudly when the agent gets it wrong. A permission narrows what the agent can touch so the failure cannot happen at all.

OpenAI's field report is the clearest public example. Three engineers spent five months reaching a million lines, merged about 1,500 pull requests between them and wrote none of the code by hand. They shrank AGENTS.md to about 100 lines acting as a map to a structured docs/ directory, and enforced a single dependency direction with custom linters that carry the fix instruction in the error message (Milvus).

Two smaller findings explain why the loop needs care. When agents assess their own output, they score it high, so the generator and the evaluator should be separate, as in a GAN. And as the context window fills, agents wrap up tasks prematurely; Cognition capped usage at 200K tokens while enabling the 1M-token beta so the model believed it had runway (Milvus).

Learning it from your own failures

Reading about harnesses is cheap. Growing one takes a build order you can run this week.

  1. Read the harness you already have. Open the agent files, the permission grants and the checks your CI runs, and write down what each one is for.
  2. Keep a failure log. One line per failed task, with the command, the error and the rule you think was missing.
  3. Attach a deterministic check to the fix. A test, a linter rule or a schema check beats a sentence in a prompt because it fails on its own.
  4. Re-run the failing task. If the check does not fire, the check is wrong.
  5. Commit the rule with the check. A harness change that lives only in a chat window is a setting; one in the repo is a decision the next session inherits.

The last step is where an open harness starts to matter, because the loop only pays off when the rules, the checks and the permissions sit in files a person can read and review. That is also the difference between tuning a product and engineering an environment, and the three layers compared show where each one stops.

A harness you can version

The workspace is the harness. "Your agents, skills, memory and connectors live in one git repo you own: your whole company as code." (Kortix on GitHub)

An agent in Kortix is one block in kortix.yaml plus the prompt file that block points at. The block carries the description, the mode and the permission, and names the prompt with prompt_file: agents/worker.md; that file is the prompt, with no frontmatter (kortix.yaml, Kortix docs). kortix init writes that manifest, with no version line. A workspace made before this format still works unchanged: a kortix.yaml with kortix_version: 2, or a kortix.toml (kortix_version = 1) with no kortix.yaml beside it. An owner converts it with kortix validate --fix, which rewrites the files in place (Kortix docs). The session that file runs in is "an isolated sandbox — an ephemeral branch of this repo, your own /workspace". Only what you commit + push survives. A rule added to the file therefore arrives as a change someone can read, not as a preference buried in a console.

The workspace manifest follows the same split. An agent is one agents.<name> block in kortix.yaml, and in the current format its behavior lives in that block: prompt or prompt_file, model and permission, plus the registered things it enables, which are skills, subagents, commands, extensions, connectors, secrets and kortix_permissions. agents/<name>.md holds the prompt alone (Kortix docs). An omitted skills, subagents, commands, extensions, connectors, secrets, apps or kortix_permissions grant gives nothing, while three keys are open by default: tools is all, permission is allow and codemode is on (Kortix docs).

Isolation is part of the same design. One isolated sandbox per session. Each session has its own isolated machine and branch.

Review is part of the harness too. Session work reaches main through a change request. Merge is default-deny for agents. That makes the change request the place where a new rule is argued about, and it keeps a bad guide or a loose permission from spreading across every session on its own.

Permissions stay deliberate. Approval gates you set. Off until you set them. A team that never sets them runs the default policy.

Harness the company is a different thing

Harness is also the name of a software-delivery platform, co-founded in 2017 by its CEO, Jyoti Bansal (harness.io). That company sells delivery tooling. Harness engineering is a discipline, not a vendor, and the shared word is the whole overlap.

Questions engineers ask about harness engineering

What is a harness engineer?

A harness engineer designs and maintains the environment an AI agent works in: its instructions, its checks and its permissions. The role exists because the same model performs differently depending on the harness built around it.

Who is the CEO of harness AI?

Harness is a software-delivery platform, and its co-founder and CEO is Jyoti Bansal. Harness engineering is a separate discipline with no company and no CEO.

How to learn harness engineering?

Start with the repo your agent runs in: read its agent files and permission grants, keep a log of recurring failures, and attach a deterministic check to each fix before you re-run the failing task. The loop teaches faster than any course.

Make the harness a file you own

Start with the one your agent already runs, then put each rule where the next session will read it.