LevelUpWith

Explore / Software Factories: Shipping Agent-Written Code Safely / Lesson 1

Lesson 1: What a Software Factory Is and Isn't

Learn what a software factory is: coding agents running in volume, with automated checks and review deciding what ships. Also learn how it differs from autocomplete, vibe coding and a single agent chat session.

Free to read, no account needed. Part of Software Factories: Shipping Agent-Written Code Safely.

By the end of this level you'll be able to

  • Explain in plain words how a software factory differs from using a coding agent interactively
  • Sort example workflows into factory, assisted coding or unmanaged generation, and justify each choice
  • Name the three things a factory has to control: what goes in, how output is checked and who decides it can merge

Why this course starts with a definition

You have probably used a coding agent in the usual way. You open a chat in your editor or terminal, ask for a change, watch the agent edit files, read the diff and accept or reject it. You are in the loop for every step. That is useful, but it does not scale. You can only steer one or two sessions at a time.

A software factory works the other way round. Many agent runs happen at once, often while nobody is watching. Each run turns a written task into a proposed change. Then a system of automated checks, reviewers and merge rules decides what ships. The agents are not the factory. The factory is the machinery around them.

Here is an analogy for engineers. A single agent chat is like pair programming with a fast junior colleague. A factory is like running a team of contractors you never meet. You hand them tickets, and they send back pull requests. You would never merge contractor code because "it looked busy". You would want clear tickets, a CI pipeline, and a named person who signs off. The factory gives you exactly that, for agents.

The tools for this exist and are in daily use. Some agents run in the cloud and turn a task into a branch or pull request: GitHub's Copilot cloud agent (formerly called Copilot coding agent), OpenAI's Codex cloud tasks, Google's Jules, and Claude Code running inside GitHub Actions. Owning one of these tools does not mean you have a factory. Plenty of teams have the tools and none of the controls.

Three ways to use AI for code

Three categories cover most of what you will see in practice.

Assisted coding Unmanaged generation Software factory
Who drives A human, turn by turn Nobody in particular A queue of written tasks
Volume One session at a time Can be high High, on purpose
How output is checked The human reads each diff Hope, or "it runs" Automated gates first, then review
Who decides to merge The same human Whoever clicks the button A written policy and named owners

Assisted coding covers autocomplete and interactive agent chat. The human is the quality control, so it is safe at low volume. It stops scaling once the human gets tired of reading diffs.

Unmanaged generation is volume without control. The friendly version is vibe coding. Andrej Karpathy coined the term in February 2025 for a style where you "forget that the code even exists". He offered it for weekend projects where code quality is not a major concern. In a throwaway prototype that is fine. In a shared production repository, the same habit leaves you with code that nobody has read.

A factory keeps the volume and puts the control back. It does that with process, not by having a human watch every keystroke.

The three things a factory controls

Every factory, whatever the vendor, has to answer three questions:

  1. What goes in? Which tasks an agent may take on, and how well they are written. A vague ticket produces a vague PR, only faster.
  2. How is output checked? Which automated checks a change must pass before a human spends any attention on it.
  3. Who decides it can merge? Which kinds of change may merge after the checks alone, and which ones need a person, and which person.

Below is a sketch of these controls written down as a policy file. The format is made up for teaching and is not any tool's real config. The point is that each control is explicit and versioned, not kept in someone's head.

# factory-policy.yaml  (illustrative format, not a real tool's schema)
intake:                      # 1. What goes in
  allowed_labels: [agent-ok] # only issues a human has labelled
  require: [acceptance_criteria, files_in_scope]
  forbidden_paths: [infra/, migrations/, auth/]  # agents may not touch these

checks:                      # 2. How output is checked
  - lint
  - typecheck                # mypy / tsc --noEmit
  - tests: existing_suite    # tests that existed before the agent ran
  - diff_size_max_lines: 400 # large diffs get bounced, not reviewed

merge:                       # 3. Who decides
  default: human_review      # one named code owner approves
  never_auto: [dependencies, security, public_api]

Gotcha: teams often build control 2 (checks) and skip 1 and 3. Strong CI with sloppy intake gives you a fast stream of well-formatted, wrong changes. A clear merge rule matters just as much, because "anyone can approve" means nobody is accountable.

Worked example: sorting real workflows

When you look at any setup, ask the three questions. The small Python helper below makes the reasoning explicit. A real classification needs judgement, but writing the rules out like this keeps you honest.

from dataclasses import dataclass

@dataclass
class Workflow:
    name: str
    human_drives_each_step: bool   # is a person steering turn by turn?
    intake_controlled: bool        # are tasks written and gated? (control 1)
    automated_checks: bool         # do gates run before review? (control 2)
    merge_policy: bool             # is there a named merge decision? (control 3)

def classify(w: Workflow) -> str:
    if w.human_drives_each_step:
        return "assisted coding"          # the human is the control
    if w.intake_controlled and w.automated_checks and w.merge_policy:
        return "software factory"         # all three controls present
    return "unmanaged generation"         # volume, with a control missing

examples = [
    Workflow("Dev accepts Copilot suggestions in VS Code", True, False, False, False),
    Workflow("Cron job asks an agent to fix every open issue; auto-merges if it builds",
             False, False, True, False),
    Workflow("Labelled issues go to a cloud agent; CI + owner approval required",
             False, True, True, True),
]
for w in examples:
    print(f"{classify(w):22} <- {w.name}")

Output:

assisted coding        <- Dev accepts Copilot suggestions in VS Code
unmanaged generation   <- Cron job asks an agent to fix every open issue; auto-merges if it builds
software factory       <- Labelled issues go to a cloud agent; CI + owner approval required

Look at the second case. It has some automation, because it checks that the code builds, and it runs at volume. It still has no intake control and no real merge decision. One check does not make a factory. Notice too that the model does not matter here. Swap Claude for GPT, Gemini or an open-weight model and the answer stays the same.

Trade-off: a factory costs money to set up: specs, CI, policies and on-call owners. For a solo prototype, assisted coding or plain vibe coding is often the right call. A factory pays off when several people share a codebase that must stay healthy.

Hands-on exercise

Pick a repository you work on and spend 20 minutes on this:

  1. List every way AI-written code reaches it today: autocomplete, agent chats, bots and scripts.
  2. Add each one to the examples list above and run classify.
  3. For anything labelled unmanaged generation, write one sentence naming the missing control: intake, checks or merge decision.
  4. Draft a three-section factory-policy.yaml for that repository. Leave a section empty if you honestly don't know the answer yet. Those gaps are what the rest of this course will fill in.

Key takeaways

  • A software factory is coding agents running at volume, with automated checks and a merge policy deciding what ships. The machinery around the agents is the factory.
  • Assisted coding keeps a human in every step. Unmanaged generation has volume without control. A factory has volume with control.
  • Every factory controls three things: what goes in, how output is checked and who decides it can merge.
  • Having cloud agents or a CI pipeline is not enough. If any one of the three controls is missing, you have unmanaged generation.
  • Which model you use does not change the category. The controls do.

A 6-question knowledge check follows this lesson in the app, free and without an account.

More like this