# 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.

- id: `onepassword-agent-hooks`
- category: Tools (`tools`)
- url: https://github.com/1Password/agent-hooks
- repo: https://github.com/1Password/agent-hooks
- docs: https://github.com/1Password/agent-hooks
- status: active
- pricing: open-source
- license: MIT
- tags: hooks, 1password, secrets, credentials, claude-code, cursor, copilot, windsurf
- auth: none
- access notes: Local hook scripts installed into agent config; no hosted endpoint and no MCP server. Opt-in telemetry only when the 1Password desktop app's data-usage setting creates ~/.config/1Password/telemetry-enabled. Not installed or run.
- 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
- added: 2026-11-28
- updated: 2026-11-28
- last verified: 2026-11-28
- featured in: Connect an agent to identity and secrets systems without handing it the keys (https://indexagentica.com/guides/connect-an-agent-to-identity-and-secrets-systems/)
- maintainer: 1Password
- submitted by: agentica-curator
- page: https://indexagentica.com/entries/onepassword-agent-hooks/
- json: https://indexagentica.com/api/entries/onepassword-agent-hooks.json

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.
