# Deploy access

> Choose who can deploy in your organization, refuse deploys from everyone else, and make your CI pipeline the only way a change goes live.

By default, anyone with write access to a workspace can run `helix deploy` there. **Limit who can deploy** is an organization-wide switch that changes this: when it's on, only the people and API users on one list can deploy, and everyone else is refused, including owners and admins. Use it to make your CI pipeline the only way a change reaches production.

:::note{title="Availability"}
If you're the organization owner or an admin and Organization settings has no **Deploy access** page under **Deployments**, or the page says "Deploy access isn't available for your organization yet.", this isn't turned on for your organization. Ask your Tray contact.
:::

## How it works

You manage one list for the whole organization. It holds up to 500 people and API users, and you add either from the same search.

- **Everyone not on the list is refused** when they deploy, before anything is built. That includes the organization owner and admins. They aren't exempt, and they aren't added to the list for you.
- **Being on the list isn't enough on its own.** A listed person or API user still needs write access to the workspace they deploy to, so the Contributor role or higher.
- **The list can be prepared while the switch is off.** Nothing changes for anyone until you turn it on.
- **It fails closed.** If everyone on the list leaves the organization or is deleted, the switch stays on and nobody can deploy. The page says so. See [If nobody can deploy](#if-nobody-can-deploy).

Only the organization owner and admins can see or change this page. Anyone else who opens it is sent to **Members**.

## What still works

The switch decides who can run `helix deploy`. These stay as they were:

| Still allowed | Who |
|---|---|
| Restoring an earlier deployment from the Deployments tab | Anyone with write access to the workspace |
| Creating a project | Anyone who could before |
| Changing a project's settings, authentications, and access in the dashboard | Anyone who could before |

[Deployment approvals](/documentation/governance/deployment-approvals/) are separate and unchanged. A deploy from someone on the list still waits for approval if your approval policy says so. A deployment that was already waiting when you turned the switch on can still be approved, so deny any you don't want first.

## Make CI the only way to deploy

This sets up a pipeline as the only deployer. Do the steps in this order, so the pipeline can deploy the moment the switch is on.

1. **Create an API user for CI.** Open the user menu, choose **Organization settings**, then **API users** under **Tokens**, and create the API user and its token as described in [API users](/documentation/governance/api-users/). Choose the **Contributor** workspace role, which is the default.
2. **Don't give it the Owner or Admin organization role.** Owners and admins can change this list. A leaked CI token with that role could add anyone to it, and the policy would stop protecting you.
3. **Add it to the list.** Under **Deployments**, choose **Deploy access**, then **Add deployers**. Pick the API user under **API users** and choose **Add**. Add the people who should still be able to deploy by hand, if any. An API user belongs to one workspace, so if your pipeline deploys to more than one workspace, create and list one API user for each.
4. **Turn on Limit who can deploy.** The confirmation, **Limit who can deploy?**, says how many deployers on the list will be able to deploy and that owners and admins need to be on it too. If you aren't on the list, it says you won't be able to deploy either. Choose **Turn on**.
5. **Generate the pipeline.** In the project, run `helix ci init`. With CLI 1.31.0 or later, it offers to create the project when the config has no `projectId`, so the first deploy runs in CI and nobody has to deploy from a laptop first. Pass `--create-project` to skip the question, which you also need without a terminal.
6. **Save the token.** Add the API user's token as a secret named `TRAY_CLI_TOKEN` in a GitHub environment limited to your default branch, so only merged code can use it. If you chose the third option when you ran `helix ci init`, save a token in each of its two environments, from an API user in that environment's workspace. [Deploy from CI](/documentation/guides/continuous-deployment/) covers the token and the workflow in general. For an organization that only allows listed deployers, use the environment described here, and let CI make the first deploy.
7. **Commit and push.** Commit the workflow and the config files that now hold the project id, which the command lists when it finishes, and push. With **Deploy production on merge**, the push deploys the project. With the default, **Manual production deploys**, run the workflow from the Actions tab. With the third option, which deploys a second target on every merge, a push deploys that target and production runs on demand. [Deploy from CI](/documentation/guides/continuous-deployment/) describes all three.

:::warning{title="Anyone who can create a token for a listed API user can deploy"}
The list names the API user, not the token. Whoever can create a token for a listed API user can deploy with it. Keep that API user's tokens in your CI secret store, give it no more access than it needs, and revoke a token if it's exposed.
:::

## One review gate

If your team reviews changes in Helix, the recommended setup is CI-only deploys plus [deployment approvals](/documentation/governance/deployment-approvals/) on every deployment, with no required review in GitHub. CI deploys then wait for an approver, and the pipeline is the only way to start one. GitHub keeps the history of the change, and Helix is where someone approves it going live, so each review happens once. For the same reason, leave your GitHub environments without required reviewers. `helix ci init` suggests them for the third option, which sets up two environments, but with Helix approvals on, a deploy could need two approvals, one in GitHub and one in Helix.

## Manage the list

On **Deploy access**, the switch sits above the list.

- **Add deployers** opens a search over the organization's people and API users. Switch between **API users**, shown first, and **People**, pick as many as you need, and choose **Add**.
- **Search the list** filters what's on it, and **All**, **People** and **API users** narrow it by kind. People show their email, and API users show the workspace they belong to.
- **To remove a deployer**, open the **…** menu on their row and choose **Remove from list**.
- **The switch needs at least one deployer.** Until you add one, it's off and says "Add at least one deployer to turn this on."
- **You can't remove the last deployer while the switch is on.** Its **Remove from list** is unavailable, with a note to turn off **Limit who can deploy** first. Turn it off, or add the next deployer before you remove the old one.
- **Someone who has left the organization** stays on the list, marked **No longer in the organization**, and can't deploy. Remove them like any other deployer, unless the switch is on and nobody else on the list can deploy. Then add a deployer or turn the switch off first.
- **If you aren't on the list**, a note under the switch says so. While the switch is off, it says you won't be able to deploy once it's on. While it's on, it says you can't deploy. Either way you can still change the setting.
- **If someone else saves at the same moment**, you see "Someone else just changed who can deploy. The page now shows their changes." Check the list and make your change again.

Turning the switch off lets anyone with write access deploy again. The list is kept.

## When a deploy is refused

A person or API user who isn't on the list gets this from `helix deploy`, and the command exits with code 1:

```text
Deploy failed [DeployerNotAllowed]: Your organization only accepts deploys from its allowed deployers, and you aren't one. Deploy through your CI pipeline, or ask an Owner or Admin to add you (Organization settings → Who can deploy). Restores still work.

Hint: only your organization's allowed deployers can deploy. This is its policy, not a login problem, so don't retry with another token or `TRAY_CLI_TOKEN`. Ship through your CI pipeline instead: commit and push your change, or run `helix ci init` if this app has no pipeline yet. A coding agent should stop here and tell the user.
```

The message names nobody, and it isn't a login problem, so signing in again doesn't help. This is the output of CLI 1.31.3 or later. CLI 1.31.1 and 1.31.2 print a shorter `Hint:` line, 1.29.1 to 1.31.0 print no hint, and CLIs older than 1.29.1 print the raw `HTTP 403` response instead. In the message, "Who can deploy" is the **Deploy access** page.

A person who's refused can push their change so the pipeline deploys it, or ask an owner or admin to add them to the list. A pipeline whose deploy is refused is missing from the list: add its API user.

## If nobody can deploy

When the switch is on and nobody on the list can deploy any more, **Deploy access** shows "Nobody can deploy. Add a deployer or turn this off." This happens when every person on the list has left the organization and every listed API user has been deleted. While anyone on the list can still deploy, the banner doesn't appear. Add a deployer, or turn the switch off to let anyone with write access deploy again.

## Limits

- One list for the whole organization, up to 500 entries. There are no separate lists per workspace.
- The check applies to `helix deploy`. It doesn't restrict restores, creating projects, or dashboard changes.

---

Canonical: https://helix.tray.ai/documentation/governance/deploy-access/
Any link on this page is available as markdown by appending .md to its URL.
Full corpus: https://helix.tray.ai/documentation/llms-full.txt