1Password Agent Hooks
1Password's MIT-licensed hooks for Cursor, Claude Code, GitHub Copilot and Windsurf that validate 1Password setup (such as mounted .env files) before agents run shell or tool commands.
Tags
Description
Official repository 1Password/agent-hooks (MIT; use of 1Password APIs and services through it is governed by the 1Password API Terms of Service; not archived). Hooks fire on agent events such as before shell or tool use to validate and verify 1Password configuration so commands run with the secrets they expect, for example 1password-validate-mounted-env-files, which validates mounted .env files from 1Password Environments. Supported agents per the README: Cursor, Claude Code, GitHub Copilot and Windsurf (Cascade). Install: an install script (./install.sh --agent <agent>) builds a bundle you copy into a project or user config and register in the agent's hooks file (for example .cursor/hooks.json or .claude/settings.json), or use the plugin routes listed in the README. These are scripts that run on your machine at agent events, so review them before enabling (editorial). Telemetry disclosure: the hooks emit opt-in telemetry (install method, which agents trigger hooks and similar); events are written only if ~/.config/1Password/telemetry-enabled exists, which the 1Password desktop app creates or removes according to its product-telemetry setting; the desktop app forwards the events, the file is capped at 1 MB, and failures are ignored. Turning off product telemetry in 1Password Settings stops the hooks writing. Free software; a 1Password account is separate. Nothing was installed or run and no 1Password account was used.
Agent access
Guides & comparisons
- Connect an agent to identity and secrets systems without handing it the keys (Guide): A least-privilege checklist for identity and secrets MCP servers, worked through on Okta, Bitwarden and Clerk plus 1Password's agent hooks: scope tools to read-only first, keep secrets out of model context, gate writes with a human, and keep audit logs.
Sources
- https://github.com/1Password/agent-hooks
- https://raw.githubusercontent.com/1Password/agent-hooks/main/README.md
- https://api.github.com/repos/1Password/agent-hooks
Machine-readable
- JSON
- Markdown
- Source file on GitHub (edit via pull request)