# Keys, teams and roles

**Last updated:** 2026-11-27T11:44:16-03:00 (UTC-3)

The gateway separates two things:

- **Who calls the API:** applications, with **virtual keys** (the data plane).
- **Who administers:** people, with **console users** and roles (the control plane).

A key never grants a console role, and a console role never allows inference without a key. A flag turns a feature on, but **never grants permission**: when in doubt, the gateway denies.

## Virtual keys

Each application gets its own key, with a team, allowed models, route scopes and an optional expiration. Omission/null means Never; no default policy imposes a deadline. Flag: `identity_management`.

**In the console:** **Virtual keys**, via the create key button. The secret is shown only once.

**Through the API:** `POST /api/v1/admin/keys`:

| Field | Rule |
| --- | --- |
| `alias` | Display name, 2 to 128 characters |
| `kind` | `virtual` or `service_account` |
| `principal` | Who uses the key (application, service), 2 to 128 characters |
| `team` | Team ID |
| `allowed_models` | 1 to 100 aliases, groups (`group:<id>`) or `*` |
| `scopes` | 1 to 16 scopes: `route:chat`, `route:embeddings`, ... or `route:*`; `mcp:read` and `mcp:execute` for [MCP](/docs/features/mcp-execution/); `traces:write` to upload a coding agent's transcript with `POST /v1/traces` ([transcript ingest](/docs/features/agent-recognition/#transcript-ingest)) or an application's spans ([OTLP ingest](/docs/features/otlp-ingest/)); `traces:read`, `evaluations:read`, `evaluators:read`, `evaluators:write`, `reviews:read` and `reviews:write` for the [public trace API](/docs/features/public-trace-api/) |
| `expires_at` / `expires_in` | Optional absolute UTC date or positive duration, mutually exclusive; omitted/null means Never |
| `tags` | Optional static key metadata under `key_metadata_tags`; separate from request tags |
| `owner` | Optional: the key's [owner](/docs/features/identity-ownership/) |

Keys can also be declared in YAML, with the SHA-256 hash of the secret in an environment variable:

```yaml
keys:
  - id: local-app
    principal: example-app
    team: platform
    kind: service_account
    sha256_env: GATEWAY_CLIENT_KEY_SHA256
    allowed_models: [chat-default]
    scopes: ["route:*"]
```

| Key | What it does |
| --- | --- |
| `keys[].id` | Unique key ID, used in logs, policies and the console; it is not the secret |
| `keys[].principal` | Who uses the key, such as an application name, recorded with each request |
| `keys[].team` | The team the key belongs to |
| `keys[].kind` | Required: `virtual` (an application key) or `service_account` |
| `keys[].allowed_models` | Aliases, `group:<id>` references or `*` the key may call |
| `keys[].scopes` | Routes and MCP scopes the key may use |
| `keys[].owner.kind` | `user` or `workload`: who answers for the key ([owners](/docs/features/identity-ownership/)) |
| `keys[].owner.id` | The `usr_…` user ID or workload ID of that owner |
| `keys[].sha256_env` | Name of the variable (or Secret key) that holds the hex SHA-256 of the key's secret, read at startup; the usual way to declare a key |
| `keys[].sha256` | The hex SHA-256 itself, written in the YAML; a digest is not the secret, but prefer `sha256_env` so rotating it does not change the file. If both are set they must be equal |

Every YAML key needs exactly one 64-character digest. `gateway keygen` ([CLI](/docs/reference/cli/)) prints a new token and its digest.

See [key expiry and policy](/docs/features/key-policy/) for the choices, optional governance, static tags and secret-free notifications.

The gateway stores only the hash. Revoking a key denies the next request on every replica; `key_deletion` also removes it from the inventory. To change the secret without downtime, see [rotation](/docs/features/key-rotation/); to authenticate with your IdP's token, see [inference JWT](/docs/features/jwt-inference/).

## Teams and team policy

A team groups keys and sets their **ceiling**. Flags: `team_management` (create and rename teams), `team_policy_enforcement` (enforce the ceiling) and `team_policy_management` (edit the ceiling in the console). With `team_deletion`, which requires `team_management`, a global admin deletes a console team, and every key of the team is revoked in the same change.

```yaml
team_policies:
  - team: platform
    allowed_models: [chat-default, group:embeddings]
    scopes: ["route:chat", "route:embeddings"]
```

| Key | What it does |
| --- | --- |
| `team_policies[].team` | The team the ceiling applies to, by its ID |
| `team_policies[].allowed_models` | Aliases and `group:<id>` references the team's keys may ever use; an empty list denies every model |
| `team_policies[].scopes` | Route and MCP scopes the team's keys may ever hold; an empty list denies them all |

What a key can do is the **intersection** of the key, the team policy and the [organization](/docs/features/organizations/) ceiling. Where one side names a `prefix/*` alias (or the key `*`) and the other a model under it, the narrower entry is kept, at the team and at the organization alike. The ceiling is checked on every request: removing a model from the team denies the next call from every key in it.

With `team_policy_enforcement`, creating a key is held to the same rule for every role, administrators included:

- **Team without a policy:** a key for it is refused with `403 team_policy_required`, because such a team allows nothing yet.
- **Model or route outside the ceiling:** naming one the team's ceiling would remove is refused with `403 outside_team_policy`, and the message lists what is outside.
- **Wildcards:** `*` and wildcard entries (`groq/*`, `route:*`) stay allowed. They mean "whatever the team allows".
- **Console:** **Virtual keys → Create key** offers only the models the chosen team allows.
- **Ceiling narrowed later:** a call to a model the key still names is refused with `403 model_forbidden` "Model is outside the team policy of this key", rather than blaming the key.
- **[Model aliases](/docs/features/model-aliases/)** (`model_aliases`): a key, team policy, organization ceiling or group that names a canonical model also covers its `alias_of` aliases; one that names only an alias covers only the alias, never the canonical model. A [moving alias](/docs/features/model-aliases/#moving-aliases-follows) (`follows`, `model_follows`) is covered only by its own name, `*` or a `prefix/*` entry: granting the model it currently resolves to does not grant it, so a change of resolution never changes who may call what.

## Access groups

A group is a reusable set of models, referenced as `group:<id>` in keys, team policies and organizations. Adding a model to the group makes it available to everyone who references the group. Flags: `access_groups` and `access_group_management` (edit in the console).

```yaml
access_groups:
  - id: embeddings
    name: Embeddings
    models: [embeddings-small, embeddings-large]
    mcp_servers: [docs]     # optional
```

| Key | Default | What it does |
| --- | --- | --- |
| `access_groups[].id` | required | Unique identifier; keys and policies reference it as `group:<id>` |
| `access_groups[].name` | required | Display name, 2–128 bytes of UTF-8 on one line |
| `access_groups[].description` | empty | Up to 512 bytes of UTF-8, shown in the console |
| `access_groups[].models` | `[]` | Up to 100 existing model aliases, listed explicitly (no `*`, no nested group); a group needs at least one model or MCP server |
| `access_groups[].mcp_servers` | `[]` | Up to 100 registry MCP servers the group grants, when the server also requires `group:<id>`; a group needs at least one model or MCP server |
| `access_groups[].mcp_tools` | `[]` | Up to 200 `server/tool` references that narrow a listed server to those tools |
| `access_groups[].disabled` | `false` | Keeps the group without granting anything through it |

There are at most 200 groups.

- The group is expanded **before** the team policy and never exceeds it.
- A group grants an MCP server only if the server requires `group:<id>` in its scopes and the team policy also references the group.

## Request limits (RPM)

With `rate_limits`, requests-per-minute policies per key or per team, shared across replicas. With `end_user_rate_limits`, also per end user of your app (`X-Gateway-End-User` header), within a team. A request without the header is not counted per end user; to refuse such requests, require the header on the team or key ([required attribution](/docs/features/budgets-and-tpm/#require-the-end-user-and-tags)).

```yaml
rate_policies:
  - {id: app-rpm, subject: key, subject_id: local-app, rpm: 600}
  - {id: time-rpm, subject: team, subject_id: platform, rpm: 3000}
```

The checks a [moderation guardrail](/docs/features/guardrails/#moderation-model) makes are the gateway's own calls and are not counted here, on input or on the answer, enforcing or monitor; the guarded request is counted once, like any request, and over its limit it answers `429 rate_limit_exceeded` before any guardrail runs. So a check is never refused for RPM: with `rpm: 1`, one guarded request a minute is served with its checks, and neither `on_error: block` (`503 guardrail_unavailable`) nor `on_error: allow` (an unchecked request) can result from the caller's RPM. A client calling `/v1/moderations` directly, and the gateway's other in-process calls, are counted as before.

For limits in tokens and dollars, see [budgets and TPM](/docs/features/budgets-and-tpm/).

## Concurrent requests per key and team

An RPM ceiling counts requests as they start; it does not stop one key from holding dozens of slow streams open at once. A **concurrency cap** limits how many inference requests a key, or all the keys of a team together, have **in flight at the same time**. A request holds its slot from admission until its answer ends: the whole response, a stream to its last event, a provider error, or the client going away.

### How to turn it on

```yaml
features:
  concurrency_limits: true   # off by default; enforces every max_concurrent
rate_policies:
  - {id: app-parallel, subject: key, subject_id: local-app, max_concurrent: 8}
  - {id: platform-parallel, subject: team, subject_id: platform, max_concurrent: 40}
  - {id: batch-both, subject: key, subject_id: batch-worker, rpm: 600, max_concurrent: 4}
```

`concurrency_limits` is the catalog flag (operator control, default `false`). It does not need `rate_limits` or PostgreSQL: the counters live in memory. With the flag off, `max_concurrent` is kept and shown as staged, and nothing is refused.

| Field | Default | Bounds and meaning |
| --- | --- | --- |
| `max_concurrent` | `0` (no cap) | 0–100000. Inference requests of the subject in flight at once **in each replica**. Only `key` and `team` subjects; an `end_user` policy with `max_concurrent` is refused at validation. |
| `rpm` | — | 0–1000000. With `max_concurrent`, `rpm` can be `0`, meaning no per-minute ceiling. A policy needs `rpm` or `max_concurrent` (or both) of at least 1. |

A key is counted by its own key policies and by the team policies of its team. Every cap that counts a request must have room: a key under its own cap is still refused when its team is full, and a refused request takes no slot of any cap. Two policies on the same subject are two separate caps.

### What the client sees

Over a cap, the request is refused at once, before the per-minute counter, quota reservation, guardrails, routing and any provider call:

```http
HTTP/1.1 429 Too Many Requests
Retry-After: 1
Content-Type: application/json

{"error":{"code":"concurrency_limit_exceeded","message":"Too many concurrent requests for this team; retry when one finishes"}}
```

The message says whether the **key** or the **team** cap is full, never the policy ID or another key. There is no queue: a slot frees when one of the subject's requests ends, so retry after a short wait. A refused request does not count against the RPM ceiling.

### Which requests take a slot

- **Every request admitted under an inference route scope** (`route:<capability>` other than `route:models`): the same requests rate policies count, from chat completions and Responses to embeddings, audio, images, video, OCR, token counting, fine-tuning and the stored-response, conversation and container routes. A **realtime session** holds one slot for its whole life, like a stream.
- **Once per request.** A semantic fallback runs inside the client's request and uses its slot: a key with `max_concurrent: 1` still gets its fallback answer.
- **Vector stores:** the vector store routes are not inference routes, but the embedding and OCR calls a file upload, file batch or search makes with the client's key are, and each takes a slot while it runs (one at a time per vector store request). At the cap, the vector store request answers the same `429 concurrency_limit_exceeded` with `Retry-After`; in a file batch (or a vector store created with `file_ids`) the refusal is reported per file, as `concurrency_limit_exceeded` in the batch's failed files, like any other per-file error.
- **Not counted:** the gateway's own in-process calls (provider guardrails, semantic cache embeddings, routing classifiers, evaluations, m7 ai, batch lines). `GET /v1/models`, MCP, agents, files and batches are not inference routes. A Response created with `background: true` runs at the provider; it holds a slot only while the `POST /v1/responses` that creates it is answered, and each later retrieval is a request of its own.

### Per replica

The count is per process, like the [destination limits](/docs/features/routing-and-admission/) and the instance admission limit: replicas do not share it. With N replicas behind a load balancer, a key can have up to **N × `max_concurrent`** requests in flight. Size the cap for one replica, or divide the total you want by the replica count. A restart or rollout starts each new process at zero.

Lowering a cap does not cut requests already in flight; new requests are refused until the count drops below the new value. Editing or disabling a policy applies to the next request.

### Console, API and metrics

- **Console:** **Rate policies → Add policy / Edit** has **Concurrent requests per replica**; `Requests per minute` accepts 0 when a cap is set. Each card shows the cap and what the replica answering the console holds of it.
- **API:** `max_concurrent` in the policy of `PUT /api/v1/admin/rate-policies/{id}` (requires `rate_policy_management`). `GET /api/v1/admin/rate-policies/status` answers with `rate_limits` or `concurrency_limits` and adds a `concurrency` block with `scope: process`, the answering replica's `process_instance_id` and, per active cap, `id`, `max_concurrent` and `in_flight`.
- **Metrics:** with `metrics_endpoint` and `concurrency_limits`, `/metrics` publishes `gateway_caller_concurrency_in_flight{subject="key"|"team"}` (slots held in this process; a request counted by a key and a team cap holds one of each) and `gateway_caller_concurrency_admission_total{result="admitted"|"refused"}` (decisions for requests that met at least one cap). No key, team or policy ID is a label.

### Upgrade notes

No migration: managed policies store `max_concurrent` in the same JSON document as the rest of the policy, and existing policies keep `rpm` as before. **During a rolling upgrade, do not save a policy with `max_concurrent` or `rpm: 0` until every replica runs this version:** an older replica refuses the whole control snapshot once it holds an `rpm: 0` policy (it keeps its last valid snapshot and stops applying later changes), and silently ignores `max_concurrent` on the others. Policies with `rpm: 0` are new; a gateway older than this version refuses them at validation (and a YAML `max_concurrent` key as unknown), so before rolling back remove those policies and keys.

## Console users and roles

With `console_users`, each person has a named, revocable user. The bootstrap admin token still exists for recovery.

| Role | Sees | Can change |
| --- | --- | --- |
| `admin` | Everything | Identities, governance and operations |
| `viewer` | Everything except named users, prompt content and admin-only policies | Nothing |
| `operator` | Operational configuration: catalog, models, providers, MCP, RPM, circuit breaker, cache | Providers, aliases, MCP inventory, RPM, circuit breaker and cache purge |
| `team_admin` | Only their own teams | Keys of their own teams, within the team policy |
| `team_viewer` | Only their own teams | Nothing |
| `user` | Only their own teams (1 to 20) | Nothing |

Flags:
- `operator` and `user` require `granular_rbac` (which requires `console_users`); `user` also requires `team_scoped_console`.
- `team_admin` requires `team_admin_console`.
- With `membership_roles`, each association of a `team_admin` with a team is `admin` (manages keys) or `member` (read only).

Caveats:
- **`operator` changes routing and provider credentials**: it is a trusted role, not a "look only" role. It does not issue keys, manage people or change flags, and it does not read logs, analytics or audit.
- **`team_admin`** does not create keys with `*` in models, `route:*`, `mcp:read` or `mcp:execute`, and does not assign owners.
- Prompt content and history are closed to `viewer` and `operator`. Team members can read them with `prompt_scoped_read` (see [prompts](/docs/features/prompt-registry/)); render and write are admin-only.

### Invitations and import

With `user_invitations`, the global admin invites people with a single-use link that expires; whoever accepts receives their own credential and joins with the invitation's role and teams, checked at that moment. Bulk import, which needs `user_bulk_management`, previews a list of people and then sends them as invitations with a result per row; it and invitation revocation are global admin actions. With `invitation_email`, the link can be [sent by e-mail](/docs/features/invitation-email/), and with console SSO an invitation only pre-provisions the user, who signs in through SSO.

To provision from your IdP, see [SCIM](/docs/features/scim/); for corporate login, [SSO](/docs/features/oidc/).

## How authorization works

- Every console route requires a resource-and-action permission (`providers:manage`, `keys:read`, `quotas:manage`...). An unknown route or role is denied, even for admin.
- Login and session return the `permissions` list, which the console uses to show menus and buttons. The decision is always the server's: tampering with the JavaScript gives no access.
- **Role, state and teams are reread from PostgreSQL on every request.** Deactivating someone or downgrading their role takes effect on the next request; no privilege is stored in the cookie.
- Every write requires a same-origin session and CSRF, and goes into the [audit trail](/docs/security/security/).
- Queries for team roles filter by team in the database, before paginating or aggregating.

Some permissions that appear in other guides:

| Permission | Who has it |
| --- | --- |
| `quotas:read` / `quotas:manage` | admin, viewer and operator read; only admin changes |
| `quota_reservations:release` | admin for every organization; an organization admin for reservations of its own organization that hold no ceiling set above it: list the held unknown reservations, [release them by hand](/docs/features/quota-finance/#releasing-an-unknown-reservation-by-hand) with a written reason, and read the trail of releases (flag `quota_manual_release`). Viewer, operator and team roles do not hold it, and it is in no custom role |
| `resilience:read` / `resilience:manage` | admin, viewer and operator read; admin and operator change |
| `local_inference:read` / `local_inference:operate` / `local_inference:manage` | admin, viewer and operator see the [local inference](/docs/features/local-inference/) pools and replicas; admin and operator start, stop and restart a replica; only admin changes the pool list. Team roles have none of them |
| `logging:read` / `logging:manage` | global admin and viewer read; only global admin changes the runtime minimum under `logging_management`; operator and scoped roles denied |
| `infrastructure:manage` (cache backend) | admin only |
| `workloads:read` / `ownership:manage` | admin and viewer read; only admin changes |
| `skills:read` / `skills:manage` | admin, viewer and per-team readers; only admin changes |
| `mcp:read` / `mcp:manage` | MCP health check: admin and operator |
| `alerts:read` / `alerts:manage` | admin and viewer read; only admin changes |
| `alert_rules:read` | [alert rules](/docs/features/alert-rules/#who-sees-what) and their alerts: admin, viewer, operator, `team_admin`, `team_viewer` and `user`, each within its own teams (an organization admin also within its organization) |
| `alert_rules:manage` | creating, editing, muting and deleting rules, acknowledging, resolving and muting alerts, and the backtest: admin everywhere; `team_admin` on the teams it administers; an organization admin also on its organization's rules. A custom role never holds it |
| `alert_rules:global` | widens the two above to every team, every organization and the global (operational) rules: admin; viewer and operator read only. Without it a session never sees a global rule or alert |
| `monitors:read` | [evaluation monitors](/docs/features/evaluation-monitors/#who-sees-what): admin and viewer; `team_admin`, `team_viewer` and `user` within their own teams whose plan includes `evaluation_monitors` |
| `monitors:manage` | creating, editing, muting, testing and deleting monitors, and the backtest: admin everywhere; `team_admin` on the teams it administers. A custom role never holds it |
| `monitors:global` | widens the two above to every team: admin; viewer read only |
| `guardrails:read` / `guardrails:manage` | admin and viewer read; only admin changes |
| `branding:manage` | admin only |
| `recycle_bin:read` | admin and viewer; an organization admin for its organization (T168) |
| `recycle_bin:restore` | admin; an organization admin for its organization ([disable and trash](/docs/features/disable-and-trash/)) |
| `mcp_credentials:manage` | admin and operator on any team; `team_admin` on their own teams |
| `jwt:manage` | admin only |
| `content_capture:manage` | admin only: [content capture](/docs/features/content-capture/) policies, reader grants and deletion |
| `requests:replay` | admin on any team; organization admin inside its organization; `team_admin` on their own teams: [replay a captured request](/docs/features/trace-explorer/#replay-a-request) as oneself (flag `request_replay`; also needs `content_sent:read` of the team). A custom role ceiling can withhold it |
| `evaluators:publish` | admin on any team; `team_admin` on the teams they administer: publish a version of an [evaluator](/docs/features/evaluators/), pause, resume or disable it, run a backfill, and run it on chosen traffic or cancel such a run (`code_evaluators`, with `logs:read` for the run), which is what puts a judge on traffic (flag `evaluators`). Saving a draft and restoring a version stay with `evals:manage`. A custom role ceiling of a team administrator can withhold it |
| `evaluators:test` | the same roles: run the evaluator editor's [test pane](/docs/features/evaluators/#test-before-you-publish), which makes judge calls on real traffic as playground traffic of the team; the previews and resolved variables it shows also need `content_sent:read`. A custom role ceiling can withhold it |
| `reviews:annotate` | admin; `team_admin` and `user` in their teams: take the items of a [review queue](/docs/features/human-review/#who-may-do-what) and review them. An open queue is worked by the people who administer its team; a queue with assignees by them, whatever their role. What a reviewer reads of captured content is what the content permissions above give them. A custom role ceiling (base `user` or `team_admin`) can withhold it |
| `reviews:assign` | admin; `team_admin` in the teams they administer: name who reviews an item, and take any item whoever it is assigned to (flag `review_multi_annotator`). A custom role ceiling of a team administrator can withhold it |
| `review_queues:manage` | admin; `team_admin` in the teams they administer: create, change and delete review queues, add and remove their items, and manage the [automations](/docs/features/human-review/#automations) that fill queues and datasets. Like every `:manage` permission it is in no custom role |
| `reviews:calibrate` | admin; `team_admin` in the teams they administer: read every reviewer's values, export a queue, read the [calibration](/docs/features/human-review/#calibration) of the judges and settle a final value; `viewer` reads the same across teams and settles nothing. A custom role ceiling (base `viewer` or `team_admin`) can withhold it |
| `saved_views:read` | admin and viewer (the views of every team and organization); `team_admin`, `team_viewer` and `user` (their teams' and organizations'): read [saved views](/docs/features/query-language/#saved-views) of the Traces and Request logs screens (flag `trace_query`). A custom role ceiling can withhold it |
| `saved_views:save` | the same roles, in a named session: keep, update and remove one's own views and choose a default. A shared token names nobody and cannot. A custom role ceiling can withhold it |
| `saved_views:share` | admin with any team or organization; organization admin with its organization and its teams; `team_admin` with the teams they administer: share a view and manage the views of that team or organization. A custom role ceiling of a team administrator can withhold it |
| `dashboards:read` | admin and viewer (the dashboards of every team and organization); `team_admin`, `team_viewer` and `user` (their teams' and organizations'): read [custom dashboards](/docs/features/dashboards/), the built-in ones included, their versions, their widgets' data and the widget library (flag `custom_dashboards`). A widget's data is read through its source, so `analytics:read` (usage metrics) or `logs:read` (traces) applies as well. A custom role ceiling can withhold it |
| `dashboards:save` | the same roles, in a named session: keep, change, copy, restore and remove one's own dashboards and library widgets, and preview a widget in the builder. A shared viewer token names nobody and cannot. A custom role ceiling can withhold it |
| `dashboards:share` | admin with any team or organization; organization admin with its organization and its teams; `team_admin` with the teams they administer: share a dashboard or a library widget and manage those of that team or organization. A custom role ceiling of a team administrator can withhold it |
| `topics:read` | admin and viewer (every team); `team_admin`, `team_viewer` and `user` (the maps of their teams; an organization admin, also its organization's): see [Topics](/docs/features/topics/) maps, topic names and descriptions, counts, figures and the scatter, use the `topic.` term of the query language and the Topics MCP server (flag `topics`). Summary text still needs `content_sent:read` of the unit's team. A custom role ceiling can withhold it |
| `topics:manage` | admin (every team); `team_admin` (the teams it administers; an organization admin, also organization-wide maps): create, change, pause, resume, refresh and delete maps, rename, merge and mute topics, write a team's own facets. A custom role ceiling can withhold it |
| `topics:configure` | admin only: replace or revert the gateway-wide `topics` settings and reset Topics |
| `route_experiments:read` | admin and viewer (every team); `team_admin`, `team_viewer` and `user` (their teams; an organization admin, also its organization's): read [route experiments](/docs/features/route-experiments/) and their readouts (flag `route_experiments`). A custom role ceiling can withhold it |
| `route_experiments:manage` | admin (every team); `team_admin` (the teams it administers): create, change, stop and delete route experiments. Guarded rollback still needs the operator's opt-in on the alias. A custom role ceiling can withhold it |
| `insights:manage` | admin (every team); `team_admin` (the teams it administers): set the triage status of a [failure insight](/docs/features/failure-insights/) group (flag `failure_insights`); reading insights needs `analytics:read` and `logs:read`. A custom role ceiling can withhold it |
| `content_structure:read`, `content_sent:read`, `content_reasoning:read`, `content_media:read`, `content_received:read` | The content ladder below: what each role reads of captured content |
| `content:read` | **no role**: a named console user given an explicit grant by another named administrator; it carries the five content permissions for the teams of the grant, and every read is audited ([content capture](/docs/features/content-capture/#the-contentread-grant)) |

### Content visibility follows the role

Every access level is a permission inside a role. What a person reads of [captured content](/docs/features/content-capture/) is five permissions that the built-in roles bundle from the top down: the top role holds all of them and each role below holds fewer.

| Permission | Reads |
| --- | --- |
| `content_structure:read` | Record metadata and the structural items of a span; no content |
| `content_sent:read` | The request after the input guardrails and the answer, as text |
| `content_reasoning:read` | The model's reasoning, captured apart |
| `content_media:read` | Captured images and audio |
| `content_received:read` | The request exactly as the client sent it |

| Built-in role | Scope | `content_structure:read` | `content_sent:read` | `content_reasoning:read` | `content_media:read` | `content_received:read` |
| --- | --- | --- | --- | --- | --- | --- |
| `admin` | every team | yes | yes | yes | yes | yes |
| `org_admin` | the teams of its organization | yes | yes | yes | yes | yes |
| `team_admin` | the teams it administers | yes | yes | yes | yes | no |
| `team_viewer` | its teams | yes | no | no | no | no |
| `user` | its teams | yes | no | no | no | no |
| `operator` | every team | yes | no | no | no | no |
| `viewer` | every team | yes | no | no | no | no |

- **One function decides every read.** It takes the session's effective permissions (the role's bundle under its custom ceiling, if any), never the role's name, and narrows them to the record's team. The request details, the media read, the evaluation screens, the review queue, session transcripts, dataset imports, judge reasoning on results and the structural items of a span all use it.
- **No level crosses organizations.** A team role reads its own teams only, an organization admin the teams of its organization only, with or without a `content:read` grant. `admin`, `operator` and `viewer` are gateway-wide roles.
- **Nor does a team that moves.** A team's role reaches what the team recorded in the organization it is in now. Captures, spans, traces, results, comments, runs and request log rows it recorded under a former organization are not read through the team any more, by its own roles or by the administrators of its new organization: see [targets after a team moves](/docs/features/evals/#targets-after-a-team-moves).
- **An organization administrator reads what was recorded in its organization through the organization on the row.** Its permissions (`analytics:read`, `logs:read`, `evals:read` and the content permissions above) cover everything recorded in its organization, including by a team that has since moved away, and nothing that team records elsewhere. No new permission and no membership is involved; a custom role ceiling narrows it as it narrows every other read; it is a read only; and with feature plans the organization's own plan must include the feature. See [when a team moves](/docs/features/organizations/#when-a-team-moves).
- **A [custom role ceiling](/docs/features/custom-roles/) can withhold any of the five and never grants one** beyond its base role: `content_received:read` is in no ceiling, and a `viewer` or `operator` ceiling is offered `content_structure:read` only. So "the sent view as text" for a reviewer is a ceiling on `team_admin` that keeps `content_sent:read` and withholds reasoning and media; there is no evaluator role.
- **With `membership_roles`**, a team administrator's `member` association gives that team the member's share: `content_structure:read`.
- **The operator** holds `content_structure:read` alone (least privilege): it changes routing and reads no request log, analytics or audit, and no captured content. More comes only through a role that holds it, or a `content:read` grant.
- **A shared admin token** names nobody: it holds the administrator's bundle except `content_received:read`.
- **[Agent runs](/docs/features/agent-recognition/) use the same permissions, and add none.** The run list and a run's thread (agent, IDs, owners, counters, times) need `logs:read`: `admin`, `viewer`, `team_admin`, `team_viewer` and `user`, each within its scope. Tool names and call IDs need `content_structure:read` of the run's team, in a thread, in the trace view and in the read of one span; without it the steps are listed unnamed. The task the user typed, kept only under `agent_recognition.task_capture`, needs `content_sent:read` of the run's team (`admin`, the organization admin and `team_admin`), and each read is audited as `agent_run_task.read`. The effective settings and rules need `config:read`.
- `GET /api/v1/admin/content-access` answers the ladder and what the calling session reads per team; **Content capture → Who reads what** shows the same table.

## Limits

- [Delegated prompt actions](/docs/features/prompt-delegation/) require an explicit owning-team policy for existing `user`/`team_admin` identities; membership alone never grants a writer. Draft, publication and destructive rights are separate and retain live custom-role/plan/license ceilings.
- The optional [custom role ceiling](/docs/features/custom-roles/) restricts an existing named-user role through an explicit finite permission catalog. It never creates a custom administrator, arbitrary route grant or attribute-based policy.
- Do not map an IdP name, email or group directly to `admin`: the link is explicit and reviewed.
- The only per-organization role is [`org_admin`](/docs/features/organization-admins/) (`organization_admins`); there is no per-organization viewer.

## Admin API routes

Every route below needs a console session or an admin Bearer token, the role's permission and, for writes, the `X-CSRF-Token` header; the full contract is in the [API reference](/docs/api/).

| Route | What it does |
| --- | --- |
| `GET /api/v1/admin/access-groups` | Lists the access groups (YAML base and console overrides) with the keys and team policies that reference each one; `access_groups` |
| `PUT /api/v1/admin/access-groups/{id}` | Creates or edits a group at the current configuration version; `access_group_management` |
| `DELETE /api/v1/admin/access-groups/{id}` | Reverts a YAML group to its declaration, or removes a console group |
| `GET /api/v1/admin/agent-runs` | Lists the recognized coding-agent runs of the reader's teams; `logs:read` ([agent runs](/docs/features/agent-recognition/#who-reads-what)) |
| `GET /api/v1/admin/agent-runs/{id}` | One run as a thread; `logs:read`, tool names and call IDs with `content_structure:read`, the task text with `content_sent:read` |
| `GET /api/v1/admin/agent-runs/settings` | The effective agent recognition settings and rules; `config:read` |
| `GET /api/v1/admin/keys/page` | One page of managed keys with filters, sort and total, for the console inventory; no secret or hash |
| `GET /api/v1/admin/keys/{id}/detail` | One key's metadata, access ceiling, usage and recent audit in one consistent read |
| `DELETE /api/v1/admin/keys/{id}` | Revokes and soft-deletes a managed key |
| `POST /api/v1/admin/keys/{id}/enable` | Enables a disabled key again with the same secret |
| `GET /api/v1/admin/keys/{id}/auto-route-usage` | The key's auto-routed traffic per alias: turns, sessions, models chosen and cost against the most expensive candidate |
| `GET /api/v1/admin/keys/{id}/savings` | What the key saved per day through the gateway cache, provider prompt caching and the auto-router |
| `PUT /api/v1/admin/keys/{id}/owner` | Sets, changes or clears the [owner](/docs/features/identity-ownership/) of a managed key |
| `GET /api/v1/admin/teams/page` | One page of console teams with filters, sort and total |
| `GET /api/v1/admin/teams/{id}/detail` | One team's metadata, policy, usage and recent audit |
| `POST /api/v1/admin/teams/{id}/enable` | Enables a disabled console team again |
| `GET /api/v1/admin/teams/{id}/member-permissions` | The key actions the team delegates to its plain members, and those it could delegate |
| `PUT /api/v1/admin/teams/{id}/member-permissions` | Replaces the delegated key actions (`keys:create`, `keys:rotate`, `keys:revoke`, `keys:delete`) |
| `PUT /api/v1/admin/teams/{id}/policy` | Sets the team ceiling on model aliases and route or MCP scopes |
| `DELETE /api/v1/admin/teams/{id}/policy` | Removes the console policy and restores the YAML policy, or default deny |
| `GET /api/v1/admin/keys` | Lists managed and YAML key metadata; scoped roles see only their teams' keys; never a secret or hash |
| `GET /api/v1/admin/teams` | Lists teams with their effective policy when team policy enforcement is on |
| `POST /api/v1/admin/users` | Creates a named console user and returns its personal token once |

## See also

- [Access and governance](/docs/features/feature-access/): overview of the group.
- [Organizations](/docs/features/organizations/) and [plans](/docs/features/entitlements/).
- [Security](/docs/security/security/).

## Legacy operational switches and catalog origins

Five independent catalog flags package behavior that earlier versions always exposed. They default to enabled when omitted and are explicit `true` in both shipped YAML profiles. An explicit `false` wins; none grants a permission or bypasses model/key authorization. All other omitted flags retain their existing defaults.

| Flag | When disabled |
| --- | --- |
| `emergency_stop` | Cannot engage a new emergency stop; an already engaged stop remains enforced, visible and releasable by its existing authorized administrator |
| `model_test` | The explicit provider test endpoint/control is unavailable; enabling it never initiates a paid call |
| `provider_presets` | The administrative presets endpoint and console integrations/preset controls are unavailable; declarative YAML preset references still expand |
| `wildcard_aliases` | Wildcard declarations remain valid, but runtime wildcard resolution/listing is disabled, including the literal wildcard ID; ordinary aliases keep working |
| `docs_site` | Documentation, Swagger page and llms.txt are unavailable under the existing UI requirement; this does not disable inference |

The global flag catalog labels omitted values **Default**, explicit YAML values **YAML**, and versioned overrides **Console**. Removing an override restores the declared/base default. The private declared-origin map is preserved and independently copied across control-plane snapshots; it is not an inference credential. Operators can read this catalog, but cannot toggle flags or read finance/key data through that new read permission. Scoped team/user roles retain their existing allowlisted feature view.


## Typed credential choices

The shared [parameter definitions](/docs/reference/parameter-registry/) keep key kind explicit: `virtual` or `service_account`. Both retain the existing scope/model checks and the team checks applicable to their YAML or managed-key path; a credential kind never supplies an administrative role. The console’s virtual-key creation preset is separate from the required YAML/API field. Optional owner attribution retains its own typed schema and authoritative directory checks; compiled choices contain no credential hashes, subjects or grants.

## Realtime policy administration

`realtime:read` is global admin/viewer only; its dedicated policy DTO includes nonsecret per-key IDs. `realtime:manage` is global admin only. Operators, team roles and inference credentials cannot use this editor. Session, CSRF, feature and optimistic-version checks remain cumulative; `realtime_management` never grants permission. The ordinary boot inspector still shows only a map count. [Contract](/docs/features/realtime/#manage-policy-without-reconnecting-existing-sessions).

## Destination policy administration

`destinations:read` is global admin/viewer only; `destinations:manage` is global admin only. These rights protect the opt-in `log_destination_management` editor. Existing `logs:read` and synthetic-test rights remain separate. A template is an operator-approved connection binding, never a grant to use another secret source or endpoint. The API refuses caller-selected environment variables, cloud credential/profile selectors and network targets. Session/CSRF/version/flag checks remain cumulative. [Trust boundary](/docs/features/observability/#manage-approved-destination-instances).

## Restart-policy permissions

The optional [HTTP restart policy](/docs/operate/http-input-limits/#save-changes-for-the-next-startup) uses `boot_settings:read` for global admin/viewer and `boot_settings:manage` for global admin only. Operators, team roles, auditors and inference keys do not inherit either right. Writes require a valid session, same origin, CSRF token, current global version and the enabled management flag, plus a known owned startup observation. Read access exposes only three nonsecret durations and their sources; it never grants generic listener, connection or secret management.

## Instance model-ranking controls

External rankings require global `catalog:read`; their instance fetch-policy read additionally requires a global admin, viewer or operator role and `config:read`. Scoped users/team viewers/team admins do not gain this policy merely because their filtered configuration view uses `config:read`. Policy writes/revert require global `models:manage`, CSRF, management flag and current version. Enabling flags never grants permission, and none of these controls maps source names to authorized inference aliases. See [rankings](/docs/features/model-rankings/).

## Public research and policy authority

`model_registry` discloses only original public-source research through anonymous `/registry` and `/v1/registry/models` reads. It is an operator control, not a private-catalog/team permission. Public pages never call session/admin APIs. The separate `model_registry_management` switch requires PostgreSQL and the registry. Its instance policy GET requires a global config reader; PUT/DELETE require global `models:manage`, CSRF and versioned audited CAS. A scoped `config:read` role cannot inspect it. Commercial activation checks remain separate. See [policy, publication and recovery](/docs/features/public-model-research/).

## Client-source ceilings

The default-off boot operator `source_ip_controls` adds canonical trusted-proxy resolution and independent key/admin CIDR ceilings. Managed source policies have YAML/API/console inspection or editing according to their owner and current scoped administrator permissions, independent version/audit and credential-rotation preservation. Enabling a flag never grants identity, routes or models; missing native managed-policy proof fails closed. Background work does not invent a localhost grant. See [source controls](/docs/security/source-ip-controls/) for exact XFF, callbacks, default/limits and recovery semantics. Optional `client_ip_logging` collects only stdout/OTLP metadata; SQL/financial history is unchanged.

## Model request windows

The optional model/key×model admission group adds shared1m/1h/1d request ceilings after canonical model authorization. It does not grant access or replace legacy pre-parse RPM, budget or process-local concurrency checks. See [request rate limits](/docs/features/rate-limits/) for flags, defaults, the two-group consumption contract, auto-routing/realtime behavior and versioned management/status.

## Named OIDC policy authority

`oidc_providers:manage` is a finite global-administrator capability for the [named OIDC catalog](/docs/features/oidc-providers/), including its read routes. It does not grant a role from an identity claim, and operator/team administration does not include it. Current custom ceilings, CSRF, durable policy generation, version/base guards and classified license write restrictions are cumulative. Runtime login resolves an explicit provider-scoped subject to an existing active user; subsequent requests retain live local-role and membership checks.
