setup-agent-guard — Claude Code skill: what it does, how to install
The skill audits Agent Guard dependencies, installs missing tools, and verifies hook protections. It helps when SessionStart warns about degraded security.
npx skills add JeongJaeSoon/agent-guard --skill setup-agent-guard -a claude-codeWhat setup-agent-guard does
The skill restores Agent Guard functionality without silent machine edits. First, it identifies the plugin-local binary at ../../bin/agent-guard instead of replacing it with a global copy from PATH. It executes <agent-guard-bin> setup for read-only diagnosis. Missing jq triggers a prompt with the exact package manager command. Missing gitleaks uses a checksum-pinned download with SHA-256 verification. The skill never calls sudo without user permission.
Sandbox blocks receive special handling. If the host sandbox prevents a write, the skill shows the exact terminal command so you can execute it separately. Next, it validates hook dispatch on the current host. In Codex, every hook must show as trusted inside Settings. In Claude Code, plugins reload after updates and run checks through Bash.
Live probes confirm boundary enforcement. The skill fires sentinel markers through standard command tools. AGENT_GUARD_LIVE_PRE_TOOL_PROBE must trigger a block before execution. AGENT_GUARD_LIVE_POST_TOOL_PROBE must mask the response with [REDACTED]. Because these markers prove dispatch, the skill never reads actual secret files during testing.
What it helps with
- diagnose and repair plugin-local Agent Guard binary
- install jq and checksum-verified gitleaks dependencies
- validate hook dispatch using non-destructive sentinel probes
- clear SessionStart degraded protection warnings
Example prompts for the agent
- Run setup-agent-guard to fix the SessionStart degraded protection warning
- Diagnose Agent Guard dependencies and verify live hook dispatch
- Check if gitleaks is installed and run smoke tests via /agent-guard:setup-agent-guard
How to install setup-agent-guard
1Skills CLI (Vercel)
npx skills add JeongJaeSoon/agent-guard --skill setup-agent-guard -a claude-code2Manually: put the files in place
~/.claude/skills/setup-agent-guard/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/setup-agent-guard/
1Skills CLI (Vercel)
npx skills add JeongJaeSoon/agent-guard --skill setup-agent-guard -a codex2Manually: put the files in place
.agents/skills/setup-agent-guard/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add JeongJaeSoon/agent-guard --skill setup-agent-guard -a cursor2Manually: put the files in place
.cursor/skills/setup-agent-guard/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install JeongJaeSoon/agent-guard setup-agent-guard2Manually: put the files in place
.github/skills/setup-agent-guard/SKILL.md1Skills CLI (Vercel)
npx skills add JeongJaeSoon/agent-guard --skill setup-agent-guard -a gemini-cli2Platform CLI
gemini skills install https://github.com/JeongJaeSoon/agent-guard --path plugins/agent-guard/skills/setup-agent-guardManually: put the files in place
.devin/skills/setup-agent-guard/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add JeongJaeSoon/agent-guard --skill setup-agent-guard -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about setup-agent-guard
How to install setup-agent-guard in Claude Code?
Run npx skills add JeongJaeSoon/agent-guard --skill setup-agent-guard -a claude-code. The skill file is placed at ~/.claude/skills/setup-agent-guard/SKILL.md.
What does setup-agent-guard do?
It audits the plugin-local Agent Guard binary, prompts before installing required dependencies like jq and gitleaks, and confirms live hook dispatch using probe sentinels.
How does setup-agent-guard verify hooks without exposing secrets?
It issues sentinel strings AGENT_GUARD_LIVE_PRE_TOOL_PROBE and AGENT_GUARD_LIVE_POST_TOOL_PROBE. The pre-tool hook blocks command execution, while the post-tool hook masks output with [REDACTED], avoiding any real credential access.
Source text
SKILL.md · MIT
---
name: setup-agent-guard
description: Diagnose, install, and verify Agent Guard's plugin-local binary, jq and gitleaks dependencies, the active host integration, and live hook protection. Use when Agent Guard reports degraded protection, a SessionStart warning asks for setup, plugin hooks fail or appear bypassed, or a user asks to finish or repair Agent Guard installation.
disable-model-invocation: true
---
# Setup Agent Guard
Make Agent Guard operational without silently changing the machine. Diagnose first, request approval before package-manager or download actions, and finish with a real smoke test.
## Workflow
1. Resolve the Agent Guard executable without confusing the plugin with a standalone install.
- First use the plugin binary two directories above this skill: `../../bin/agent-guard` relative to this `SKILL.md` directory.
- Resolve the path from the skill directory, confirm that it is executable, and use it for every plugin diagnosis and smoke test.
- Separately inspect `command -v agent-guard`, if present. Compare its `version` with the plugin binary and report version drift, but do not substitute it for the plugin binary or modify the standalone installation without explicit approval.
- Only fall back to `command -v agent-guard` when the plugin-relative binary is unavailable, and clearly state that plugin-local verification could not be completed.
- Do not install a second copy of Agent Guard merely to get a command on `PATH`.
2. Run the read-only diagnosis:
```sh
"<agent-guard-bin>" setup
```
`setup` and `doctor` report only local dependencies. Their
`host hook protection: unverified` notice is expected even when they exit
`0`; do not call that result runtime protection.
3. If `jq` is missing, identify the available system package manager and show the exact install command. Ask for explicit user approval before running it. Do not use `sudo` unless the user explicitly approves elevated installation.
4. `setup`이 gitleaks 자체의 누락이 아니라 `gitleaks version isolation requires
setsid or perl`을 보고하면 gitleaks를 다시 설치하지 마세요. Linux에서는
`setsid`를 제공하는 `util-linux`를, Homebrew 환경에서는 Perl을 설치하는
정확한 명령을 보여 주고 실행 전 명시적 승인을 받으세요. `setup --install`도
이 보조 도구를 자동 설치하지 않으며, 보조 도구가 없으면 gitleaks 다운로드
전에 중단하고 복구 전까지 nonzero 상태를 유지합니다.
5. If `gitleaks` is missing, prefer Agent Guard's private, checksum-pinned installer:
- Determine the target OS and architecture.
- Fetch the official checksum list for the version reported by `agent-guard setup`.
- Select the checksum for the exact archive name and show the version, archive, source URL, checksum, and destination.
- Ask for explicit approval before downloading or installing.
- After approval, run:
```sh
"<agent-guard-bin>" setup --install \
--gitleaks-version "<version>" \
--gitleaks-checksum "<published-sha256>"
```
Never substitute an unverified checksum and never bypass TLS verification.
6. If an approved dependency installation is blocked by the host sandbox:
- Relay the exact error. Do not retry the same blocked write, change the
install destination, or bypass the sandbox silently.
- Show the exact command for the user to run in a separate terminal. For the
private gitleaks installer, preserve the plugin-local binary path, version,
and published checksum from the approved command above.
- Wait for the user to confirm that the command finished, rerun the read-only
`"<agent-guard-bin>" setup` diagnosis, and continue only when the dependency
reports `ok`.
7. Verify the plugin-local installation:
```sh
"<agent-guard-bin>" check
"<agent-guard-bin>" smoke-test
```
Treat `check` as dependency/config validation and `smoke-test` as proof of the binary's own behavior. They do not prove that the host is dispatching plugin hooks.
8. Identify the active host and verify its plugin boundary before claiming that protection is active.
- In Codex, confirm that the Agent Guard plugin is installed and enabled. In **Settings > Hooks**, inspect Agent Guard's `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, and `Stop` hooks. Every hook must be enabled and trusted. Treat `Untrusted` and `Modified` as inactive; an updated hook must be reviewed and trusted again.
- In Codex, do not edit `hooks.state` or copy trust hashes into `config.toml`. Hook trust is a user security decision and must go through the Codex trust UI. If `SessionStart` itself is untrusted, explain that it cannot emit the setup warning or invoke this skill automatically.
- In Claude Code, confirm that the Agent Guard plugin is installed and enabled, then reload plugins after an install or update. Do not direct Claude Code users to Codex **Settings > Hooks**; Claude Code does not use that trust workflow. `/agent-guard:verify` can check the working tree, but it does not prove live hook dispatch.
- If the active host is unclear, infer it from the current product and invocation (`$setup-agent-guard` in Codex or `/agent-guard:setup-agent-guard` in Claude Code). Do not apply one host's setup steps to the other.
9. Run live host probes through the normal command tool selected by the active host for the current task. Do not read a real sensitive file.
- Pre-tool probe:
```sh
printf '%s\n' 'AGENT_GUARD_LIVE_PRE_TOOL_PROBE'
```
The expected result is an Agent Guard block before the marker is printed. If the marker appears, the live command boundary is not protected.
- Post-tool probe:
```sh
printf '%s\n' 'AGENT_GUARD_LIVE_POST_TOOL_PROBE'
```
The raw marker must not reach the model; expect `[REDACTED]` in a masked or sanitized replacement. While local diagnostic logging is on the replacement also names the hook invocation that produced it, as `[REDACTED] agent-guard live probe run_id=<run id>`; report that id so the user can resolve it with `agent-guard logs export` instead of taking the probe result on trust.
- Reading this file is itself a covered tool call, so the marker on the line above comes back already replaced. That is the hook working. Do not conclude that the expected value is a literal committed here, and do not substitute a typed `[REDACTED]` for running the probe. These sentinels prove host dispatch without reading a sensitive file or printing a credential-shaped value; the plugin-local smoke test separately proves the real detection rules.
- In Codex, if only a wrapping/orchestration tool such as `functions.exec` is exposed, test that exact route. Agent Guard cannot replace or wrap Codex's host executor; it can protect only nested calls that Codex exposes to plugin hooks.
- In Claude Code, run the probes through the normal `Bash` tool so the plugin's `PreToolUse` and `PostToolUse` hooks are exercised.
- If either probe bypasses the hook, report that route as unsupported in the current host instead of claiming successful setup.
10. After dependency, enablement, or trust changes, restart the active host and run both live probes again in a new task. In Codex, plugin hooks provide the supported command boundary; do not configure Claude-specific command wrapping as a Codex setup step. In Claude Code, restart the shell and Claude Code only when the optional shell integration changed.
11. Classify each exact host route from the visible host result and Agent Guard
hook output. Do not invent a CLI subcommand, collect settings or traces, or
ask the CLI to attest who made a host decision.
- **Host pre-hook denial:** classify this only when the host itself identifies
a refusal before dispatch and there is no Agent Guard hook response. This
is a host-reported observation; Agent Guard cannot independently verify it.
A generic `PreToolUse blocked` message is not enough to identify the
source.
- **Observed Guard denial:** an Agent Guard policy message and blocked probe
show that this hook route dispatched and denied that probe. It does not
prove a clean command would complete.
- **DEGRADED:** an Agent Guard `DEGRADED` response shows a dispatched hook
whose dependency or policy check could not run. It is neither a clean scan
nor proof of protection.
- **Dispatch only:** a visible response to a harmless sentinel shows only
that exact hook route was reached. It is not normal command completion.
- **Normal completion:** report this only when the hook response is observed
and a separate harmless command on that same route actually exits `0`.
Keep those two observations distinct in the report.
- **Unobserved/unknown:** if no Agent Guard response is visible, dispatch was
not observed, or the source of a generic host message is unclear, report
the route as unobserved/unknown. Do not count a local fixture that bypasses
host dispatch as a successful live probe.
## Safety And Host Boundaries
- Dependency setup is intentionally approval-gated. A SessionStart hook may diagnose and recommend this skill, but it must never install software itself.
- If installation is declined, leave the machine unchanged and state that Agent Guard is in degraded mode.
- The active host protects only surfaces that it actually dispatches to plugin hooks. In Codex, these can include supported `Bash`, `apply_patch`, and MCP calls; do not claim that Codex hooks intercept arbitrary read, grep, web-search, or opaque wrapping-tool calls. In Claude Code, verify the configured matcher and the exact tool route used.
- `agent-guard setup-shell`, `agx`, and command wrapping are Claude Code shell-snapshot integrations. `setup-shell` enables command wrapping by default; `--no-command-wrapping` is the persistent opt-out and `AGENT_GUARD_COMMAND_WRAPPING=off` is the runtime opt-out. Only configure them when the user explicitly asks for Claude Code coverage.
- If plugin hooks are not trusted, enabled, or reached by both live probes, explain that dependencies alone do not activate runtime protection. Never report Agent Guard as operational based only on `check` and `smoke-test`.
© JeongJaeSoon · MIT · JeongJaeSoon/agent-guard