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

# Installation credentials and deploy keys

> Manage deploy keys for CI automation and installation credentials (service keys, export secrets and development identities) on an installation.

Two distinct credential surfaces interact with an installation:

* **Deploy keys** (owned by management / [Access](https://docs.bijection.com/operate/administration#access))
  authenticate CLI and CI automation to the installation's admin lane.
* **Installation credentials** (rows of `sys.grants`, owned by the installation itself)
  authenticate non-human application callers — services, export clients and
  non-production development identities — to the application's routes,
  functions and acts.

An installation credential authenticates only; it never authorizes on its own.
Its grant carries only `speak` for its principal: the credential may speak for
that principal and nothing more. Authority comes from other live `sys.grants`
rows issued to that principal by your application's mutations.

## Deploy keys (CI automation)

Set `BIJECTION_DEPLOY_KEY` in CI to authorize commands for the key's
installation or preview scope. A logged-in developer can use their account
on an installation they can access. Keep build and deploy credentials in
your secret store.

A preview deploy key allows the project to create or update preview
installations. Use an installation-scoped key to target one existing installation.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection installation deploy-key create <project>:<name> --save-env=.env.ci
bijection installation deploy-key list <project>:<name>
bijection installation deploy-key rotate <project>:<name> <credential-id> --overlap 1h
bijection installation deploy-key delete <project>:<name> <principal-id>
```

`create` issues a seven-day deploy key, and `--save-env` writes it as
`BIJECTION_DEPLOY_KEY` to an env file instead of printing it. `list` shows the
sponsored principals and credential IDs. `rotate` issues a successor and keeps
the predecessor for `--overlap` (from `0s` to `168h`). `delete` revokes a
sponsored principal and its keys.

## Installation credentials (`sys.grants`)

An installation records each non-user credential as a grant in `sys.grants`
held by the credential. The grant carries `speak` for the credential's
principal, and revoking it, or letting it expire, ends the credential. There
are three kinds:

| Kind | Credential key | Principal | Material | Ends |
| - | - | - | - | - |
| `key` | `key:<kid>` | `service:<name>` | P-256 public key (ES256) | Required end; revocation |
| `token` | `secret:<id>` | `service:<name>` or `agent:<name>` | SHA-256 digest of the `bijection-secret.v1.<…>` bearer | Expiry (up to 366 days) or revocation |
| `token` for placement export | `secret:<id>` | `service:placement/<installation UUID>/<slot>/<generation>/export/<id>` | SHA-256 digest of the full `bijection-placement.v1.<…>` bearer | Expiry (up to 366 days), revocation, or end of generation service |
| `development` | `development:<kid>` | `https://development.bijection.invalid` | P-256 public key (ES256) | Revocation (local only) |

The operator's client generates ordinary service and agent keys or bearers
locally. Keys installs only the public key or SHA-256 digest at
`POST /api/genesis/keys/installCredential`. An ended grant cannot be reused.

### Service tokens for SDK clients

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection credential create ci --kind token --until 7d
```

Store the bearer in your CI secret store and pass it to `connect(url, { token })`.
The caller is `service:ci`. Grant this principal the application roles its CI
jobs need.

### Agent bearers for delegated calls

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection credential create review-worker --kind agent --until +1h
```

In an application mutation, delegate by issuing:
`ctx.grant(role, { to: "agent:review-worker", from: grant, under, until, only? })`
issues one child of a grant the caller holds (it keeps that grant's role,
dies with it, and the agent's accountable principal is the caller), and
`only` narrows it to the functions and labels the agent can use. The
`delegation()` library of `@bijectionhq/library-members` places the same
issue behind a `delegate({ agent, role, until? })` mutation. Store the bearer in the agent's secret store and configure its client
with `connect(url, { token })`. Each real call and trial uses the agent's live
delegation. The guest frame exposes `as.id` as `agent:review-worker` and
`as.for` as the accountable delegator. The execution audit records both.
For CLI calls and trials, put the bearer in a private file and set
`BIJECTION_ACCESS_TOKEN_FILE` to its path.
When the checkout has a saved installation, the call checks its recorded
installation and incarnation under the same admission as the bearer.
`bijection mutate` presents that bearer when it opens the mutation's
registration and when it sends the call.

### Service keys and listing

Manage service credentials from the CLI:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection credential create billing --until +90d --label voice-prod
bijection credential list
bijection credential list --kind token --all
bijection credential revoke key:<kid>
```

`bijection credential list` calls the genesis `keys.listCredentials` query.
The inventory returns each grant’s ID, holder, speaking rights, expiry in Unix milliseconds, and optional listing metadata.
It hides ended facts unless you pass `--all`.

For sync export clients (`token` credentials), use `bijection credential list --app transfer`,
`bijection credential rotate --sync <name> --consumer <name> --overlap 1h`, and `bijection credential revoke <id>`.
For self-hosted Airbyte, pass `--source-config-out <private-file>` and
install the new configuration on the existing source to keep its cursor.
Control generates and holds the bearer for a managed native export client.
The CLI receives the credential ID, scoped principal and grant ID. For a
customer provider, the CLI generates the bearer and seals it to the
installation's partner slot. Each bearer has its own principal and a grant
at the exact placement generation member.

Rotation keeps the connection and updates the partner with a new bearer and
principal. The default overlap of `0s` revokes the exact previous grant
after the partner accepts its replacement. With a nonzero overlap, the feed
accepts the previous grant until the printed cutoff or credential expiry,
whichever comes first. While the partner's outcome is unresolved, the feed
admits the active grant and the candidate eligible for that connection.

For a customer partner using OAuth, supply the identity provider's token
endpoint and register its verified principal on the feed. A native feed
uses the bearer grant recorded for its connection.

### Development identities (`--as`)

On a local development installation, `--as person:<subject>` signs a
short-lived ES256 token using your machine's development
key (`~/.bijection/development-identity.pem`). The CLI installs that public
key as a `development` credential on the installation (requiring `ManageDevelopmentKeys`) and
signs tokens bound to that installation's `bijection_development_scope`
(`deployment` and `incarnation`).

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection query notes.list --as person:alice
```

The installation binds that credential name to a seeded person id. App
authority comes from grants issued to that id. Production installations
refuse development credentials at both install and verification
(`DevelopmentCredentialRefused`), and `--as` is refused when a service key or
token file is in use.

### Console Credentials page

In the console, **Installation Settings → Credentials** (beside Authentication)
lists the installation's credential and session grants in `sys.grants` —
service keys, export secrets, development keys, sign-in sessions and recovery
keys — with
kind filters and revoke/end actions. The console and CLI call `keys.listCredentials`
and `keys.revokeCredential`. The Root checks the operator's live grant and the
presented key's scope for each entry. Development keys have their own revoke
scope. Management tokens and admin keys live separately under
**Team Settings → Access** ([Administrative credentials](https://docs.bijection.com/operate/administration/credentials.md)).


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