guard

guard is a command for coding agents from AR6420/Hail_Hydra. It costs 14 tokens per session (564 once invoked), scanned A, original, MIT.

A manual Hydra scan command for checking selected files or directories for security vulnerabilities and common code-quality problems.

In plain words
What is it for?
Scanning specified files, or changed files when no target is given, before committing or sharing code.
Why use it?
It provides a focused review for issues such as exposed secrets, injection risks, unsafe deserialization, debug code, and missing error handling.

Command

Install

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.

agentmods
npx agentmods add commands/ar6420/hail_hydra/guard
Clone the repo
git clone --depth 1 https://github.com/AR6420/Hail_Hydra

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for guard

README.md
[![agentmods](https://agentmods.dev/badge/commands/ar6420/hail_hydra/guard.svg)](https://agentmods.dev/commands/ar6420/hail_hydra/guard)
Your own site
<a href="https://agentmods.dev/commands/ar6420/hail_hydra/guard"><img src="https://agentmods.dev/badge/commands/ar6420/hail_hydra/guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 564 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.00564
Opus 5 $0.00007 $0.00282
Sonnet 5 $0.00003 $0.00113
Haiku 4.5 $0.00001 $0.00056

Measured 5d ago against content hash 7aa50e0b2e2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

guard scanned grade A with 0 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 5d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

content/commands/guard.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hydra Guard — Manual Security Scan

Run a focused security and quality scan on the specified files.

Target: $ARGUMENTS

If no arguments provided, scan all files changed since the last commit:

git diff --name-only HEAD 2>/dev/null || echo "Not a git repository or no changes"

Scan Checklist

For each target file, check for:

CRITICAL (security)

  • Hardcoded secrets, API keys, tokens, passwords (patterns: sk-, ghp_, AKIA, password =, secret =, token =, api_key =)
  • SQL injection vulnerabilities (string concatenation in queries)
  • XSS vulnerabilities (unescaped user input in HTML output)
  • Unsafe deserialization (eval(), pickle.loads(), unserialize())
  • Path traversal (../ in file operations without validation)
  • Command injection (user input passed to shell commands)

WARNING (quality)

  • console.log / print() debug leftovers
  • TODO/FIXME/HACK comments
  • Unused imports (obvious cases only)
  • Missing error handling on async operations (no try/catch, no .catch())
  • Empty catch blocks
  • Hardcoded URLs or magic numbers without constants

INFO (style)

  • Functions longer than 100 lines
  • Deeply nested conditionals (3+ levels)
  • Inconsistent naming conventions within the same file

Output Format

🐉 Hydra Guard — Security & Quality Report
═══════════════════════════════════════════
Files scanned: 3

🔴 CRITICAL (2 findings)
  src/auth.py:45     Hardcoded API key: OPENAI_KEY = "sk-..."
  src/db.py:78       SQL injection: f-string in query construction

⚠️  WARNING (3 findings)
  src/auth.py:12     console.log left in production code
  src/utils.py:89    Empty catch block — errors silently swallowed
  src/api.py:34      TODO: "fix this later" (line 34)

ℹ️  INFO (1 finding)
  src/handler.py:1   Function process_request is 142 lines long

Summary: 2 critical · 3 warnings · 1 info

If no issues found:

🐉 Hydra Guard — All Clear ✅
Files scanned: 3 | No issues found.

Important: This is a FAST scan, not a deep audit. For thorough security review, use hydra-analyst instead.

Read the full file on GitHub · 72 lines

Changes

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.

  1. 5d ago First seen · 72 lines · 14 tokens per session scan A 7aa50e0b2e2e

Subscribe to this mod's changes

guard is a command published in the GitHub repository AR6420/Hail_Hydra (48 stars, last pushed 24d ago), licensed MIT. It adds 14 tokens to every session and 564 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.