Authentication
The Depot CLI supports token-based authentication and OIDC trust relationships for container builds. For local development, use depot login to authenticate with a user access token. For CI, we recommend using an OIDC trust relationship, but you can also use an organization token or a project token.
Tokens
Depot supports Organization, Project, User, and Pull tokens. Access depends on the token's scope and the operation:
| Service | User token | Organization token | Project token | Pull token |
|---|---|---|---|---|
| Container Builds | ✅ | ✅ | ✅ (project-scoped) | — |
| Registry | ✅ | ✅ | ✅ (project-scoped) | ✅ (read-only) |
| Depot CI | ✅ | ✅ | — | — |
| Cache | ✅ | ✅ | — | — |
| Agents | ✅ | ✅ | — | — |
| API | Some endpoints | ✅ | — | — |
The core ProjectService's getProject, updateProject, and listProjects API calls require an organization token. createProject and deleteProject also accept user tokens, subject to your permissions. The CLI's depot projects list command uses a different endpoint and accepts user tokens.
User access tokens
User access tokens are tied to your Depot account and follow your permissions in the organizations you belong to. They cannot authenticate operations that require organization tokens, including depot projects get and depot projects update. When you run depot login, Depot authenticates your account and stores a user access token on your machine that subsequent builds use by default unless you supply another token. Use user tokens only for local development, not in CI environments.
To generate a user access token:
- Go to your Account settings in the Depot dashboard.
- In the API Tokens section, enter a description for your token.
- Click Create token.
- Copy the token and save it securely. You won't be able to retrieve the value again from the dashboard.
Organization tokens
Organization tokens are scoped to a single organization. They are not tied to a user account.
To generate an organization token:
- Go to your Organization Settings page in the Depot dashboard.
- In the API Tokens section, enter a description for your token.
- Click Create token.
- Copy the token and save it securely. You won't be able to retrieve the value again from the dashboard.
Project tokens
Project tokens are scoped to a single project in your organization. They are not tied to a user account, making them ideal for CI environments where OIDC is not available.
To generate a project token:
- Go to your Projects page in the Depot dashboard.
- Click on a project to open the details page.
- Click Settings.
- Under Project Tokens, enter a token description and click Create token.
- Copy the token and save it securely. You won't be able to retrieve the value again from the dashboard.
Pull tokens
Tokens generated by depot pull-token grant temporary, read-only access to a project's images in Depot Registry. A token covers repository paths named <project-id> or beginning with <project-id>/. It doesn't cover custom repository names outside those paths. It can't push images or authenticate to other Depot services.
To pull from a repository with a custom name, such as my-app, use a registry access token with Pull permission for that repository.
Generate a pull token with the Depot CLI:
depot pull-token --project <project-id>Pull tokens expire after one hour and are not listed or manageable from the dashboard.
Token resolution
Most Depot CLI commands accept the --token flag, which lets you pass an organization, user, or project token directly. The CLI resolves tokens in the following order:
--tokenflagDEPOT_TOKENenvironment variable- Token stored locally via
depot login - OIDC token (if available)
depot projects get and depot projects update require an organization token. User tokens from depot login and project-scoped OIDC tokens do not work for these commands. Create an organization token in Organization Settings > API Tokens and pass it with --token or DEPOT_TOKEN:
depot projects get <project-id> --token <organization-token>To use the same token for subsequent commands, set DEPOT_TOKEN:
export DEPOT_TOKEN="<organization-token>"
depot projects update <project-id> --name "New project name"OIDC trust relationships
If your CI provider supports OIDC, you can authenticate with Depot through a token exchange instead of storing static secrets. Depot integrates with GitHub Actions OIDC, GitLab CI ID tokens, CircleCI OIDC, Buildkite OIDC, and RWX.
You configure a trust relationship in Depot that maps to your CI provider's identity. When a CI job runs, it requests an access token from Depot. Depot verifies the request against your configured trust relationships and, if everything matches, returns a temporary token valid only for the duration of that job.
Trust relationship tokens have the same permissions as project tokens.
Add a trust relationship for GitHub Actions
- Go to your Projects page in the Depot dashboard.
- Click on a project to open the details page.
- Click Settings.
- Under Trust Relationships, click the Add trust relationship.
- Select GitHub as the provider.
- Enter a GitHub User or Organization for the trust relationship.
- Enter the name of the GitHub repository that will build images via Depot (Note: this is the repository name, not the full URL and it must match the repository name exactly).
- Click Add trust relationship.
- In your workflow file, add a
permissionsblock to your job withid-token: writeandcontents: read.
After its first successful use, a GitHub trust relationship is tied to that repository. It keeps working if you rename or transfer the repository, and a different repository that later takes the old name can't use it.
Add a trust relationship for GitLab CI
-
Go to your Projects page in the Depot dashboard.
-
Click on a project to open the details page.
-
Click Settings.
-
Under Trust Relationships, click the Add trust relationship.
-
Select GitLab CI as the provider.
-
Enter the GitLab namespace ID for the group or user namespace that owns the project.
-
Enter the GitLab project ID.
-
Optionally select Restrict to protected refs to only allow jobs from GitLab protected refs.
-
Click Add trust relationship.
-
In your
.gitlab-ci.yml, configure a job ID token namedDEPOT_OIDC_TOKENwith the audiencehttps://depot.dev.build-image: id_tokens: DEPOT_OIDC_TOKEN: aud: https://depot.dev script: - depot build .
Add a trust relationship for CircleCI
- Go to your Projects page in the Depot dashboard.
- Click on a project to open the details page.
- Click Settings.
- Under Trust Relationships, click the Add trust relationship.
- Select CircleCI as the provider.
- Enter your CircleCI organization UUID (this is found in your CircleCI organization settings).
- Enter your CircleCI project UUID (this is found in your CircleCI project settings).
- Click Add trust relationship.
Note: CircleCI requires entering your organization and project UUID, not the friendly name of your organization or project.
Add a trust relationship for Buildkite
- Go to your Projects page in the Depot dashboard.
- Click on a project to open the details page.
- Click Settings.
- Under Trust Relationships, click the Add trust relationship.
- Select Buildkite as the provider.
- Enter the organization slug (i.e.,
buildkite.com/<org-slug>). - Enter the pipeline organization slug (i.e.,
buildkite.com/<org-slug>/<pipeline-slug>). - Click Add trust relationship.
Add a trust relationship for RWX
To learn about configuring a trust relationship between Depot and RWX, see OIDC with Depot in the RWX docs.
- Go to your Projects page in the Depot dashboard.
- Click on a project to open the details page.
- Click Settings.
- Under Trust Relationships, click the Add trust relationship.
- Select RWX as the provider.
- Enter your RWX Vault subject you configured with RWX.
- Click Add trust relationship.