Software factory / Start
What each agent does
The factory has 11 agents, and all of them are off by default. You want to know what each agent does and who starts it, before you turn more of them on.
9 min read
Each agent does one job. Some agents have steps: parts of the job that you turn on and off one by one. A step runs only while its agent is on. To turn on an agent or a step, see Turn on the agents.
The agents at a glance
| Agent | Its job |
|---|---|
| Security audit | Reads each pull request for malware, prompt injection, secret theft and hidden code |
| Spam | Closes spam, and bans accounts or suggests bans |
| PR review | Reviews each pull request |
| Keep green | Keeps pull requests ready to merge |
| PR summary | Explains each pull request on its page |
| Triage | Finds duplicate, fixed and unclear issues |
| Assign | Assigns up to 2 experts to each new issue and pull request |
| Issue fix | Reproduces an issue, then can open a fix pull request |
| Dependencies | Fixes the code of a dependency update pull request whose CI fails |
| Architecture | Keeps the Architecture tab of the repository up to date |
| CI cache | Opens a pull request that caches your CI steps |
The PR chat and the Architecture chat are on by default. See The chats.
On a pull request
When an agent is on, the Who starts it column says who starts it by default. Change that with Who starts it in the settings.
| Agent | What it does | Who starts it |
|---|---|---|
| Security audit | Looks for malware, prompt injection, secret theft and hidden code | Everyone |
| PR summary | Explains the pull request on its page, with its steps below | Everyone |
| PR review | Posts a review with line comments, then runs its steps below | Everyone. Push fixes runs after a review with findings, and after a clean audit |
| Keep green | Keeps the pull request ready to merge, with its steps below | Everyone, when the pull request conflicts or a CI run of the head fails. For an author without write access, only after a clean audit |
| Assign | Assigns up to 2 people from the Experts page and the CODEOWNERS file, each with a note that says why. See Assign each new item to an expert | Everyone, one time: when the pull request shows, or when a draft becomes ready |
PR summary has three steps. When you turn the agent on, Impact and Classify are on, and File domains is off:
- Impact shows in the Impact tab if the pull request changes the architecture or the public API. See Read the Impact tab.
- File domains groups the changed files of a big pull request in a reading order. See Review a big pull request by domain.
- Classify gives the pull request a type and an impact for the pull request list. See Find the pull requests to handle first.
PR review has three steps. All three are off by default, so the review only comments until you turn on Push fixes:
- Check scope and duplicates says if the project wants the change, and if an open pull request does the same.
- Verify the linked issue runs a repro of the linked issue on the base and on the head.
- Push fixes pushes fixes for the findings of the review.
Keep green has three steps. When you turn the agent on, all three are on:
- Resolve merge conflicts merges the base into the head when the pull request conflicts with its base.
- Fix failing CI reproduces a failed CI run, fixes the cause and pushes the fix.
- Resolve conflicts in the merge queue runs only when the merge queue starts it, for the pull request at its front.
For example, to get a review that also pushes fixes, turn on PR review, then its step Push fixes. The pull request steps gives the order of the steps, and what each verdict means.
On an issue
| Agent | What it does | Who starts it |
|---|---|---|
| Triage | Finds duplicates, issues that are fixed already, and unclear issues | Everyone |
| Issue fix | Reproduces the issue in a sandbox. With its step Open a fix PR, it then writes a fix and a test, and opens a pull request | Authors with triage access or more, or the factory:investigate label. The fix pull request waits for the factory:fix label by default |
| Assign | Assigns up to 2 people from the Experts page and the CODEOWNERS file, each with a note that says why | Everyone, one time: when the issue shows |
The step Open a fix PR of Issue fix has three choices: Off, When labeled factory:fix (the default) or Automatically. See Reproduce and fix a bug.
The Spam agent reads each new issue and pull request. See Spam and bans.
On the default branch
| Agent | What it does | Who starts it |
|---|---|---|
| Architecture | Updates the Architecture tab of the repository after a merge that changes the architecture. See Read the architecture of a repository | A push or a merge to the default branch, or a person who clicks Generate now |
| Dependencies | Fixes the code of an update pull request whose CI fails. See Keep dependencies up to date | A failed CI run on one of its update pull requests |
| CI cache | Finds the files that each step of your CI workflows reads, and opens one pull request that adds cache to your steps. See Get a pull request that caches your CI steps | A push to the default branch that changes a workflow, or an admin who clicks Suggest caches on the CI settings page |
The Dependencies tab shows the npm dependencies of the default branch. On it, Update opens a pull request with the new versions and the lockfile installed, with no model, and CI checks it. The Dependencies agent only fixes these pull requests.
The chats
Two chats answer the questions of people. They only read, and they are on by default.
| Chat | What it does | Who starts it |
|---|---|---|
| PR chat | Answers questions about the pull request in a panel on its page, and takes the person to its files, comments and commits. See Ask an agent about a pull request | A signed-in person who can read the pull request, with a question |
| Architecture chat | Answers questions about the repository in a panel on the Architecture tab. It reads the architecture view and the code, and it can draw a diagram. See Ask an agent about the architecture | A signed-in person who can read the code, with a question |
The agents that only describe the code
Architecture and PR summary are not checks. They never hold back a pull request, and they push nothing.
| Agent or step | What it does | When it runs | Where you see it |
|---|---|---|---|
| Architecture | Writes an overview, diagrams of the repository, and what each package does and how to use it | After a push or a merge to the default branch that changes the architecture | The Architecture tab of the repository. See Read the architecture of a repository |
| PR summary, step Impact | Says if a pull request changes the architecture or the public API, and how. On by default | When a pull request opens, and on each push to it. Who starts it applies | The Impact tab of the pull request. See Read the Impact tab |
| PR summary, step File domains | Groups the changed files of a pull request into domains, with a reading order. Off by default | When a pull request opens, when it is made ready, and on each push to it. Who starts it applies | The Domains section of Files changed on the pull request. See Review a big pull request by domain |
| PR summary, step Classify | Gives each open pull request a type and an impact, each with a reason. On by default | Once for each new head, after Impact is done with it. Not on drafts or on pull requests imported from GitHub. Who starts it applies | The badges and filters of the pull request list, and About the change, the box above the Factory panel. See Find the pull requests to handle first |
Before each run of Architecture or Impact, code and Cloudflare's decision model clef-flash decide if the change needs one. A change to only docs, tests, generated files or assets starts no run.
For File domains, code alone decides: a pull request with fewer than 10 or more than 5000 changed files starts no run. Classify has no such check.
The agents read why a pull request was made
When the author of a pull request uploads the transcripts of their coding agent, the pull request agents read why it was made:
- The Security audit, every step of PR review and every step of Keep green read the intent summary and the transcripts of the author with their tools.
- The Impact step of PR summary gets the intent summary in its task.
The agents read only what the author reads on the Intent tab. They never read the transcript of a reviewer, because everyone who reads the pull request reads what an agent writes. Custom agents do not get these tools.
The agents read the memories that everyone reads
When a repository lets everyone who reads it read its agent memories, each built-in agent that works on an issue or a pull request with tools reads them too, with two read-only tools: list_memories and get_memory. So an agent knows what your team's agents learned about the repository.
While the memories are only for your team, the agents read none, because everyone who reads an issue or a pull request reads what an agent writes. An agent never saves a memory. The agents with no tools, such as Architecture and the Impact step, and custom agents do not get these tools.
How the agents write
The built-in agents, the intent summary and the chats write for people in short, plain sentences: the outcome first, one idea in each sentence, and lists of at most 5 items. Custom agents keep their own prompts.