Skip to content

1Password CLI for AI Agents — Secrets, Managed by AI

Let your AI agent manage secrets and credentials without exposing them in code, env files, or logs

Browse all CLI tools for AI agents

What your agent can do

Your `.env` file has 14 API keys in it. It's in `.gitignore`, but it's also on every developer's laptop, in three Slack messages, and in a shared Google Doc titled "keys DO NOT SHARE." One of those keys is the production Stripe secret. Your agent uses `op run --env-file=.env.tpl -- npm start` instead. The template has references like `op://Development/Stripe/secret-key`. Actual values are resolved at runtime, never written to disk.The 1Password CLI turns secrets management from a discipline problem into a tooling problem. `op read op://Production/Database/password` returns a single value. Pipe it anywhere. `op run` wraps any command with secrets injected as environment variables. `op inject` generates config files from templates. Your AI agent reads, injects, and rotates secrets without any of them appearing in shell history, process lists, or log output.Service accounts make 1Password fully agent-native. Set `OP_SERVICE_ACCOUNT_TOKEN` and every `op` command authenticates without interactive prompts. No biometric unlock, no browser flow, no human in the loop. Your agent in CI/CD reads production credentials, deploys services, and manages vaults automatically. Every access is audit-logged with the service account identity.The horizontal integration is what makes 1Password CLI uniquely valuable in a CLI tools directory. It connects to every other tool. AWS credentials, Docker registry tokens, GitHub personal access tokens, Stripe API keys, Supabase service keys, Vercel deploy tokens, Datadog API keys. Your agent uses `op read` as the single source of truth for every credential across every tool.

Frequently asked questions

Can AI agents manage secrets with 1Password CLI?
Yes. Service accounts enable fully headless operation — set `OP_SERVICE_ACCOUNT_TOKEN` and your agent has authenticated access to vaults. `op read op://Vault/Item/Field` reads a single secret. `op run --env-file=.env.tpl -- command` injects secrets into a subprocess. `op item list --format=json` lists vault contents. All access is audit-logged. Install with `brew install 1password-cli`.
How does 1Password CLI compare to environment variables?
Environment variables are static and stored in files (`.env`). 1Password references (`op://Vault/Item/Field`) are resolved at runtime. The template file is safe to commit — it contains no secrets. When a key is rotated in 1Password, every process using `op run` gets the new value automatically. No redeploying, no updating `.env` files across environments.
What tools does 1Password CLI work with?
Every CLI tool that uses credentials. Your agent reads AWS keys, GitHub tokens, Stripe secrets, database passwords, Vercel tokens, Datadog API keys, and any other credential from 1Password and injects them at runtime. `op run --env-file=.env.tpl -- aws s3 ls` gives the AWS CLI temporary credentials. `op run --env-file=.env.tpl -- vercel deploy` gives Vercel its token. One secrets source for your entire toolchain.