# Access keys

Create, scope and revoke the keys that let programs reach your drives over S3.

## Create a key

1. In the [web app](https://app.orbitfs.io/), open **Access keys** in the sidebar and choose **New access key**.
2. Give it a name you'll recognize later, such as the machine or script that will hold it.
3. Choose its access and which drives it can reach.
4. Copy the access key ID and the secret.

:::warning
The secret is shown once. Orbit doesn't keep a copy you can view again. If you lose it, revoke the key and create another.
:::

The same dialog offers ready-made snippets for environment variables, the AWS CLI and rclone, filled in with the new key.

## Access levels

| Level | Allows |
| --- | --- |
| Read only | List and download files. |
| Read and write | Also upload, change and delete files. |
| Full control | Also create, fork and delete drives. |

A key can never do more than the person who created it. Your [workspace role](https://docs.orbitfs.io/web/teams) sets the ceiling: viewers can create read-only keys, members can create keys up to read and write, and owners and admins can create any key. If your role is later reduced, your keys are reduced with it.

## Limit a key to specific drives

A key reaches every drive in the workspace unless you select drives when you create it. A limited key sees only its drives. Requests for any other drive get `NoSuchBucket`, the same answer as for a drive that doesn't exist.

Prefer a limited key for anything automated. Pairing one with a [fork](https://docs.orbitfs.io/guides/forks) confines a script or agent to a copy.

## Limit a key further

Three optional limits are useful for a temporary job or an agent run:

| Option | Effect |
| --- | --- |
| Expiry | The key stops by itself at the chosen time, up to 30 days ahead. |
| Folder scope | The key reaches one folder of one drive. Requests outside that folder are refused. |
| Protect instruction files | The key can read but not change files such as `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.git/hooks` and editor automation files. |

A child key can never outlive, widen or remove a guard on its parent. Keys minted by a connected agent also end when that connection is revoked.

## Child keys

A program that holds a key can create narrower keys from it without a person signing in. A child key can have the same access or less, and the same drives or fewer. Revoking a key also revokes every key created from it.

Send a signed `POST` to `/_uls/keys`:

```sh
curl https://s3.orbitfs.io/_uls/keys \
  --aws-sigv4 "aws:amz:auto:s3" \
  --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
  -H "content-type: application/json" \
  -H "x-amz-content-sha256: $(printf '%s' "$BODY" | shasum -a 256 | cut -d' ' -f1)" \
  -d "$BODY"
```

`BODY` is JSON:

```json
{ "drives": ["d-01jc8w3m5q7x9z2b4d6f8h0k1n"], "access": "read", "label": "nightly-report", "expiresIn": 3600 }
```

| Field | Required | Meaning |
| --- | --- | --- |
| `drives` | Yes | Drive IDs the child can reach. Each must be reachable by the parent. |
| `access` | No | `read`, `write` or `admin`. Defaults to the parent's access. |
| `label` | No | A name shown in the key list. |
| `expiresIn` | No | Whole seconds until expiry, 60 to 2,592,000 (30 days). |
| `prefix` | No | One folder such as `reports/2026/`; requires exactly one drive and cannot be used with `admin`. |
| `protectInstructions` | No | `true` stops the child changing agent instruction files. |

The request must be signed in its headers with the SHA-256 of the body in `x-amz-content-sha256`. Presigned URLs and unsigned payloads are refused. The response is `201` with the new key and its `secretAccessKey`, which is not shown again.

## Revoke a key

Open **Access keys**, find the key and revoke it. The dialog tells you when child keys will go with it.

Revocation reaches the S3 endpoint within 30 seconds.

## Keep keys safe

- Put keys in environment variables or a secret manager, not in source code.
- Give each machine or job its own key, so that revoking one doesn't stop the others.
- Use the lowest access that does the job.
