1Password CLI
$ op Official High Riskop lets developers and headless automation read vault items with --format json or inject secrets into child processes via op run --env-file without writing plaintext .env files to disk. Agents must avoid op read or --reveal to keep secrets out of LLM context.
brew install --cask 1password-cli op run passes secrets straight from 1Password into child process env vars, keeping plaintext credentials out of both MCP payloads and LLM context.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format json, op:// URI references, and headless OP_SERVICE_ACCOUNT_TOKEN authentication.
- Native
--format jsonand non-interactive service account tokens
op run safely masks/injects env vars, but op read or --reveal prints plaintext secrets directly into LLM context.
- Plaintext secret exposure risk if
--revealorop readis invoked
Available via brew --cask and official installers, though desktop app biometric auth is unavailable on headless Linux.
- Requires
OP_SERVICE_ACCOUNT_TOKENfor headless environments
op run --env-file eliminates .env secret sprawl in agent workspaces.
- Direct child-process secret injection via
op://references
First-party CLI actively maintained by 1Password.
- Official vendor binary with regular security updates
Comprehensive CLI reference and dedicated CI/service-account guides.
- Official reference at developer.1password.com/docs/cli
Security, Auth & Guardrails
Authenticates via OP_SERVICE_ACCOUNT_TOKEN in headless CI/agents or biometric unlock bridged from the 1Password Desktop app.
CLI is free; requires a 1Password account or Service Account plan.
# 1Password CLI (op) Agent Rules - Prefer `op run` and `op vault list --format json`; NEVER run `op read` or `op item get --reveal` into agent stdout. - Use a dedicated least-privilege `OP_SERVICE_ACCOUNT_TOKEN` scoped only to dev/staging vaults.
Agent-Ready Command Recipes
Safe Read-Only Queries
op vault list --format json
Enumerates accessible vaults in JSON with zero secret values exposed.
op run op run --env-file=.env.tpl -- npm test
Resolves op:// secret references into child env vars without printing them to stdout.
Controlled Writes & Previews
op item create --category=login --title='Staging API' --vault='Dev' --format=json
Creates a new item scoped to a non-production vault and returns metadata JSON.
Strengths for Agents
- +
op runinjectsop://secrets into subprocesses without writing.envfiles or printing values. - + Consistent
--format jsonoutput and fine-grained Service Account vault scoping.
Caveats & Pitfalls
- ! Running
op readorop item get --revealleaks raw secret values directly into agent transcripts. - ! Desktop biometric integration prompts interactively unless
OP_SERVICE_ACCOUNT_TOKENis configured.