Skip to main content
Agents need credentials to connect to external services - Linear for issue tracking, AWS for cloud resources, API keys for MCP servers. Secrets store these credentials securely and inject them into your environments automatically.

What you’ll do

Add a secret that your environments and agents can use. We’ll use a Linear API key as an example, but the process is the same for any credential.

Choose a scope

Secrets can be configured at three levels:
ScopeBest for
UserPersonal API keys (Linear, GitHub tokens). Only available in your environments.
ProjectShared credentials for a specific repository. Available to all project members.
OrganizationCompany-wide credentials. Available across all projects.
For personal API keys like Linear, use User secrets.

Add a user secret

  1. Go to Settings > My Account > Secrets
User secrets settings page showing list of personal secrets

User secrets list

  1. Click New Secret
  2. Configure:
    • Type: Environment Variable
    • Name: LINEAR_API_KEY
    • Value: Your Linear API key (from Linear Settings > API)
New secret dialog with Environment Variable type selected showing name and value fields

Creating an environment variable secret

  1. Click Create
The secret is now available as an environment variable in all your environments.
Security tradeoff: Environment variables can leak through process listings and logs. File secrets are more secure, but many tools (including MCP servers) expect credentials as environment variables. For API keys that can be rotated, this tradeoff is often acceptable. For passwords and private keys, prefer file secrets.

Verify it works

Start an environment and check the secret is injected:
echo $LINEAR_API_KEY
You should see your key (or a masked version). Ona Agent can now use this to connect to Linear.

Common secrets for agents

SecretWhat it enables
LINEAR_API_KEYIssue creation and management via Linear MCP
GITHUB_TOKENEnhanced GitHub access via GitHub MCP
OPENAI_API_KEYCustom LLM providers
AWS_* credentialsCloud resource access

Secret precedence

If the same secret name exists at multiple levels, user secrets override project secrets, which override organization secrets. This lets you use personal credentials while teams share defaults.

Next steps