API keys are how programmatic clients authenticate to Agnes. Each key belongs to exactly one tenant; the tenant is inferred from the key on every request. This page covers the lifecycle. The wire-level details (Documentation Index
Fetch the complete documentation index at: https://docs.lasscyber.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer …, Agnes-Version pinning) live on
Authentication.
Live vs sandbox keys
| Prefix | Bills? | Calls upstream models? | Use for |
|---|---|---|---|
ak_… (live) | Yes | Yes | Production traffic. |
ak_test_… (sandbox) | No | No, returns deterministic canned results | Tests, CI, example apps, MCP scaffolding. |
Minting a key
- Sign in to
agnes.lasscyber.com. - Open Settings → Keys (or
agnes.lasscyber.com/keys). - Click Create API key.
- Choose:
- Description. Human-readable name. Appears in the audit log.
- Test mode. Toggle on to mint an
ak_test_…sandbox key. - Scopes. The set of scopes the key may exercise. The picker disables any scope you do not have yourself; see Roles & permissions.
- Rate-limit override (optional, owner / admin only). Lower the per-key minute / hour ceiling below the tenant default if you want to throttle a noisy workload.
- Click Create. Copy the full key value. It is shown exactly once and never recoverable; if you lose it, delete the key and mint a new one.
Storing a key
- Never commit a key to source control.
- Never put a key in browser-side code or a mobile app bundle.
- Use a secret manager (GCP Secret Manager, AWS Secrets Manager, Doppler, 1Password Secrets Automation, etc.).
- For local development, environment variables in a
.envthat is gitignored is fine.
AGNES_API_KEY from the environment by
default; that is the path of least resistance.
Recommended scope bundles
| Use case | Scopes |
|---|---|
| Production analyzer key | analyzer:run, all *:analyze, analyzer_logs:read |
| CI sandbox key | Same as above |
| Read-only dashboard / audit | All *:read scopes |
| Admin / automation | Production analyzer scopes + the policy / YARA / SDP / safety create-update-delete scopes you need |
Rotation
Agnes does not have a single-call “rotate in place” operation. The rotation pattern is mint-then-delete:- Mint a new key with the same description / scopes / rate-limit overrides.
- Roll the new key out to your callers.
- Watch its usage in the dashboard until you are confident traffic has migrated.
- Delete the old key.
Per-key usage
The dashboard shows per-key usage — calls, tokens, last used, last IP. Useful for confirming that an old key is no longer in use before you delete it. Programmatic access viaGET /api/v1/api-keys/{key_id}/usage. Required scope:
api_key:read_usage.
Revoking compromised keys
If a key is compromised:- Delete it immediately from the dashboard. Authentication starts failing on the next request.
- Mint a replacement.
- Audit access. The audit log records every key creation / deletion;
the analyzer log records every analyze call with
request_idso you can scope the blast radius.
Programmatic CRUD
The full surface lives at/api/v1/api-keys/:
POST /api/v1/api-keys/— mint a new key. Returns the full key value once.GET /api/v1/api-keys/— list keys (no values, only metadata).GET /api/v1/api-keys/{id}— fetch metadata for one key.PUT /api/v1/api-keys/{id}— update description, scopes, or rate-limit override.DELETE /api/v1/api-keys/{id}— revoke.GET /api/v1/api-keys/scopes— enumerate the available scope vocabulary.GET /api/v1/api-keys/{id}/usage— usage stats.
Idempotency-Key on
mints to make retries safe.
SDKs
Both SDKs expose the API key namespace:Sandbox key lifecycle
Sandbox keys do not expire by default when minted from the dashboard under your own tenant. Sandbox tenants minted viaPOST /api/v1/test-tenants (operator endpoint) carry a TTL; the keys
inside them stop authenticating when the tenant is reaped. See
Sandbox mode.
Next
- Authentication
- Roles & permissions — scope vocabulary.
- Sandbox mode