# Safety scope

The opt-in gate that decides which issues Factory is allowed to touch.

Rendered page: https://agentrelay.com/docs/factory/safety-scope
Markdown endpoint: https://agentrelay.com/docs/factory/markdown/safety-scope.md

---

Factory only works on issues you have explicitly marked for it. Everything else is ignored — not queued, not deferred, ignored.

Read this before running it for real. The gate is the main guardrail, so loosen it deliberately.

## The three gates

All must pass:

| Gate | Default | What it checks |
| --- | --- | --- |
| `safety.requireTitlePrefix` | `[factory-e2e]` | Issue title starts with this |
| `safety.requireLabel` | `factory` | Issue carries this label |
| `safety.requireTeamKey` | `AR` | Issue belongs to this team |

> `[factory-e2e]` is reserved for Factory's own self-test soak — those PRs auto-close. For real work you want to keep, set the prefix to `[factory]`.

## How an issue enters

Depends on your `issueSource`:

| Source | What you do |
| --- | --- |
| **Linear** | Title it `[factory] <task>`, set the team and a repo label, move it to **Ready for Agent** |
| **GitHub native** | Add the readiness label (`factory`) and a repo route label to an open issue |
| **GitHub mirror** | Add `factory` to a GitHub issue — it's mirrored into a `[factory]` Linear issue, then dispatched through the Linear flow |

Pulled issues but dispatched none? That's the gate doing its job.

The readiness label admits an issue; it is not a repository route. See [Issue labels and repository routing](/docs/factory/issue-routing) before assigning labels in a multi-repository setup.

## Nothing merges by itself

`mergePolicy` is `never` by default. Factory opens real pull requests and stops there.

Set `on-green-with-review` and it will merge — but only once CI is green *and* the PR has been reviewed. Even with babysitter mode shepherding a PR to green, final review and merge stay with a human.

## Where issues land

`terminalState` decides where an issue goes when Factory is finished:

- `human-review` (default) — someone signs off.
- `done` — Factory closes it out.

Start with `human-review`. Move to `done` per-team once you trust the output.
