Skip to content
Source
Sign inSign up

What each agent does

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

AgentIts job
Security auditReads each pull request for malware, prompt injection, secret theft and hidden code
SpamCloses spam, and bans accounts or suggests bans
PR reviewReviews each pull request
Keep greenKeeps pull requests ready to merge
PR summaryExplains each pull request on its page
TriageFinds duplicate, fixed and unclear issues
AssignAssigns up to 2 experts to each new issue and pull request
Issue fixReproduces an issue, then can open a fix pull request
DependenciesFixes the code of a dependency update pull request whose CI fails
ArchitectureKeeps the Architecture tab of the repository up to date
CI cacheOpens 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.

AgentWhat it doesWho starts it
Security auditLooks for malware, prompt injection, secret theft and hidden codeEveryone
PR summaryExplains the pull request on its page, with its steps belowEveryone
PR reviewPosts a review with line comments, then runs its steps belowEveryone. Push fixes runs after a review with findings, and after a clean audit
Keep greenKeeps the pull request ready to merge, with its steps belowEveryone, when the pull request conflicts or a CI run of the head fails. For an author without write access, only after a clean audit
AssignAssigns 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 expertEveryone, 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:

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

AgentWhat it doesWho starts it
TriageFinds duplicates, issues that are fixed already, and unclear issuesEveryone
Issue fixReproduces the issue in a sandbox. With its step Open a fix PR, it then writes a fix and a test, and opens a pull requestAuthors with triage access or more, or the factory:investigate label. The fix pull request waits for the factory:fix label by default
AssignAssigns up to 2 people from the Experts page and the CODEOWNERS file, each with a note that says whyEveryone, 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

AgentWhat it doesWho starts it
ArchitectureUpdates the Architecture tab of the repository after a merge that changes the architecture. See Read the architecture of a repositoryA push or a merge to the default branch, or a person who clicks Generate now
DependenciesFixes the code of an update pull request whose CI fails. See Keep dependencies up to dateA failed CI run on one of its update pull requests
CI cacheFinds 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 stepsA 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.

ChatWhat it doesWho starts it
PR chatAnswers 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 requestA signed-in person who can read the pull request, with a question
Architecture chatAnswers 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 architectureA 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 stepWhat it doesWhen it runsWhere you see it
ArchitectureWrites an overview, diagrams of the repository, and what each package does and how to use itAfter a push or a merge to the default branch that changes the architectureThe Architecture tab of the repository. See Read the architecture of a repository
PR summary, step ImpactSays if a pull request changes the architecture or the public API, and how. On by defaultWhen a pull request opens, and on each push to it. Who starts it appliesThe Impact tab of the pull request. See Read the Impact tab
PR summary, step File domainsGroups the changed files of a pull request into domains, with a reading order. Off by defaultWhen a pull request opens, when it is made ready, and on each push to it. Who starts it appliesThe Domains section of Files changed on the pull request. See Review a big pull request by domain
PR summary, step ClassifyGives each open pull request a type and an impact, each with a reason. On by defaultOnce for each new head, after Impact is done with it. Not on drafts or on pull requests imported from GitHub. Who starts it appliesThe 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.