Skip to main content

1Password Secrets

Give your AI secure access to 1Password. Never copy-paste an API key into a chat window again. Your AI reads secrets directly from the vault when it needs them. Works with Claude Code, OpenClaw, and any MCP-compatible AI app. Also ships as a Node.js module you can import into your own tools. Fully headless via service accounts … no desktop app, no biometrics, no popups.

Teach Your AI to Use 1Password Secrets

Open your AI and say:
Your AI will read the repo, explain everything, and do a dry-run install first so you can see exactly what changes before anything is written to your system.

What It Does

  1. Your AI can read and write secrets … API keys, tokens, credentials. No more pasting.
  2. Works in Claude Code out of the box … the connection point hooks up automatically.
  3. Secrets stay off disk … Config files use references, real values only exist in memory.
  4. Debug without exposing secrets … Test connectivity and preview values safely.

Technical Documentation

How It Works

  1. On startup, the resolver service walks openclaw.json and resolves op:// references in memory
  2. On first secret request, the tool reads the service account token from disk
  3. It creates a 1Password SDK client (cached for the session lifetime)
  4. Secrets are resolved via client.secrets.resolve("op://Vault/Item/field")
  5. The SDK talks directly to 1Password’s servers over HTTPS
  6. Secret values exist in memory only … never written to disk or logs
The service account token does not expire (unless you set --expires-in). It survives reboots. No desktop app needed.

Quick Start

1. Install the tool

2. Set up 1Password

Create a custom vault and service account (service accounts can’t access built-in vaults):

3. Save the service account token

4. Enable the tool

Add to ~/.openclaw/openclaw.json:

5. Test

Using op:// References in Config

The tool resolves op://vault/item/field strings in openclaw.json at startup. The real key never appears on disk.
Important: OpenAI API key for memory search. Do NOT put an apiKey in memorySearch.remote. Leave "remote": {} empty. The tool resolves the OpenAI key from 1Password and sets process.env.OPENAI_API_KEY at startup; memory search picks it up from the env var.

AI Tools

op_read_secret … Reads a secret value from 1Password. Parameters: item (required), vault (optional), field (optional, default “api key”). op_list_items … Lists all items in a vault so your AI can discover available secrets. Parameters: vault (optional). op_write_secret … Creates or updates a secret. Requires write_items permission on the service account. Parameters: item (required), value (required), vault (optional), field (optional).

CLI Commands

Limitations

  • auth-profiles.json cannot use op:// refs. This file is loaded by a separate subsystem that the tool can’t hook into. Auth provider tokens must remain as real values in that file.
  • op_write_secret requires write_items permission on the service account. The default setup uses read_items only.
  • Secrets are resolved in memory only. If OpenClaw reloads config from disk mid-session, op:// refs need to be resolved again.

Configuration

Config in openclaw.json under plugins.entries.op-secrets.config:

Security

  • Service account tokens grant access only to specific vaults you configure
  • The token file is chmod 600 … only the owning user can read it
  • Secret values are never logged, cached, or written to disk by the tool
  • op:// references in config files are safe to commit to version control

Using 1Password in Your Own Projects

Option 1: Use the op CLI (simplest, any language)
Option 2: Use the 1Password JS SDK
Option 3: Use the tool’s functions at runtime (OpenClaw AIs only)

License

Dual-license model designed to keep tools free while preventing commercial resellers.