> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ironbee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> IronBee (ironbee.ai) is an AI QA engineer: it verifies code changes against the running app and keeps the evidence. It is not related to the IronBee open-source web application firewall.
> The console is at https://console.ironbee.ai.
> Install the CLI with `npm install -g @ironbee-ai/cli`, sign in with `ironbee login`, and set up a project with `ironbee install`.
> In GitHub workflows, use the action as `ironbee-ai/ironbee-action@v1` and pass the `IRONBEE_API_KEY` secret as the `ironbee_api_key` input.
> In GitLab pipelines, include the component `gitlab.com/ironbee-ai/ironbee-gitlab/verify@v1`; it reads the `IRONBEE_API_KEY` CI/CD variable by default.
> In Bitbucket Pipelines, run the pipe `docker://ghcr.io/ironbee-ai/ironbee-bitbucket:v1` and pass `IRONBEE_API_KEY: $IRONBEE_API_KEY` and `BITBUCKET_OAUTH_TOKEN: $BITBUCKET_OAUTH_TOKEN` under its `variables:`.
> Console scenarios (https://docs.ironbee.ai/console/scenarios) and CLI saved scenarios (https://docs.ironbee.ai/cli/guides/scenarios) are separate features.
> For plans and prices, link to https://ironbee.ai/pricing; the website is the source of truth for them.

# Authentication

> How the CLI authenticates with IronBee: OAuth tokens for interactive use, API keys for CI and automation.

IronBee accepts two kinds of credentials, and the CLI picks the right one for you:

* **OAuth access token:** the default for interactive use. `ironbee login` mints a personal token tied to your user and account. Each token is individually named and revocable.
* **API key:** an account-scoped key for machine-to-machine (M2M) use, such as the [GitHub Action](https://docs.ironbee.ai/github-action/get-started/getting-started.md), the [GitLab component](https://docs.ironbee.ai/gitlab-component/get-started/getting-started.md), the [Bitbucket Pipe](https://docs.ironbee.ai/bitbucket-pipe/get-started/getting-started.md) or any CI pipeline where no browser is available.

Both are first-class and supported. The difference is who they identify: an OAuth token is *you*, an API key is *the account*.

***

## OAuth tokens (default)

Running [`ironbee login`](https://docs.ironbee.ai/cli/get-started/getting-started#step-3-sign-in) opens **Connect CLI** in your browser, where the console authorizes the CLI for your current account once you're signed in, and writes a personal access token to `~/.ironbee/config.json` under [`service.oauthToken`](https://docs.ironbee.ai/cli/configuration/configuration#service-identity) (older CLI versions wrote `collector.oauthToken`, which is still read as a fallback). It also persists `service.domain` - the stage you authenticated against - so the collector, API, and Console URLs all derive from one place (and any hand-set explicit URLs are dropped so they re-derive; pin the Console with `--console-url` if you need to). For a self-hosted deployment on non-standard hosts, no domain is inferred and the explicit URLs are kept instead. From then on the CLI authenticates as you, everywhere: event delivery to the Collector **and** the read-side API behind [`ironbee verify`](https://docs.ironbee.ai/cli/guides/verification-jobs).

```bash theme={null}
ironbee login
```

The login flow waits up to five minutes for the browser to finish, including signing in if you need to; press `Ctrl+C` to cancel. By default the token is named after your machine's hostname so you can recognize it later in the Console and pass `--name` to set your own label:

```bash theme={null}
ironbee login --name "work-laptop"
```

For a self-hosted or non-production collector, pass its base URL with `--collector-url`; events are sent to `{url}/v1/events`. If the console answers the login with a shared account API key instead of a personal token, `ironbee login` stores it as `service.apiKey`.

Each token appears on the [OAuth Tokens page](https://docs.ironbee.ai/console/access-tokens.md) in the Console, where you can see when it was created, when it expires, and revoke it. CLI-minted tokens default to a 90-day lifetime.

### Token limit

You can hold at most **10 OAuth access tokens** per account at a time. This count includes expired tokens that you have not yet removed.

If you are already at the limit, `ironbee login` cannot mint a new one and prints:

```
You already have the maximum of 10 access tokens, so a new one could not be issued for the CLI. Revoke one on the IronBee Console's API Tokens page, then run "ironbee login" again
```

To free a slot, open the [OAuth Tokens page](https://docs.ironbee.ai/console/access-tokens.md), revoke a token you no longer use, then run `ironbee login` again.

***

## API keys (CI and automation)

For automation that runs without a browser, such as CI jobs, scheduled jobs and scripts, use an account API key instead. The [GitHub Action](https://docs.ironbee.ai/github-action/get-started/getting-started.md) and the [GitLab component](https://docs.ironbee.ai/gitlab-component/get-started/getting-started.md) take it as their `ironbee_api_key` input, and the [Bitbucket Pipe](https://docs.ironbee.ai/bitbucket-pipe/get-started/getting-started.md) as its `IRONBEE_API_KEY` variable. Supply it through the `IRONBEE_SERVICE_API_KEY` environment variable (the legacy `IRONBEE_API_KEY` still works) so it never lands in a committed file:

```bash theme={null}
export IRONBEE_SERVICE_API_KEY=<your-account-api-key>
```

The CLI reads it into [`service.apiKey`](https://docs.ironbee.ai/cli/configuration/configuration#service-identity). You can also set it on disk with `ironbee config set service.apiKey <key> --global`, but the environment variable is preferred for CI because it [overrides every config layer](https://docs.ironbee.ai/cli/configuration/environment-variables.md).

A credential never goes in a file inside the checkout: `ironbee config set` refuses it on the project and local layers. Keep it in the global config or in the environment. The repository's [personal file](https://docs.ironbee.ai/cli/configuration/configuration.md#the-personal-file) (`--personal`) can hold one too, but only `ironbee review` and `ironbee credits` read it: `ironbee verify` and your sessions' event delivery don't.

Find and manage the account API key on the [Account page](https://docs.ironbee.ai/console/account.md) in the Console. Owners and admins can view, copy, and rotate it.

### Rotation and the grace window

Rotating the API key on the [Account page](https://docs.ironbee.ai/console/account.md) generates a fresh key and keeps the **previous key valid for 24 hours** for a grace window so your CI and integrations keep working while you roll the new key out. Only one grace key exists at a time:

* Rotating again while a grace key is still active permanently disables the earlier grace key (the Console asks you to confirm first).
* Use **Deactivate now** on the Account page to end the grace window immediately.

***

## Which credential the CLI uses

If both are present, the OAuth token takes priority on the wire. In practice:

| Situation | Credential | How to set it |
| - | - | - |
| You, working locally | OAuth token | `ironbee login` |
| GitHub Action | API key | `IRONBEE_API_KEY` repository secret, passed as the `ironbee_api_key` input |
| GitLab component | API key | `IRONBEE_API_KEY` masked CI/CD variable, which the `ironbee_api_key` input reads by default |
| Bitbucket Pipe | API key | `IRONBEE_API_KEY` secured repository variable, passed under the pipe's `variables:` as `IRONBEE_API_KEY: $IRONBEE_API_KEY` |
| Other CI | API key | `IRONBEE_SERVICE_API_KEY` secret |
| Scripted or headless machine | API key | `IRONBEE_SERVICE_API_KEY` or `service.apiKey` |

Both `IRONBEE_SERVICE_OAUTH_TOKEN` and `IRONBEE_SERVICE_API_KEY` override whatever is on disk, so a CI runner can supply a credential without touching `~/.ironbee/config.json`. The legacy `IRONBEE_OAUTH_TOKEN` / `IRONBEE_API_KEY` forms fill only the deprecated `collector.*` fallback keys - they're used **only when the matching `service.*` key is unset** (except by [`ironbee verify`](https://docs.ironbee.ai/cli/guides/verification-jobs#credentials), `ironbee review` and `ironbee credits`, which treat `IRONBEE_API_KEY` as a high-priority override, although an OAuth token from any source still wins over it), so on a machine that has run a recent `ironbee login` (which writes `service.oauthToken`) prefer the `IRONBEE_SERVICE_*` forms. See [Environment variables](https://docs.ironbee.ai/cli/configuration/environment-variables.md) for precedence details.

[`ironbee review`](https://docs.ironbee.ai/cli/guides/code-review) and [`ironbee credits`](https://docs.ironbee.ai/cli/guides/credits) pick the credential in the [same order](https://docs.ironbee.ai/cli/guides/verification-jobs.md#credentials) as `ironbee verify`, `IRONBEE_ACCESS_TOKEN` included, but read it only from the flags, the environment, the repository's personal file and the global config.

***

## What's next?

> [card] [OAuth Tokens in the Console](https://docs.ironbee.ai/console/access-tokens.md)
>
> Create, name, and revoke your personal OAuth access tokens.

> [card] [Account API key](https://docs.ironbee.ai/console/account.md)
>
> View and rotate the shared account key used for CI.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.