Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/sliday/harn/security-guardnpx skills add sliday/harn --skill security-guardgit clone --depth 1 https://github.com/sliday/harnWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00036 | $0.00798 |
| Opus 5 | $0.00018 | $0.00399 |
| Sonnet 5 | $0.00007 | $0.00160 |
| Haiku 4.5 | $0.00004 | $0.00080 |
Grade C, and why
security-guard scanned grade C with 4 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootlowPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
- `sudo rm` — privileged deletion Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Downloads and executes remote codemediumSupply chain
curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.
- `curl | bash` — piped remote execution Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Recursive force deletemediumDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- `rm -rf` — recursive forced deletion Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- `curl | bash` — piped remote execution How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Security Guard Generator
Generate or update scripts/harness/security_guard.py for the current project.
Process
- Read current
scripts/harness/security_guard.pyif it exists - Ask user what additional patterns to block (or accept defaults)
- Before adding user patterns, verify they compile as valid regex
- Offer to show the user what existing commands would be blocked by the new patterns before activating (--dry-run)
- Generate the updated script with all patterns
- Ensure it's executable
- Verify it's wired in
.claude/settings.jsonas a PreToolUse hook
Default Blocked Patterns
rm -rf— recursive forced deletiongit push ... main/master— direct push to protected brancheschmod 777— reckless permissions> ~/— overwriting home directory filescurl | bash— piped remote executionsudo rm— privileged deletionmkfs.— disk formattingdd if=— raw disk writes
Custom Patterns
Ask the user if they want to:
- Restrict writes to specific directories only (e.g., only
src/) - Block specific package managers (e.g.,
npm publish)
Pattern Validation
Before adding user-supplied patterns, verify they compile as valid regex. Invalid patterns can silently break the guard or cause it to crash. Test each pattern with re.compile() and report errors back to the user before writing the script.
Dry Run
Offer to show the user what existing commands (from shell history or a sample list) would be blocked by the new patterns before activating. This helps catch overly broad patterns that would block legitimate work.
User-Supplied Patterns
User-supplied regex patterns may contain errors — unbalanced groups, invalid escapes, or overly broad expressions. The generated script wraps each re.search() call in a try/except for re.error so that a single bad pattern does not disable the entire guard.
Template
Generate scripts/harness/security_guard.py using this structure:
#!/usr/bin/env python3
# Harn security guard — blocks dangerous shell commands before execution
# Why: https://harn.app/kb/safety.html — "Tools should be hard to misuse"
# Docs: https://harn.app/kb/safety.html — "Mitigating Prompt Injection Attacks"
import json, sys, re
payload = json.load(sys.stdin)
if not isinstance(payload, dict):
sys.exit(0) # Malformed payload — allow (fail-open for non-Bash)
tool = payload.get("tool_name", "")
if tool != "Bash":
sys.exit(0)
command = payload.get("tool_input", {}).get("command", "")
dangerous = [
r"rm\s+-rf",
r"git\s+push\s+.*\b(main|master)\b",
r"chmod\s+777",
r">\s*~/",
r"curl\s+.*\|\s*bash",
r"sudo\s+rm",
r"mkfs\.",
r"dd\s+if=",
]
for pattern in dangerous:
try:
if re.search(pattern, command):
print(f"HARNESS BLOCK: Command matches prohibited pattern ({pattern}).", file=sys.stderr)
print("Find a safer alternative.", file=sys.stderr)
sys.exit(2)
except re.error:
print(f"HARNESS WARNING: Invalid regex pattern skipped: {pattern}", file=sys.stderr)
continue
sys.exit(0)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 95 lines · 36 tokens per session scan C 972d362904fb
security-guard is a skill published in the GitHub repository sliday/harn (5 stars, last pushed 4mo ago), licensed MIT. It adds 36 tokens to every session and 798 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 4 findings (asks for root, downloads and executes remote code, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…