How to Build a Software Factory That Improves Itself
Quick answer: A self-improving software factory records the outcome of every change an agent ships against the exact commit and uses that record to set the agent's autonomy. Outcomes include merges, review verdicts, reverts, failed deploys and regressions found after merge. Agents with a clean record get promoted to auto-merging low-risk changes. If one of an agent's merged changes causes a problem, the agent is moved down a level at once.
Let an agent earn its place on your team
Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.
What makes a software factory self-improving?
A software factory improves itself when the outcome of every change an agent ships decides what that agent may do next. The model behind the agent doesn't have to get smarter for this to work. What changes is how trust is shared out: agents that keep shipping clean changes get more room, and agents that cause problems lose it. The loop has three parts. The first is a record of outcomes tied to the exact commit each agent produced. The second is a set of autonomy levels that the record moves an agent between. The third is standing rules and feedback that people write and every run reads. Take away any one of them and you have a pile of bots that are as risky in month six as on day one.
Some teams find this surprising, but most of the improvement isn't in the code the agents write. A capable agent on a messy repository with flaky tests will build a messy record, and better prompts won't change that. The factory improves because the loop makes the system around the agents visible. Flaky checks show up as failed runs. Vague issues show up as blocked runs that say what the agent needs. Sensitive directories become protected paths once someone sees an agent wandering into them. Each of those fixes helps human engineers too. That's why the groundwork described in the prerequisites for a working software factory pays off twice: reliable CI, a green default branch and issues an agent can act on.
Most teams start with one of two setups. In the first, every agent pull request waits for a person, forever. That's safe, but review load grows with every agent you add, and nothing the agents do well ever changes the arrangement. In the second, someone turns on auto-merge because the demos looked good, and the first bad migration or deleted config file ends the experiment. Neither setup learns anything. A self-improving factory sits between them. It starts supervised, measures what actually happens after each merge and moves each agent's level one step at a time. Levels are set per agent and per repository. A reliable Docs Keeper can earn auto-merge while a new Dependency Updater on the same codebase still waits for review.
Which outcomes should feed the AI agent feedback loop?
The AI agent feedback loop should record every outcome that shows whether a change held up. Did it merge? What did reviewers say about the exact commit? Did CI or a deploy fail at the merged commit? Was it reverted? Did anyone report a problem with it? Merge rate on its own is a vanity number, because a change can merge cleanly and break checkout two hours later. The most important signals arrive after the merge, which is where most bot tooling stops paying attention. Each signal should be tied to a commit, not to a pull request title or a vague "last week's deploy." That's what makes the record solid enough to decide promotions and demotions.
Review verdicts need particular care. In Factorik, a review agent reads a pull request in context and ends with a verdict on the specific commit it read, not on the branch in general. If it requests changes on another agent's pull request, the author agent answers on the same branch. It either fixes each point or argues against it, then gets a second look. This repeats for a limited number of rounds before a person decides. Auto-merge waits until every reviewer has approved the current commit, so a new push after approval resets the gate. That detail matters. A verdict that isn't tied to a commit is just a comment, not a gate. That shift is covered in where AI code review is heading.
Once a change merges, the watching starts. A finding is recorded if CI or a deploy fails at the merged commit, if someone reverts the change, or if a person presses “Report a problem with this change” and describes what went wrong. Factorik tells the team through Slack, a webhook, email or a pull request comment, and moves the responsible agent down a level. Watcher agents add a second layer. If you mark a change with “Watch in production”, a Change Watcher checks it some time after the merge, using tools such as Sentry or Datadog. Its suspicions don't count against anyone until a person confirms them. That's deliberate: an unconfirmed hunch from one agent shouldn't demote another.
| Outcome | Recorded against | Effect on the agent |
|---|---|---|
| Pull request merged | The merged commit | Counts toward promotion |
| Reviewer requests changes | The exact commit reviewed | Author answers on the same branch; auto-merge waits |
| CI or deploy fails at the merged commit | The merged commit | Finding recorded; moved down a level |
| Change reverted | The merged commit | Finding recorded; moved down a level |
| Person reports a problem | The change | Finding recorded; moved down a level |
| Watcher agent suspects a problem | The change | Counts only once a person confirms it |
How do agents earn auto-merge on low-risk changes?
Agents earn auto-merge by building a record of merged changes that clears a bar: enough merged changes, a high merge rate and no problems traced back to them. Every Factorik agent starts at the first of three levels, where it opens pull requests and a person merges them. At the second level, it merges low-risk changes by itself when the repository's merge policy allows. At the third, it merges whatever the merge policy allows. Agents climb one level at a time. Either a person presses “Promote” on the agent page, or the promotion happens on its own if the organization chose “Automatic” under “How agents are promoted.” Either way, the level change is recorded with who or what made it and why.
A lot rides on the word "low-risk," so it shouldn't depend on an AI's opinion of its own work. In Factorik, it's decided from facts about the change. Those facts are how many files and lines it touches, how much it deletes and whether it goes near sensitive paths. Sensitive paths include dependencies, build and deploy configuration, secrets and permissions, database migrations and anything to do with money. A two-line typo fix in the docs is low-risk. A forty-file refactor that also edits the deploy workflow isn't, however confident the agent sounds. You can check facts after the fact, but you can't check a model's self-assessment. That difference is the whole case for an earned-trust model for agent merges.
The AI agent auto-merge policy lives on the repository, not on the agent. Under Repositories, “Merge policy” has these settings. “Merge automatically” is off by default, so every agent pull request waits for a person. “Require all checks to pass” does what it says. “Protected paths” takes patterns such as src/payments/**. “Largest change, in files” and “Largest change, in lines” set how big a pull request can be and still merge by itself. The agent's level decides what it may attempt, and the merge policy decides what the repository will accept. A change only merges on its own when both allow it. The page on autonomous coding agents that earn merge rights shows how this works when agents fix bugs and repair builds.
Let an agent earn its place on your team
Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.
Why should one regression move an agent down at once?
One regression should move an agent down at once because a bad merge costs far more than one more good merge is worth, and an average hides that. Say an agent has thirty-nine clean merges and one broken migration. On paper that's a 97.5% success rate, but the on-call engineer cleaning up the migration doesn't care. In Factorik, any problem traced to an agent's merged change drops it a level immediately. The agent goes back to closer supervision, the team is told, and the level change is logged with the reason. The agent can climb back, but only by building a new record under closer watch. That's slower than forgiving it on an average, and it should be.
The wider industry data supports being strict. Google's 2025 DORA report surveyed nearly 5,000 technology professionals. It found that AI adoption now goes with higher delivery throughput but also with higher delivery instability, meaning more change failures and more rework. The same report found that 90% of respondents use AI at work, while 30% have little or no trust in AI-generated code. It's survey data that shows a correlation, not proof of cause, but the pattern is clear. More changes without strong controls means more breakage. Instant demotion is one of those controls. It limits how long a bad streak can go on: once a problem is found, the agent's room shrinks right away.
Some teams worry that instant demotion will make agents timid, or that a flaky test will knock a good agent down unfairly. Both worries are fair, and both point at the repository rather than the rule. If flaky CI at merged commits keeps producing findings, fix the flaky tests, because they're hurting your human engineers too. If an agent keeps getting moved down for the same kind of change, treat that as information. Add a protected path, tighten the largest-change limits or write a standing rule. A demotion shows you where the factory is weak. For a longer look at what has to be in place before agents merge widely, see what has to be true before agents merge their own code.
How do you measure AI agent performance and keep the factory improving?
Measure AI agent performance by what held up, not by how much was produced. That means changes merged, merge rate, problems caused by merged changes and proposals that actually got built. Factorik's “Results” page shows these numbers, and “Spend” shows what runs cost on your own AI provider account, broken down by agent, model and repository. Look at the two together and the useful questions mostly answer themselves. Which agent ships changes that stick? Which one spends budget on runs that end up blocked? Which one has a high merge rate only because it never tries anything hard? A count of pull requests opened tells you none of this, and it quietly rewards agents for producing noise.
Continuous improvement for AI coding agents also comes from people, in small and specific doses. Every run reads the team's standing rules, recent feedback, findings on the agent's past changes and what happened to its proposals. When a run misses, rate it and answer “What should it do differently?” If the answer applies every time, press “Make this a standing rule.” When you close a pull request you don't want, use “Close pull request” and give a reason, because the agent reads it on its next runs. Only people write rules, and a run never rewrites them. That's how the factory learns your conventions without anyone retraining a model or babysitting a prompt file.
A practical first week looks like this. Connect GitHub and add your AI credential. Then go to the Start page, pick a repository and press “Read it and suggest agents.” Choose one preset that has real work in that repository, such as a CI Fixer or a Docs Keeper, and press “Create and start.” Leave “Merge automatically” off, set protected paths for payments, migrations and deploy files, and review what the agent opens. Rate its runs, write two or three standing rules and watch its record grow on the agent page. When the record clears the bar, Factorik offers a promotion and you decide. You can try this with a free 7-day trial of the Team plan, no payment details needed.
Frequently asked questions
What is earned autonomy for AI agents?
Earned autonomy means an AI agent gets more freedom only when its record justifies it. The agent starts by opening pull requests that a person merges. When its merged changes clear a bar (enough of them, a high merge rate and no problems), it can be promoted to merge low-risk changes on its own, and later anything the merge policy allows. If a problem is traced to one of its merged changes, it moves down a level immediately.
Does a self-improving software factory retrain the AI model?
No. The improvement comes from the loop around the model, not from changing the model itself. Each run reads the team's standing rules, recent feedback, findings on the agent's past changes and what happened to its proposals. Meanwhile, the agent's level rises or falls with its record. Over time, the agents fit your repository better, and the factory gets better at giving each one the right amount of room.
Can an agent be promoted automatically, without a person?
Yes, if the organization chooses that. In Settings, “How agents are promoted” can be set to “A person promotes” or “Automatic.” With a person in the loop, Factorik offers the promotion on the agent page and in Slack, and someone presses “Promote” or “Not now.” Most teams should start with a person promoting. Switch to automatic only once you trust both the promotion bar and your merge policy.
What counts as a problem that moves an agent down?
A problem is any failure traced to one of the agent's merged changes. That can be CI or a deploy failing at the merged commit, the change being reverted, or a person reporting a problem with it. Suspicions from watcher agents count only once a person confirms them. When a finding is recorded, the team is notified, the agent drops a level at once, and the level change is logged with the reason.
Let an agent earn its place on your team
Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.