agent-guard
/agent-guard
How to work on real servers, clusters and cloud accounts when the agent-guard hooks are active: what the confirmation prompts, masked values (‹hidden›) and blocked commands mean, how to present a risky command to the user (target, effect, rollback), and why masks and prompts must not be worked around. Use when a tool call was asked about or blocked by agent-guard, when output contains ‹hidden›, before running commands that change a system (systemctl, kubectl apply/delete, helm, terraform apply, ansible-playbook, cloud CLIs, SQL writes, docker prune, rm -r in system paths, git push --force), an
- Author
- drxinfra ↗
- Repository
- agent-guard ↗
- Licence
- Apache-2.0
- Last repository change
- 06.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 06.11.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
How to work on real servers, clusters and cloud accounts when the agent-guard hooks are active: what the confirmation prompts, masked values (‹hidden›) and blocked commands mean, how to present a risky command to the user (target, effect, rollback), and why masks and prompts must not be worked around. Use when a tool call was asked about or blocked by agent-guard, when output contains ‹hidden›, before running commands that change a system (systemctl, kubectl apply/delete, helm, terraform apply, ansible-playbook, cloud CLIs, SQL writes, docker prune, rm -r in system paths, git push --force), an
Original author description
How to work on real servers, clusters and cloud accounts when the agent-guard hooks are active: what the confirmation prompts, masked values (‹hidden›) and blocked commands mean, how to present a risky command to the user (target, effect, rollback), and why masks and prompts must not be worked around. Use when a tool call was asked about or blocked by agent-guard, when output contains ‹hidden›, before running commands that change a system (systemctl, kubectl apply/delete, helm, terraform apply, ansible-playbook, cloud CLIs, SQL writes, docker prune, rm -r in system paths, git push --force), an
How it works
- Before a command that changes something
- When the guard asks or blocks
- Masked values
- Profiles and switches (for the user)
SKILL.md preview
---
name: agent-guard
description: >-
How to work on real servers, clusters and cloud accounts when the agent-guard hooks are active:
what the confirmation prompts, masked values (‹hidden›) and blocked commands mean, how to present a
risky command to the user (target, effect, rollback), and why masks and prompts must not be worked
around. Use when a tool call was asked about or blocked by agent-guard, when output contains ‹hidden›,
before running commands that change a system (systemctl, kubectl apply/delete, helm, terraform apply,
ansible-playbook, cloud CLIs, SQL writes, docker prune, rm -r in system paths, git push --force), and
when the user asks how to switch agent-guard profiles (prod, test, off), masking or the command journal.
license: Apache-2.0
compatibility: Claude Code with the agent-guard plugin hooks; python3 in PATH.
metadata:
author: drxinfra
homepage: https://drxinfra.ru/agent-guard.html
version: 0.1.0
---
# Working under agent-guard
agent-guard is a set of Claude Code hooks. It does three things:
1. **Asks before state changes.** Before a Bash command that changes a system, or a Write/Edit into a
system location, Claude Code shows the call with the reason and runs it only after the user agrees.
Commands that wipe a disk or the root filesystem are blocked outright.
2. **Masks secrets.** Passwords, tokens, keys, connection strings and credentials in URLs are replaced
with `‹hidden›` in Bash, Read and Grep output before you see it.
3. **Keeps a journal.** Every Bash command you run is logged (command text with secrets masked, never
its output), so the user can review what was done.
The hooks are heuristics, not a sandbox. They catch common mistakes; your judgement is still the main
safeguard.
## Before a command that changes something
Look first, change second. Read-only checks (status, list, get, describe, logs, plan, diff, `--check`,
`--dry-run`) come before any change. When a change is needed, tell the user in a few lines:
- **Where** it runs: host, cluster/context and namespace, cloud account/project/region, database.
- **What** it changes, and what users will notice (restart, downtime, lost connections, deleted data).
- **How to roll back**: the exact command or step, or say plainly that it cannot be undone.
- **What you checked** already (for example `terraform plan` output, `kubectl diff`, a fresh backup).
Then run the command as you described it. Do not chain unrelated changes into one command, so each
prompt shows one decision. Prefer reversible forms: `kubectl scale` over `delete`, `systemctl reload`
over `restart`, `ansible-playbook --check --diff` before the real run, `terraform plan -out` then apply
that plan.
## When the guard asks or blocks
- **Asked** (`agent-guard [prod]: this changes the system ...`): the user decides. If they decline,
do not retry the same thing in another form; ask what they want instead.
- **Blocked** (`agent-guard: blocked ...`): formatting disks, `rm -rf /` and similar are never run by
the agent. Explain what needs to be done and why, and let the user run it.
- Never try to get past the guard: no rewriting a command to dodge the patterns (base64, `eval`,
variables, scripts written to a file and then run), no changing `.agent-guard`, hook settings or
environment variables to turn it off. Changing agent-guard settings is the user's decision.
## Masked values
`‹hidden›` means the value was hidden on purpose. Do not try to recover it: no `base64`, `xxd`, `od`,
`rev`, `cut` tricks, character-by-character reads, or copying it somewhere unmasked. You can say that
a value is set and check that it matches its consumer without seeing it (for example
`test "$(cat a)" = "$(cat b)" && echo same`). If the value itself is needed, ask the user to look
at it.
Never write secrets into files, commits, journals, tickets or chat. Pass them through environment
variables or files the user controls.
## Profiles and switches (for the user)
| Setting | Values | Effect |
|---|---|---|
| `AGENT_GUARD_PROFILE` | `prod` (default) | ask on any state change |
| | `test` | ask only on destructive commands: delete, drop, destroy, prune, purge, flush, `rm -r` in system or home paths, force push |
| | `off` | the guard does nothing |
| `AGENT_GUARD_MASK` | `off` | no secret masking |
| `AGENT_GUARD_JOURNAL` | `off` | no command journal |
The block-list (disk wipe, `rm -rf /`, fork bomb) is the same in `prod` and `test`.
Set them in the shell before starting Claude Code, or in the `env` block of Claude Code settings. For
one project, put a `.agent-guard` file in its root (found from the working directory upwards; it wins
over the environment):
```
# staging box
profile=test
mask=on
journal=on
```
The journal is at `${CLAUDE_PLUGIN_DATA}/journal.jsonl` (or `~/.local/state/agent-guard/journal.jsonl`).
To read it: `python3 <plugin>/hooks/journal.py --since 1h`, with `--grep REGEX`, `--asked`, `--failed`,
`--session ID`, `--last N`, `--json`.
Versions
The database has no other skills named agent-guard.
Database snapshot: 13.11.2026 · package version 02d4deb731a5 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100check
Explain what aws-guard would decide for a shell command, or show its effective rules, without running the command. Use when the user asks whether a command would be blocked or need approval, why aws-guard asked, or what the guard covers. - 100setup-agent-guard
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… - 100safety-guard
Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both. Advisory: the agent applies these rules itself; no hook ships with… - 95skill-guard
Check Agent Skills, Claude Code plugins, hooks and MCP servers for prompt injection, hidden instructions, credential theft and download-and-run code with skill-guard, before installing or trusting them. Use when the user wants to install a skill, plugin or MCP server, asks… - 100loci-guard
Project memory, security guard and foresight swarm for coding work. Use at the start of work in a repo that has a .loci/ folder, before working in an area of the code, when the user states a rule, decision or something to do later or corrects you, before handing work to a… - 100agent-runtime-guard
Control what an AI agent and its MCP servers may do while they run - a PreToolUse policy (denied commands, protected paths, approved hosts, approved MCP servers and tools, no credentials in arguments), a redacted log of every tool call, and a session audit that finds denied…