agent-guard — Claude Code plugin: what it does, how to install
The agent-guard plugin for Claude Code and Codex intercepts tool inputs and outputs to block secrets. It runs locally by default without telemetry.
MIT ★ 1,596 updated 2026-10-29
/plugin marketplace add hashgraph-online/awesome-codex-plugins
/plugin install agent-guard@awesome-codex-pluginsWhat agent-guard does
The plugin attaches lifecycle hooks to active agent sessions. It inspects tool arguments before execution and masks tokens in console output. It also scans modified files right after patch operations or before session completion. Patch additions via apply_patch undergo validation before hitting disk.
Runtime requirements include sh, awk, git, jq, and gitleaks version 8.30 or newer. You also need setsid (via util-linux on Linux) or Perl to isolate probe executions. Without those tools installed in your path, scanning fails immediately. PII filtering stays disabled by default.
Setup requires running /agent-guard:setup-agent-guard in Claude Code or $setup-agent-guard in Codex. The setup flow inspects the local environment and asks before downloading any software.
What it helps with
- block secrets from leaking through tool parameters
- mask credentials appearing in command outputs
- scan modified code patches before they reach disk
- verify local gitleaks dependencies via automated setup
Example prompts for the agent
- /agent-guard:setup-agent-guard
- /agent-guard:setup-shell
- Run the environment diagnostic and verify secret protection
How to install agent-guard
Plugin marketplace
/plugin marketplace add hashgraph-online/awesome-codex-plugins/plugin install agent-guard@awesome-codex-pluginsStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about agent-guard
How to install agent-guard in Claude Code?
Run /plugin marketplace add hashgraph-online/awesome-codex-plugins, then run /plugin install agent-guard@awesome-codex-plugins. Complete setup by executing /agent-guard:setup-agent-guard.
What does agent-guard do?
It adds local safety hooks to Claude Code and Codex sessions. The plugin stops accidental credential leaks across tool calls, masks secrets in responses, and inspects file patches.
What dependencies does agent-guard require?
The plugin needs sh, awk, git, jq, and gitleaks 8.30 or higher. It also requires either setsid or Perl to isolate scanner version checks.
Source text
agent-guard · MIT
# Agent Guard Agent Guard is a local-first secret-leak guardrail for Claude Code and Codex. In every enabled session, its hooks inspect supported tool inputs and outputs, block common credential exposure paths before execution, mask secret-like output, and scan changed files after mutations and before stop. It is defense in depth, not a vault, DLP system, credential rotator, or replacement for GitHub Secret Scanning and Push Protection. ## Setup After installing the plugin, run the host setup skill: ```text # Claude Code /agent-guard:setup-agent-guard # Codex $setup-agent-guard ``` The guided flow diagnoses dependencies, runs `check` and `smoke-test`, and asks before downloading software. Lifecycle hooks never run an installation on their own. Setup proves local dependencies and deterministic behavior; finish the harmless live probes in the public [verification guide](https://github.com/JeongJaeSoon/agent-guard/blob/main/docs/verification.md) to establish that the current host route dispatches hooks. 런타임에는 `sh`, `awk`, `git`, `jq`, gitleaks 8.30 이상과 함께 gitleaks 버전 프로브를 격리할 `setsid`(Linux의 `util-linux`) 또는 Perl 중 하나가 필요합니다. `setup`과 `doctor`는 격리 도구가 없을 때 gitleaks 재설치 대신 운영체제별 복구 명령을 안내합니다. For Claude Code’s optional shell-output protection, run: ```text /agent-guard:setup-shell ``` This explicitly updates the shell rc. Restart the shell and agent session after it succeeds. ## Coverage and limits Claude Code supports the plugin’s matched tool inputs and outputs. Codex matches the currently supported hook surfaces (`Bash`, `apply_patch`, `Agent`, `Task`, and MCP tools); it does not claim arbitrary read/search/web interception. Both hosts require hooks to be enabled and trusted. Re-test the exact route after a plugin update or when a tool is wrapped by orchestration. `apply_patch` additions are scanned before execution. Structured write targets also receive a direct post-write scan; patch envelopes do not reliably provide a target path. Git and CI remain the backstops for repository-wide coverage. Scanner infrastructure has an explicit policy: `open` warns and continues by default; `closed` refuses the action. Secret detections block. A degraded scan is never evidence of a clean result. Default processing is local and ephemeral. PII hook handling is off by default; endpoint-backed PII processing is opt-in. Read the packaged [privacy policy](PRIVACY.md) before enabling it. ## Documentation and support - [Installation](https://github.com/JeongJaeSoon/agent-guard/blob/main/docs/installation.md) - [Integrations and known limits](https://github.com/JeongJaeSoon/agent-guard/blob/main/docs/integrations.md) - [Verification](https://github.com/JeongJaeSoon/agent-guard/blob/main/docs/verification.md) - [Configuration](https://github.com/JeongJaeSoon/agent-guard/blob/main/docs/configuration.md) - [Operations](https://github.com/JeongJaeSoon/agent-guard/blob/main/docs/operations.md) - [Privacy](PRIVACY.md), [Security](SECURITY.md), [Support](SUPPORT.md), and [third-party notices](THIRD_PARTY_NOTICES.md)
© Agent Guard contributors · MIT · hashgraph-online/awesome-codex-plugins