Live on Product HuntThe open source launch of CybeDefendSupport usSupport usStar on GitHub
Star
Back to all posts

How to Secure an AI Software Factory: The Box, the Review, and the Floor Inside the Run

An AI software factory runs coding agents with no one in the chat. What Stripe, Spotify and Ramp publish, where their security sits, and what to add.

On this page
  1. What is an AI software factory?
  2. How does a software factory run, step by step?
  3. What do the public factories publish?
  4. Where does a factory's security sit today?
  5. What do the box and the review leave open?
  6. What did Stripe and Spotify add on top of the box?
  7. Which four security stations does a factory need?
  8. How do you build the floor into a factory?
  9. How does CybeDefend secure an AI software factory?
  10. What does CybeDefend put at each piece of the factory?
  11. Why is each piece better this way?
  12. What does a refused action look like in a run?
  13. How do you plug CybeDefend into a factory?
  14. Frequently asked questions
  15. What is an AI software factory?
  16. Is a sandbox enough to secure background agents?
  17. What is the difference between a software factory and an agentic SDLC?
  18. Does a factory still need human review?
  19. Do hooks apply to sub-agents?
  20. Which coding agents can a factory use?
  21. How do you secure MCP tools in a software factory?
  22. How do I add CybeDefend to a software factory?
  23. Where do I start if my factory already runs?

One run of an AI software factory and where its security sits: the box, an isolated machine with no production data and a closed network; inside the run, the agent has full permissions and no prompt; the four stations to add are the company's rules served while the agent writes, a guard on each action before it runs, scanners on what the agent wrote, and a record of every refusal; then the review, where a human reads the pull request

To secure an AI software factory, keep the two controls every public factory already has, an isolated machine for each run and a review of the pull request, and add a security floor inside the run: your company's rules served while the agent writes, a guard on each action before it runs, scanners on what the agent wrote, and a record of what happened.

A software factory is a program that does what a developer does with a coding agent, without the developer. A request comes in, a script opens a clean machine, starts the same coding agent, runs the tests and opens the pull request. Everything in our guide to AI coding agent security still applies, with one difference that changes the design: there is no person in the chat to say no. We read what seven companies publish about their factories, and what Anthropic and OpenAI write about running an agent unattended, at the source on 28 November 2026.

What is an AI software factory?

An AI software factory is a pipeline that turns a request into a merged change with coding agents doing the work at each step and people at the two ends. StrongDM, which published its own in February 2026, defines it as "non-interactive development where specs + scenarios drive agents that write code, run harnesses, and converge without human review." Uber uses the same word for its engineering platform, and its August 2026 article on running a software factory at Uber scale says that "more than 70% of pull requests are attributed to local or cloud agents."

The names vary. You will read agentic software factory, background agents, agentic SDLC or AI SDLC, and they describe the same move: the coding agent leaves the developer's terminal and runs as a job. The agent is the same binary as before, and the difference is who launches it and where it runs.

One line on a neighbour with almost the same name. The "secure software factory" of supply chain security is the reference architecture CNCF's security group published in 2022 for the software supply chain. This guide is about something else, the security of a factory where agents write the code.

1,300+

pull requests merged each week at Stripe that are completely produced by its agents and reviewed by a person, by Stripe's article of 19 February 2026.

70%+

of pull requests at Uber attributed to local or cloud agents, by Uber's engineering blog on 27 August 2026.

About 1/2

of merged pull requests in Ramp's frontend and backend repositories started by its background agent, by Modal's write-up of 19 February 2026.

About 1/4

of agent sessions vetoed by the LLM judge in Spotify's background coding agent, by Spotify's article of 9 December 2025.

How does a software factory run, step by step?

A factory run has ten steps, and the public write-ups agree on them even when they name them differently. Each step below carries one example, quoted from the company that published it.

  1. Intake

    Somebody asks, in a chat thread, a ticket or a web page. At Stripe, "by tagging our Slack app, engineers can kick off a minion directly from the thread discussing a change."

  2. Plan

    The request becomes a prompt or a spec. At Spotify, engineers "first talk to an interactive agent that helps to gather information about the task at hand", and the result is handed to the coding agent.

  3. Orchestration

    A script chains agent steps and ordinary steps. Stripe calls its scripts blueprints, where "a given node can run either deterministic code or an agent loop focused on a task". Shopify built Roast on the same idea, with the line "Non-determinism is the enemy of reliability."

  4. Environment

    A fresh machine receives the repository. Stripe aims for a devbox "ready within 10 seconds". At Ramp, every 30 minutes a scheduled job clones each repository, installs the dependencies and saves a snapshot, and each session starts in a new sandbox from the latest one.

  5. Context

    The rule files and the tools are loaded. Stripe gives its agents context "from files that are scoped to specific subdirectories or file patterns", the same files its developers' tools read. OpenAI treats AGENTS.md as "the table of contents", and not as the encyclopedia.

  6. The agent runs

    The coding agent reads, writes and runs commands, with no prompt. Stripe runs it "with full permissions". Spotify's top-performing agent is Claude Code, and Ramp runs OpenCode inside the sandbox.

  7. Sub-agents

    The agent hands parts of the work to other agents. Ramp's agent can "spawn child sessions" to work across repositories in parallel.

  8. Verification

    Linters, tests, sometimes a second model. Spotify runs its verifiers before the pull request opens, and "in the case of Claude Code, we do this with the stop hook". Its judge compares the diff with the original prompt.

  9. Review

    A person reads the pull request, or does not. Stripe's changes are "human-reviewed". At OpenAI, "humans may review pull requests, but aren't required to". StrongDM's rule is "Code must not be reviewed by humans".

  10. Merge

    The change goes in, and the next request is already running.

One run of a software factory, from the request to the merge.

What do the public factories publish?

Seven companies have described their factory in enough detail to compare. The table keeps what each one says about its agent, its environment and its checks, and every line links to its source.

CompanyWhat it builtThe agentWhat it says about checks
StripeMinions, started from SlackA fork of Block's gooseDevboxes in a QA environment, linters, up to two rounds of CI, a human review
SpotifyA background coding agent, HonkClaude Code is the top performerA container with limited permissions, verifiers, an LLM judge
RampInspect, from Slack, the web or a browser extensionOpenCodeOne sandbox per session with the full development stack
OpenAIAn internal product with "0 lines of manually-written code"CodexCustom linters and structural tests, review handled agent to agent
ShopifyRoast, an open source workflow frameworkA coding agent tool "powered by Claude Code"Deterministic steps around the agent steps
UberThe Software Factory, with managed agents across the lifecycleLocal and cloud agentsOne entry point for tools, "enabling centralized authentication and policy enforcement"
StrongDMA factory with no human code and no human reviewAgents driven by specs and scenariosScenarios often kept outside the codebase, a measure it calls satisfaction

Read together, the orchestration differs a lot from one company to the next, and the security does not: it sits in the same two places every time.

Where does a factory's security sit today?

It sits around the run and after it: the box first, then the review. Stripe says it plainly in the second part of its Minions series. Its devboxes run in a QA environment, so "minions don't have access to real user data, Stripe's production services, or arbitrary network egress." Because of that, "any mistakes an agent might make are confined to the limited blast radius of one devbox, so we can safely run the agent with full permissions and skip confirmation prompts."

Spotify describes the same choice in part 3 of its series: "The agent runs in a container with limited permissions, few binaries, and virtually no access to surrounding systems. It's highly sandboxed." Ramp gives each session its own sandbox. Then come the tests, sometimes a judge, and a person on the pull request.

This is sound engineering, and you should copy it. The flag that removes the prompts is only safe inside such a machine, which is what our guide to what --dangerously-skip-permissions skips in Claude Code explains, and Anthropic's documentation says the same in a warning: "Only use this mode in isolated environments like containers, VMs, or dev containers without internet access."

What do the box and the review leave open?

They leave open everything the agent does between the first prompt and the pull request. The box limits how far a mistake can travel. It does not look at any single action, and the makers of the agents write this themselves.

Sandbox isolation reduces the impact of a breach, but it does not eliminate risk. Any approach that allows network egress can still leak data the agent can read, and any approach that mounts your project directory writable can still modify that code.

Claude Code documentation, Sandbox environments, read 28 November 2026

Anthropic's page on dev containers is more specific: run with the flag that skips permissions, they "do not prevent a malicious project from exfiltrating anything accessible inside the container". OpenAI's Codex documentation on approvals and security carries the same sentence for its own flags: inside the container, "a malicious project can exfiltrate anything available inside the devcontainer, including Codex credentials." It also warns that "prompt injection can cause the agent to fetch and follow untrusted instructions", which is the path we follow in our article on instructions hidden in AGENTS.md and CLAUDE.md files.

A factory needs some network to work: a package registry, the code host, the model. Each of those is a way out for whatever the agent can read, and our analysis of why an agent does not need to escape its sandbox shows how little it takes. The review has its own limit, which is volume. A team that receives a thousand agent pull requests a week reads diffs, and a diff does not show the command that ran and was reverted, or the rule the reviewer never knew. We cover that side in who reviews an agent's pull requests.

What happens
The box and the review
A check inside the run
A command that deletes or overwrites
It runs, and the damage stays in one machine
Checked before it runs, refused with a reason
Code that breaks a rule of your company
Written, then caught if the reviewer knows the rule
The rule reaches the agent before it writes the file
A secret or a flaw in the change
Found if CI scans for it
Scanned before the commit and fixed in the same run
An instruction hidden in a file the agent reads
The network limit caps what can leave
Each action that follows still passes the guard
What the CISO can read afterwards
The pipeline log and the pull request
Each refusal, by rule, agent and session

What did Stripe and Spotify add on top of the box?

Both added a check inside the run. Stripe writes: "Since minions operate autonomously with full freedom to call their MCP tools, we also have an internal security control framework that ensures they can't use their tools to perform destructive actions." It calls the devbox "a first line of defense", which tells you there is a second one.

Spotify went at it from the tool side. In part 2 of its series, the agent gets three tools: a verify tool, "a Git tool that provides limited and standardized access to Git", and "the built-in Bash tool with a strict allowlist of commands." Then it added the judge, "because some agents were a bit too 'ambitious', trying to solve problems that weren't strictly in their prompt, like refactoring code or disabling flaky tests." By Spotify's count, across thousands of sessions "the judge vetoes about a quarter of them", and "the agent is able to course correct half the time."

OpenAI describes the same layers for its own use of Codex in Running Codex safely: "managed configuration, constrained execution, network policies, and agent-native logs", with the reminder that "control is only half the job."

A company that copies a factory from these articles copies the speed first: the devbox, the blueprint, the Slack trigger. The guard is one sentence in a long post, and it is the part a copy leaves out.

Which four security stations does a factory need?

Software factory security comes down to a floor at four stations, each one plugged into a step of the run that already exists.

A factory run drawn as ten steps with the box around steps 4 to 8: intake, plan and orchestration come before the box; inside it, the environment, then the context where the company's rules are served while the agent writes, the agent run and its sub-agents where a guard checks each action before it runs and refuses with the reason, and verification where scanners run on what the agent wrote; after the box, a human reviews the pull request and the change is merged; a record of every refusal, by rule, agent and session, runs along the whole line

Your own rules, served while the agent writes

A rule file loaded at the start says how to build here. It does not say that a refund above a threshold needs an approval, or that this table is never read without a tenant filter. Those rules have to reach the agent at the moment it writes the file they apply to. This station sits at step 5, and it keeps working during step 6.

A guard on each action, before it runs

Every tool call, a shell command, a file write, a call to an MCP tool, passes a check before it executes. A dangerous one is refused, and the agent receives the reason. This is step 6, and step 7 too, because a sub-agent acts with the same permissions.

The scanners, on what the agent wrote

Tests prove the change works. They do not find the secret in a fixture, the injectable query or the open storage bucket. A scan of the changed files belongs in step 8, as a fixed step of the script, before the pull request opens.

A record of what happened

The pipeline log says a job ran. A CISO asks which rule was applied, which action was refused, by which agent, in which session. That record runs along the whole line and is read at steps 9 and 10, and by the auditor later.

How do you build the floor into a factory?

Five checks decide whether the floor holds in every run. The examples use Claude Code, because its documentation spells out unattended runs in detail. The same questions apply to OpenAI Codex, OpenCode or any other coding agent your factory starts. Each of these checks lands on a piece of the harness your team already wrote, and agent harness security goes through the eight pieces one by one.

Here is the smallest version of the second station, to show what the agent reads. The settings file follows the shape the Claude Code documentation gives for managed settings, and lives on the image:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [{ "type": "command", "command": "/opt/factory/hooks/guard.sh" }]
      }
    ]
  }
}

The script it points to refuses one thing, a force push, and says what to do next:

#!/bin/bash
# PreToolUse guard: refuse a force push, and tell the agent what to do next.
cmd=$(jq -r '.tool_input.command // empty')
if echo "$cmd" | grep -Eq 'git +push .*(--force|-f)( |$)'; then
  jq -n '{hookSpecificOutput: {hookEventName: "PreToolUse",
    permissionDecision: "deny",
    permissionDecisionReason: "Rule git-01: no force push from a factory run. Push to a new branch and open a pull request."}}'
fi
exit 0

We ran the script by hand on 28 November 2026, with the event Claude Code sends to a PreToolUse hook for the command git push --force origin main. This is what it printed, and what the agent would read as the reason:

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "deny",
    "permissionDecisionReason": "Rule git-01: no force push from a factory run. Push to a new branch and open a pull request."
  }
}

A push to a new branch prints nothing, and the call goes through. One rule in a shell script is a demonstration. A real floor has your company's rules behind it, kept up to date, with a record of each refusal, and neither the box nor the agent brings it.

How does CybeDefend secure an AI software factory?

CybeDefend is the security layer an AI software factory is missing. The box comes with the machine, the hook comes with the agent and the review comes with the code host. Your rules, the guard behind the hook, the scan of what the agent wrote and the record of each refusal come with none of them. CybeDefend brings them as one install on the coding agent your factory already starts. It plugs in at the agent. Your orchestration, your box, your tests and your review stay as they are, and every run started from the machine image goes through the layer, sub-agents included in Claude Code. The part that sits on the agent is VibeDefend, and everything it records is read in the Brain.

One factory run with the CybeDefend layer, as six rows: before the run, rules mined from your code and approved by your security team, with your policies and the frameworks you choose; when the agent writes src/billing/refund.ts, rules chosen by intent are served before the write; when the agent runs cat .env, the guard checks the call, refuses it with the rule and the next step, and the agent takes the managed reference; when the agent calls an MCP tool, the MCP proxy checks it against your organization's policy; at the end of the run the changed files are scanned for code, secrets and infrastructure as code, and a finding is fixed before the commit; the Brain keeps the record of each agent seen; then the pull request opens

What does CybeDefend put at each piece of the factory?

A factory starts the same harness on every run: one map, the rule files, the skills, the sub-agents, the hooks, the tools, the permissions and the pipeline, loaded from one image with nobody in the chat. The table gives what each piece does today and what CybeDefend puts there.

Piece of the factory
How it is done today
With CybeDefend
The map
AGENTS.md or CLAUDE.md, loaded at the start of every run
A short map: the rules have left it, and a secret pasted into it is found by the scan
The rules
Rule files written by hand, one format per agent, one copy per folder
Rules mined from your code, approved by your security team, injected by intent at each write
Skills and commands
The team's method: spec, plan, implement, review
/cybedefend, the full security audit as one command a run can call
Sub-agents
A reviewer, a tester, a planner, each with its own tools
The same guard inside each sub-agent in Claude Code
Hooks
Format, lint, run the tests
Each action checked against your policies and your rules before it runs, refused with the reason
Tools
MCP servers for the tracker, the docs, the build
The MCP proxy checks each tool against your organization's policy, and your rules and findings come as tools
Permissions and sandbox
Prompts off, one isolated machine per run
A refusal that still holds with the prompts off
Orchestration and pipeline
Start the agent, run the tests, open the pull request
The changed files scanned before the commit, and the Brain: each agent's access map, each refusal on record

Why is each piece better this way?

There is one reason per piece. The rules come first, because rule files are the piece teams write by hand today.

What does a refused action look like in a run?

Take a run that fixes a refund bug and, on the way, reaches for the .env file.

  1. The agent writes the fix

    It edits src/billing/refund.ts. The rules for that change are served before the write, so the agent has them in front of it while it writes.

  2. The agent reaches for .env

    It wants a database URL and runs cat .env. The guard checks the call before it runs.

  3. The call is refused, with the rule and the next step

    "Raw secret reads are refused; the agent gets the managed reference instead." The command never runs, and the refusal names the rule.

  4. The agent takes another path

    It uses the managed reference and finishes the fix. The run goes on, and nobody had to be in the chat.

  5. The changed files are scanned

    Before the commit, the diff scan reads the files the run changed. When it finds something, the finding comes back to the agent, which fixes it in the same run.

  6. The refusal is on record

    The Brain shows it by rule, agent and session, next to what the agent was served.

One action through the layer, from the write to the record.

How do you plug CybeDefend into a factory?

In five steps, and none of them touches your orchestration.

  1. Install it once on the image the factory starts from. The installer lets you pick the agents to wire, keeps the MCP proxy on by default and asks for non-blocking mode. The hooks are wired globally, in ~/.claude/settings.json for Claude Code, so every session on the machine gets them.
  2. Let it find the project. For a project imported from GitHub or GitLab, "there is nothing to do": VibeDefend reads the repository's origin remote and finds the matching CybeDefend project on the first hook call. For any other repository, set CYBEDEFEND_PROJECT_ID.
  3. Turn on non-blocking mode in the runner. The README says an autonomous agent or a CI runner "has nobody in the chat to answer, so turn on non-blocking mode at install". Rule proposals then wait in the dashboard for a human, and "the agent never accepts or rejects a proposal on its own."
  4. Keep the launch command clean. No --bare in Claude Code. With the Agent SDK, keep user in settingSources, because the hooks live in the user settings. In Google Antigravity, no agy --dangerously-skip-permissions, which "runs no hook at all, on any event".
  5. Read the Brain. The refusals, the findings and the agents seen are there from the first run.
# Once, on the image the factory starts from
npx -y @cybedefend/vibedefend@latest install

# In the environment of the runner
export CYBEDEFEND_NON_BLOCKING=1

For the verification station, there is CybeDefend Open Source. /cybedefend is one command in your coding agent that runs a full audit: the open source AppSec scanners, with Opengrep, Trivy, Gitleaks and zizmor among them, then the AI scanner, run by your coding agent, which goes after the flaws scanners can't see and proves each one with an exploit written as a test. Our comparison of security audit skills for coding agents shows where it sits next to the others. The repository is public at github.com/CybeDefend/cybedefend, and if you run it in your factory, give it a star so the next team building one finds it.

Frequently asked questions

What is an AI software factory?

It is a pipeline, also called an agentic software factory, in which coding agents do the work of each step, from the request to the pull request, with no developer typing in a terminal. A script receives the request, opens an isolated machine, starts the agent, runs the checks and opens the pull request. Stripe, Spotify, Ramp, OpenAI, Shopify, Uber and StrongDM have each published theirs.

Is a sandbox enough to secure background agents?

No. A sandbox limits the damage of a run, and Anthropic's documentation says it "does not eliminate risk": whatever the agent can read can leave through any network path you allow, and it can still modify the code it has in front of it. You need the sandbox, and a check on each action inside it.

What is the difference between a software factory and an agentic SDLC?

They describe the same change from two sides. Agentic SDLC, or AI SDLC, names the lifecycle in which agents take part in each phase. Software factory names the system a company builds to run it: the intake, the orchestration, the machines, the checks.

Does a factory still need human review?

The companies differ. Stripe has every change reviewed by a person, OpenAI makes it optional, and StrongDM forbids it. Whatever you choose, a review reads the result. It cannot see what the agent did during the run, which is why the guard and the record sit inside it.

Do hooks apply to sub-agents?

In Claude Code they do. The documentation says hooks from settings files, managed policy settings and plugins "also run inside subagents", and the hook input carries the identifier of the sub-agent. Check it for the agent you use, with a test run that makes a sub-agent attempt a refused action.

Which coding agents can a factory use?

The public factories run a fork of goose (Stripe), Claude Code (Spotify), OpenCode (Ramp) and Codex (OpenAI). The agent is replaceable. What matters for security is whether it gives you a hook before each action and a way to load it on every run.

How do you secure MCP tools in a software factory?

Check each MCP tool call before the agent makes it, and keep a list of the MCP servers your agents reach. In a factory the agent calls its tools with nobody watching. With CybeDefend, the VibeDefend proxy goes in front of your other MCP servers: each tool is checked against your organization's policy before the call, and the servers it sees and the calls it refused are reported to your organization.

How do I add CybeDefend to a software factory?

Install it once on the image your factory starts from, with npx -y @cybedefend/vibedefend@latest install, and turn on non-blocking mode so the agent never waits for an answer. The guard covers every tool call in Claude Code, Cursor, OpenAI Codex and Google Antigravity, and in Devin Desktop it blocks file writes, file reads and shell commands. Nothing changes in your orchestration: the script starts the same agent with the same command.

Where do I start if my factory already runs?

Start with the verification station, because it changes nothing in how the agent runs: add a scan of the changed files as a fixed step before the pull request. Then read the command that launches your agent, and add the guard. CybeDefend Open Source gives you the first of the two in one command: run it on your code.