Product
Platform Agentic Code Scanner Unified Runner Tomosu Agents Indexes Solutions
Get Started
Scan your repo VS Code plugin Tomosu MCP GitHub App CodeRabbit FAQ
Resources
Case Studies Governance Impact TCO Calculator Download / Free Trial
Pricing
Plans and pricing
Company
About Blog News Contact Request Demo → Try Free Log in GitHub
Agentic Engineering · Software Factories

What Is a Software Factory? A Closed Loop for Coding Agents

··12 min read·

A software factory is a code-defined, closed-loop system for running coding agents, measuring how they perform, and improving them over time. The agents, their skills, their models and their rules live in version-controlled files. Every run gets measured. The measurements drive changes to those files, and the changes get reviewed like any other pull request.

Quick answer

A software factory is a closed loop around coding agents: define them in code, run them, measure every run, and improve the definition through reviewed pull requests. What decides whether it gets better is the measurement. If the score comes from the agents themselves, the loop learns to please the score. If it comes from outside the agent and from production, the loop learns to ship reliable code.

The term used to mean a standardized DevSecOps pipeline, the way the US Department of Defense and VMware use it. In 2026 it usually means a closed loop around coding agents, and that’s the meaning this post covers.

The AI software factory label is getting stretched. Agent swarms, shared skill libraries and collections of automations all get called software factories, and they can be useful. But without the loop they’re just more agents. A factory is the part of agentic engineering that tells you whether the agents are getting better, and changes them when they aren’t.

This post covers how the loop works, why it should be defined in code, and the part most factory designs get wrong: what they measure. If the measurement comes from the agents themselves, the loop learns to please the measurement. If it comes from production, the loop learns to ship reliable code.

How does an AI software factory work?

Every version of the idea comes down to the same four steps, repeated:

  1. Define. The factory lives in code: which agents exist, what each one is allowed to do, which model it uses, which skills it loads, and which checks a change must pass. Warp’s version is a factory.yaml manifest plus directories of agent definitions, skills and model routing rules (Warp, 2026).
  2. Run. Agents pick up work such as triage, implementation, review or migration, and produce pull requests. Every run leaves a trace: the prompt, the tools called, the diff, the cost.
  3. Measure. Each run gets scored. This is the step that decides whether the factory improves or just gets busier.
  4. Improve. Someone, often another agent, looks for patterns in the scores and proposes a change to the factory definition: a tighter skill, a different model for one task, a new check. A person reviews that change as a PR and merges it.

Then it runs again, and the next round of measurements shows whether the change helped.

For where reliability checks belong at each stage of an agent-driven lifecycle, see What Is the Agentic SDLC?

The structure is borrowed from manufacturing on purpose. A factory isn’t defined by its machines. It’s defined by the process that makes the ten thousandth unit as good as the first, and by the inspection that catches it when it isn’t.

Why should a software factory be defined in code?

Because you can’t improve what you can’t diff. As Dex Horthy has argued, declarative beats imperative: describe what the system should be, in files, instead of steering agents by hand session by session.

A hand-run agent setup lives in people’s heads and chat histories. Someone tweaks a prompt, switches a model for one task, adds a rule after an incident, and none of it is recorded in a way you can compare. When quality drops, nobody can say which change did it.

Define it in code and every change to the factory becomes a commit. Here’s an illustrative definition. The format is made up for this post, not any specific product’s schema:

YAML · factory.yaml (illustrative)
# factory.yaml (illustrative)
version: 14

agents:
  implementer:
    model: provider/model-large
    skills: [repo-conventions, db-migrations]
    can: [read_repo, open_pr]
    max_steps: 40

  reviewer:
    model: provider/model-medium
    skills: [review-checklist]
    can: [read_repo, comment]

gates:
  - tests_pass
  - lint_clean
  - reliability_score:     # scored outside the agent
      min: 75              # threshold the team chose
      mode: advisory       # promote to blocking once trusted

scoring:
  per_run: [cost, steps, human_touchpoints]
  per_change: [reliability_score, reverted_within_14d, rework_within_14d]

Three things this buys you:

Note what sits in per_change. Cost and step counts describe the run. Reverts, rework and a reliability score describe what the run produced. The rest of this post is about why the second set matters more.

What is a dark factory in software?

A dark factory is a software factory that runs with no person reading the code it ships. The name comes from manufacturing, where a fully automated plant can run with the lights off. Addy Osmani contrasts it with a “lit” factory, the same pipeline with people kept on wherever judgment matters, and warns that dark factories build up comprehension debt: more code than anyone understands (Osmani, 2026).

The best-documented attempt so far is Dex Horthy’s. From July to November 2025 he ran a fully automated pipeline in which agents handled feature requests, review and deployment, and no person read the code. Within about three months the codebase had degraded badly enough that a single bug took weeks of human debugging to trace, and he shut it down (BigGo Finance, summarizing The Pragmatic Engineer). What he runs now keeps a person on planning and review, plus small nightly loops that each fix one anti-pattern and open a reviewable PR.

What failed was the measurement. The factory had no trustworthy signal from outside the agents, so nothing in it could notice the decline until a person went looking.

A self-improving loop optimizes whatever you measure. Whether the code holds up in production is a separate question, and the loop never sees it unless you put it there.

Why is measurement the hard part of a software factory?

Because the easy metrics measure the factory, not the software it ships.

Look at what most factory dashboards track. Warp’s article lists PR throughput, average cost per PR, automation percentage (human touchpoints per PR) and estimated savings over human work, with scorer agents grading each run on dimensions like correctness and verbosity, often using an LLM as the judge. Those are real and useful numbers. Warp also adds benchmark runs across configurations, and keeps a person reviewing every change to the factory itself. But every one of those metrics can look great while the codebase gets worse.

Horthy’s dark factory shows how that plays out. Its throughput numbers would have looked fine the whole time the codebase was degrading.

There are two reasons the loop drifts like this.

Put those together and you get the core problem. A self-improving loop optimizes whatever you measure. Measure throughput and cost, and you get a factory that ships more code more cheaply. Whether that code holds up in production is a separate question, and the loop never sees it unless you put it there.

What should a software factory measure?

Signals that come from outside the agent, and that describe the code after it ships. Osmani’s test is a good filter: cheap, frequent, hard to fake. Here’s how the common options hold up.

Which software factory metrics can’t the agent fake?

SignalComes fromSpeedHard to fake?What it tells the loop
Tests passOften the same agentMinutesNoThe change agrees with its own tests
LLM judge scoreAnother model reading the runMinutesPartlyThe diff and transcript look right
Cost, steps, PRs per dayThe factoryInstantYesHow efficient the run was, not how good
Reliability score per PRAn independent check on the whole codebaseMinutesYesWhether the change is ready for production, before merge
Revert or rework within 14 daysGit historyTwo weeksYesWhether the change survived contact with reality
Incidents traced to a changeProduction and on-callDays to monthsYesWhat the change actually cost

The signals at the bottom are the ones that matter, and they’re slow. Reverts take two weeks to count. Incidents take longer, and most changes never cause one, so they’re too sparse to steer a loop on by themselves.

That’s the role of a reliability score before merge. It’s the one signal on the list that’s fast enough to run on every PR, comes from outside the agent, and looks at production behavior rather than code style: missing timeouts, unsafe retries, leaked connections, concurrency hazards, swallowed errors. It gives the loop a number per run today, while reverts and incidents confirm later whether the number was right.

A practical setup uses all three speeds:

To measure churn in your own repo with plain git, including which files change most and who owns them, see Code Churn: Why the Files That Change Most Break Most.

How do you close the loop without breaking the codebase?

Treat changes to the factory the way you’d treat changes to production: small, reviewed, and measured against a baseline.

  1. Change one thing per version. A new model, a tighter skill or a new gate, not all three. If reliability scores drop after version 15, you want to know which change did it.
  2. Compare on the same work. Keep a fixed set of reference tasks from your own repo and run both versions against it. Warp calls these benchmarks, and they’re the most rigorous part of their design. Score the outputs with the outside signals, not only an LLM judge.
  3. Keep a person on the factory’s own PRs. An improvement agent can propose changes to the definition, but someone who owns the system should merge them. This is the cheapest place to keep a human in the loop, because one reviewed change to the factory affects every future run.
  4. Start gates advisory. A new reliability gate that stops merges on day one throws false alarms, and the team learns to route around it. Run it advisory, check which of its flags lined up with real reverts and incidents, then promote those to blocking.
  5. Point slow loops at known weak spots. Horthy’s replacement for his dark factory includes small nightly loops that each fix one anti-pattern and open a reviewable PR. A reliability score gives those loops a target list: the lowest-scoring areas of the codebase, worked down one at a time.

The pattern underneath all five is the same one Osmani describes. Automate as far as your checks are trustworthy, and keep people where a wrong call is expensive.

Where does production reliability fit in a software factory?

It’s the measurement that keeps the loop honest.

Tomosu assesses code changes, written by people or by AI coding agents, for production reliability. Each one gets a Production Reliability Index (PRI) from 0 to 100, rolled up from up to eight sub-indexes such as Fragility, Code Volatility and Governance Compliance. It reads the whole system rather than only the diff, and every finding comes as a before and after code change that a person accepts or rejects.

In a factory, that maps onto the loop directly:

Shell · add Tomosu to Claude Code
claude mcp add --transport http tomosu https://mcp.tomosu.ai/mcp --scope user

It doesn’t replace the slow signals. Reverts and incidents are still how you find out whether the fast score was right. It gives the loop something trustworthy to learn from in the meantime.

See the PRI on code your agents already wrote →

Key takeaways

Frequently asked questions

What is a software factory?

A software factory is a code-defined, closed-loop system for running coding agents, measuring how they perform, and improving them over time. The agents, skills, models and checks are defined in version-controlled files, and changes to them are reviewed like code.

What's the difference between a software factory and an agent swarm?

An agent swarm is many agents working at once. A software factory adds the loop around them: every run is measured, and the measurements drive reviewed changes to how the agents are configured. A swarm can be part of a factory, but it isn't one by itself.

What is an AI software factory?

An AI software factory is a software factory built around coding agents: agents write and review the code, and a code-defined loop measures every run and improves the agents over time. It differs from the older DevSecOps meaning of the term, which describes a standardized build and deploy pipeline for human-written code.

What is a dark factory in software?

A dark factory is a software factory that runs with no person reading the code it ships. The name comes from manufacturing plants that run with the lights off. The risk is comprehension debt: the codebase grows faster than anyone understands it, and nothing in the loop notices the decline until a person goes looking.

What metrics should a software factory track?

Track the runs (cost, steps, human touchpoints) and, more importantly, the code they produce: a reliability score per pull request, revert and rework rates within 14 days, and incidents traced to factory-made changes. Metrics the agent controls, like its own tests passing, are the easiest to game.

Why define a software factory in code?

So every change to it is a diff you can review, compare and roll back. If quality drops after a model swap, the commit history shows the swap, and you can run the old and new versions against the same tasks.

Parsa Mohammadi, Technical Marketing Lead at Tomosu AI
About the author

Parsa Mohammadi

Technical Marketing Lead at Tomosu AI

Parsa writes about production reliability, pre-merge risk, and how engineering teams govern AI-generated code. He works with the founding team at Tomosu AI on what the platform measures and how teams put it to use.

Connect on LinkedIn →

A software factory is only as good as what it measures. Tomosu gives the loop a production reliability score from outside the agent, on every pull request. To see the Production Reliability Index on code your agents already wrote, scan a repository free. The free plan needs no card. Scan a repository →

Request Demo →