Skip to main content
A secret stores a credential such as a model API key, machine environment value, MCP token, or integration credential. Other resources reference the secret by its sec_… ID instead of storing the value themselves. Secret values are encrypted and never returned by read endpoints. Rotating a secret updates the value used by its existing references, so nothing needs to be redeployed.

Kinds and owners

You can create three kinds: Every secret has exactly one owner. A project can use a secret only if the project owns it or holds an explicit grant — org and user ownership don’t make a secret visible to projects on their own: The convention that keeps orgs tidy: own each secret at the narrowest scope that needs it. A model key the whole org shares is org-owned; one project’s GitHub deploy token is project-owned.

Create a secret

The examples assume the client, $ORG/orgID, and $PROJ/projectID setup from the quickstart.
For MCP OAuth, use the built-in OAuth flownpx omnara secrets mcp-oauth runs it end to end from the terminal. If you need to import OAuth tokens yourself, see the secret schema.
On both surfaces, reads return the secret’s metadata, never its value. If you lose the value, rotate the secret.

Rotate a secret

Rotation creates a new version while keeping the same secret ID. It is API-only for now; the dashboard and CLI show the current version but cannot rotate it.
The response has current_version_number: 2. Existing references use the new current value without changing their sec_… ID. Processes already running keep the environment they started with.

Manage secrets

Use the secrets pages or API to search for secrets. Edit can change a secret’s name and metadata, but not its value; use rotation to change the value. You cannot delete a secret while a model provider, machine pool, or integration uses it. Replace the secret on that resource — or delete the resource — first.

Grant a secret to a project

A grant lets a project use a secret it does not own.
To review a secret’s project grants, use npx omnara grant secrets list {secret-id}, GET /orgs/$ORG/secrets/{secret-id}/grants, or sdk.listSecretGrants. To remove one, use npx omnara grant secrets delete {secret-id} {grant-id}, DELETE on the grant, or sdk.deleteSecretGrant.To list every secret a project can use (no CLI command for this yet):
This includes secrets owned by the project and secrets explicitly granted to it. availability.source is direct for project-owned secrets and grant for granted secrets.

Where secret IDs are used

These fields reference a secret instead of storing its value directly: