# A token for every agent

> Give each agent its own token, scoped to what it needs. Every call it makes is written to the audit log, and you can revoke it at any time.

## Create a token

Tokens belong to your organisation and are created by an owner or admin. Name it after the agent that will use it. The secret is shown once.

```sh
$ 00b5e2 tokens create deploy-bot --scope deploy,logs:read --expires 90d
token created: deploy-bot
00b5e2_tk_7f3a...c91e  (shown once, store it now)
```

_Agents connected through MCP get their own token when they first log in._

## Scopes

A token can do only what its scopes allow, only in the projects you choose. Production deploys need their own scope.

| scope | allows |
| --- | --- |
| `read` | list projects, services, deploys and settings |
| `deploy` | deploy to development and previews, manage services and cron jobs |
| `deploy:prod` | deploy to production |
| `env` | read and set variables |
| `logs:read` | read logs and metrics |
| `db` | create, back up and restore databases |
| `domains` | add and verify domains |

> Start with the smallest scope that works. A token never has more access than the person who created it.

## Use it

On a machine without a browser, log the CLI in with the token. For MCP clients, send it as a bearer token to mcp.00b5e2.com.

```sh
$ 00b5e2 login --token 00b5e2_tk_7f3a...c91e
$ 00b5e2 whoami --json
{"token":"deploy-bot","org":"reservations","scopes":["deploy","logs:read"]}
```

## Audit log

Every action taken with a token is recorded: who, what, where and when, in UTC. Read it in the console under organisation, audit, or from the terminal.

```sh
$ 00b5e2 audit --token deploy-bot --since 7d --json
```

## Revoke

Revoking is immediate. Calls in flight finish, new ones are refused.

```sh
$ 00b5e2 tokens revoke deploy-bot
token revoked: deploy-bot
```

Previous: [MCP](https://docs.00b5e2.com/mcp.md)
Next: [For agents](https://docs.00b5e2.com/for-agents.md)
