Factorik Factorik Start free trial
← See all articles

What It Takes to Build a Software Factory

Quick answer: To build a software factory, put the foundations in place before you add agents. You need reliable CI with tests that check behavior, a green default branch and issues specific enough to act on. You also need an isolated sandbox for each run, a merge policy with protected paths and size limits, and a record of every agent's results. Without these, agents open more pull requests but your team doesn't ship more.

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.

Start your free trial

What does it take to build a software factory?

Building a software factory takes six things before any agent writes code: CI you trust, a green default branch, issues an agent can act on, isolated sandboxes, a merge policy with protected paths and a record of every agent's results. The agents themselves are the easy part. When engineering teams say software factory, they mean a pipeline where autonomous agents take routine work, such as a reported bug, a broken build or an outdated dependency, and carry it through to a pull request, checks and sometimes a merge. Most teams do it backwards. They pick a coding agent, point it at a repository and watch the pull requests pile up. That isn't a factory. It's just a faster way to fill a review queue.

The order matters because each piece depends on the one below it. An agent can only prove a fix if the tests mean something. Tests only mean something if the default branch is green, so that a red check points at the new change and not at last week's mess. A merge policy can only be enforced if checks are required and sensitive paths are named in advance. And none of it can be loosened safely unless someone keeps score on what each agent shipped and what broke afterwards. Skip a layer and everything above it gets shaky. A useful way to think about it: each prerequisite answers one question a careful reviewer would ask before letting an agent's change through.

None of this is unusual. Teams that ship reliably already have most of it. The 2025 DORA research from Google Cloud, based on responses from nearly 5,000 technology professionals, described AI as an amplifier: it magnifies the strengths of well-run organizations and the dysfunctions of struggling ones. That's the honest reason to do the groundwork first. An agent dropped into a repository with flaky tests and vague issues doesn't fix those problems. It produces more work that runs into them. The table below lists the six requirements, the question each one answers and what you'll see when it's missing. Any row you can't tick is your first project, and it usually costs less than an agent rollout.

RequirementQuestion it answersSymptom when missing
Reliable CI and meaningful testsDoes this change actually work?Plausible code that fails CI, or passes and breaks later
Green default branchDid this change cause the failure?Agents chase failures they didn't cause
Actionable issuesWhat exactly should change?Tidy pull requests that solve the wrong problem
Isolated sandboxesWhat can the agent reach while it works?Agents holding credentials they never needed
Merge policy with protected pathsWhich changes may merge without a person?Everything waits, or risky changes slip through
A record per agentHas this agent earned more trust?Autonomy granted on gut feel, not evidence
Six software factory requirements, the question each answers, and the symptom you see when it's missing.

Why is CI readiness the first requirement for AI agents?

CI readiness comes first because CI is the only reviewer that reads every agent change, every time, to the same standard. If your checks are slow, flaky or shallow, nothing an agent produces is verified, and your reviewers end up verifying it by hand. A CI-ready repository has three properties. A single documented command builds the project and runs its tests from a clean checkout. The tests check behavior, not just that the code compiles or the types line up. And the suite is deterministic enough that a red result means something changed, not that a timing-dependent test lost a coin toss again. An agent that can't run your tests will happily write code that looks right and then fails in CI.

The green default branch needs its own line on the checklist. When main is already failing, every agent that touches it starts from a red baseline and has to guess which failures are its own. Some agents will fix unrelated tests just to get a pass, and others will stall. Either way, you lose the clean signal that makes automation worth trusting. Repairing the default branch is also good first work for an agent. A CI-failure trigger can wake one when main goes red, hand it the end of the failed job's log and have it open a pull request with the cause and the fix. The job is narrow, easy to check and easy to judge, so an agent that repairs a broken default branch is a sensible place to start.

CI capacity is the quieter problem. Agents produce changes faster than people do, and every change needs a full CI run. CircleCI's 2026 State of Software Delivery report found that the typical team's feature-branch activity rose 15% over the previous year, while throughput on main fell almost 7%. That's a vendor report, so treat it as a signal rather than settled fact. Still, the shape matches what many teams feel: more work started, less of it landing. DORA's 2025 research pointed the same way and found that AI adoption still had a negative relationship with delivery stability. Before you add agents, check that your CI can take more runs without long queues. Also decide how many times an agent may retry a failing pipeline before a person steps in.

What makes an issue something an agent can act on?

An issue an agent can act on states the expected behavior, the actual behavior, how to reproduce it and roughly where the problem lives. If a new engineer couldn't start on it without a meeting, an agent can't either. Agents don't ask clarifying questions the way a colleague would at the next desk. They make a reasonable guess, and a reasonable guess about a vague ticket gets you a tidy pull request that solves the wrong problem. Compare “checkout is broken sometimes” with “applying a discount code to a cart that holds a gift card returns a 500; stack trace attached; started after Tuesday's release.” The second gives an agent a place to start, a failing test to write and a clear way to know when it's done.

You don't need to rewrite your backlog. Start by labeling the issues that are already well written, using a single label such as bug or agent-ready, and wake agents only on those. A triage step helps too. A triage agent that never changes code can reply to new issues, ask for missing reproduction steps and flag duplicates, so issues reach a coding agent in better shape. Alongside the issues, write down the conventions an agent can't work out from the code: which commands to run, which directories are generated, which patterns the team has abandoned and what never to touch. Some teams keep this in a file at the repository root. Others attach it to each agent as standing rules. Either way, people write those rules and every run reads them.

Here's the contrarian part: the best early work for agents often isn't in the backlog at all. The backlog is where ambiguity goes to age. Scheduled, self-contained jobs have clearer success criteria than most tickets someone filed in a hurry. Think of updating one dependency group, covering one untested module or correcting one outdated docs page. These jobs also make cleaner evidence. If twenty of an agent's dependency-bump pull requests pass checks and merge without comment, you've learned something real about that agent. If it spends a month half-solving fuzzy feature requests, you've learned very little and your reviewers are worn out. That's why a 30-day plan that starts with narrow jobs on one repository is easier to judge than launching across every team 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.

Start your free trial

Why do agents need isolated sandboxes and a merge policy?

Agents need isolated sandboxes so that a mistake, or a malicious instruction hidden in an issue, can't reach beyond a single repository. They need a merge policy so that the decision to ship comes from rules written in advance, not from the agent. These are the two safety layers: one covers the agent while it works, the other covers what happens when it's done. A good sandbox is created fresh for each run, gets a short-lived read-only token for one repository and has no standing access to production secrets. The finished change leaves the sandbox as a commit, and something other than the agent publishes it to a named branch. It is never force-pushed and never written straight to the default branch.

It's tempting to run agents directly on your CI runners because they already exist. Don't. CI usually holds deploy keys, registry credentials and network access that an agent fixing a bug has no business seeing. CI also runs checks against a diff that already exists, while an agent needs somewhere to work before that diff exists, going back and forth between code and tests. Treat text from issues, comments and chat messages as data, not instructions. Prompt injection through a public issue is a real attack path. The simplest defense is to make sure nothing an outsider writes can widen what the agent is allowed to do. On public repositories, also decide explicitly whether people outside the team can wake an agent at all.

Most teams under-invest in the merge policy. A useful merge policy for AI agents keeps auto-merge off by default, requires every check to pass and caps change size in files and lines. It also names protected paths where a person must approve: dependency manifests, build and deploy configuration, secrets and permissions, database migrations and anything that moves money. Every one of those rules is a fact about the change, not a judgment call. Low-risk should never mean the model said it was low-risk. Code review agents belong here too, as a gate rather than a commenter. A review that ends in a verdict on the exact commit, and makes the author answer each point, is worth far more than a pile of suggestions nobody has to address.

How do you know when to trust an agent with more autonomy?

You trust an agent with more autonomy when its record says so: enough merged changes, a high share of its pull requests merged and no problems traced back to anything it shipped. Without a record for each agent, autonomy decisions come down to gut feel: a good demo, a bad week, or whoever argues loudest in planning. Keeping a record means every run ends in a recorded outcome, such as a pull request, a review, a proposal, nothing to do, or blocked with a reason. Merged changes stay linked to the agent that wrote them. If CI fails at the merged commit, a deploy breaks, someone reverts the change or a person reports a problem, the finding goes on that agent's record. It shouldn't get lost in a general incident channel.

With a record in place, autonomy becomes a ladder, not a switch. One sensible version has three levels. First, the agent opens pull requests that a person merges. Next, it may merge low-risk changes by itself when the merge policy allows. Finally, it may merge anything the policy allows. The agent is promoted one level at a time when its record clears the bar, and any problem traced to one of its merged changes moves it down a level at once. Every level change is logged with who made it and why. With that audit trail, an engineering leader can answer, months later, why an agent was allowed to merge a particular change. It also settles whether agents should merge their own code at all: some can, once they've earned it.

Measure outcomes, not activity. Pull requests opened is the easiest number to report and the least useful, since a factory without its prerequisites produces plenty of them. The numbers that show a factory is working are changes merged, merge rate, problems caused by merged changes and the reviewer time spent on each merged change. If pull requests go up while merges stay flat, the bottleneck is further down the line, usually in review or CI, and more agents will only make it worse. To try an earned-autonomy model on your own repository, you can start a free 7-day trial of the Team plan without payment details. Define one agent with one narrow job and let its record build from there.

Frequently asked questions

What are the minimum software factory requirements for a small team?

A small team needs a single command that builds the project and runs meaningful tests, a default branch that stays green, a handful of well-written issues or a scheduled maintenance job, and branch protection that requires passing checks. Add a merge policy that keeps auto-merge off and protects sensitive paths. That's enough to start one agent on one repository. Platform work can come later, once the agent's record shows where the bottlenecks are.

Can AI agents work in a repository without tests?

They can open pull requests, but nobody can verify those changes except a person reading them line by line. That moves the work rather than removing it. If a repository has little coverage, a good first job for an agent is writing tests for the important logic that has none. Once those tests merge, later agent changes have something real to prove themselves against, and the review load starts to drop.

Should AI agents be allowed to merge their own pull requests?

Only when a merge policy allows it and the agent has a record that justifies it. Start with every pull request waiting for a person. As an agent builds up merged changes with no problems traced back to them, let it merge small, low-risk changes that stay outside protected paths. Any problem caused by one of its merged changes should take that right away at once, and the change in level should be logged.

How is an AI software factory architecture different from a CI/CD pipeline?

A CI/CD pipeline checks and ships a diff that already exists. An AI software factory adds the steps before that: something wakes an agent, the agent works in an isolated sandbox, and the change is published to a branch without the agent getting write access. It also adds steps after the merge, such as a policy deciding what may merge and a record linking every merged change to its author.

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.

Start your free trial

How helpful was this article?

Articles by Factorik →