Connect your 1Password vault to OneCLI so agents can authenticate to APIs and services using secrets stored in 1Password. Credentials are resolved at runtime using 1Password Service Accounts andDocumentation Index
Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt
Use this file to discover all available pages before exploring further.
op:// references, the same format you already use in CI/CD pipelines and .env files. For an overview of all supported vault integrations, see External Vaults.
This integration is in beta. Setup and behavior may change between releases.
Prerequisites
- OneCLI running locally or via Docker
- A 1Password Service Account with access to the vaults containing your secrets
- The
op://references for the secrets you want agents to use (e.g.op://API Keys/Anthropic/credential)
Setup
Get your Service Account token
In 1Password, go to Developer > Service Accounts and create a new service account (or use an existing one). Grant it read access to the vaults your agents need. Copy the token. You’ll paste it in the next step.
Connect in the dashboard
Open the OneCLI dashboard > Secrets page > 1Password card. Paste your Service Account token and click Connect.OneCLI validates the token, encrypts it (AES-256-GCM), and stores it. The plain-text token is never written to disk.
Add hostname mappings
Map each API hostname to an
You can add mappings in the dashboard or via the API:
op:// reference pointing to the secret in your vault:| Hostname | op:// reference |
|---|---|
api.anthropic.com | op://API Keys/Anthropic/credential |
api.openai.com | op://API Keys/OpenAI/api-key |
api.github.com | op://Dev Tokens/GitHub/token |
How credentials are resolved
When an agent makes a request and no server-stored secret matches the target host, the gateway checks for a 1Password mapping:- The gateway looks up the hostname in the mapping table
- The
op://reference is resolved via the 1Password SDK using the stored Service Account token - The resolved value is injected as an HTTP header and forwarded to the service
- Resolved values are cached in memory for 60 seconds, then discarded. They are never written to the database.
| Host | Header | Format |
|---|---|---|
api.anthropic.com | x-api-key | Raw value |
| All other hosts | Authorization | Bearer <value> |
op:// reference format
1Passwordop:// references follow the pattern:
op://API Keys/Anthropic/credentialpulls the “credential” field from the “Anthropic” item in the “API Keys” vaultop://Dev Tokens/GitHub/tokenpulls the “token” field from the “GitHub” item in the “Dev Tokens” vault
Managing mappings
| Operation | Endpoint | Method |
|---|---|---|
| List all mappings | /api/vault/onepassword/mappings | GET |
| Add or update a mapping | /api/vault/onepassword/mappings | PUT |
| Delete a mapping | /api/vault/onepassword/mappings/{hostname} | DELETE |
Troubleshooting
Connection fails with 'invalid token'
Connection fails with 'invalid token'
Make sure you’re using a Service Account token (starts with
ops_), not a personal API token. Verify the service account hasn’t been deactivated in 1Password.Secret resolution returns 'not found'
Secret resolution returns 'not found'
Check that the
op:// reference is correct: vault name, item name, and field name must match exactly (case-sensitive). Also verify the service account has read access to the vault.Credentials not injected after adding a mapping
Credentials not injected after adding a mapping
Resolved values are cached for 60 seconds. If you just rotated a secret in 1Password, wait for the cache to expire or restart the gateway to force a fresh resolution.
macOS: 'would like to access data from other apps' dialog
macOS: 'would like to access data from other apps' dialog
If you’re running OneCLI locally on macOS Sequoia or later, you may see a system dialog about accessing data from other apps. Grant Full Disk Access to your terminal application (System Settings > Privacy & Security > Full Disk Access). This is a one-time setup that persists across sessions.