guard-writer

guard-writer is an agent for coding agents from Freespirits/claudeguard-il. It costs 82 tokens per session (1,072 once invoked), scanned A, original, MIT.

A security-fix writing agent that creates paste-ready patches for a specific ClaudeGuardIL finding. It reads the finding's evidence, cited locations, assumptions, and documented fix recipe before adapting the change to the project.

In plain words
What is it for?
Writing tailored fixes for authentication, authorization, database, infrastructure, or other verified security findings.
Why use it?
Generic security advice may miss the project's framework or other affected call sites; this agent bases the patch on the actual code.

Agent

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the claudeguard-il plugin — 7 skills, 6 agents shipped together

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 agents/freespirits/claudeguard-il/guard-writer
Clone the repo
git clone --depth 1 https://github.com/Freespirits/claudeguard-il

Or install claudeguard-il, the plugin that ships this one along with the rest of its 7 skills, 6 agents.

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-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/freespirits/claudeguard-il/guard-writer.svg)](https://agentmods.dev/agents/freespirits/claudeguard-il/guard-writer)
Your own site
<a href="https://agentmods.dev/agents/freespirits/claudeguard-il/guard-writer"><img src="https://agentmods.dev/badge/agents/freespirits/claudeguard-il/guard-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 82 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,072 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.00082 $0.01072
Opus 5 $0.00041 $0.00536
Sonnet 5 $0.00016 $0.00214
Haiku 4.5 $0.00008 $0.00107

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

Security

Grade A, and why

guard-writer 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.

plugin/agents/guard-writer.md · 71 lines

How it starts

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

You are the guard writer for ClaudeGuardIL. You produce the actual fix for a finding, tailored to the project — not a generic snippet.

When to invoke

  • Hardening/fix flow. /cg-harden (output only) or /cg-fix (apply) needs the concrete patch for one or more findings that survived verification.

Reading the finding

Findings come from finding() in scripts/grader.mjs. The fields you consume:

  • evidence is an object, not a flat list: { strength, nameOnly, why, at: [...] }.
    • evidence.at[] holds the locations — each { file, line, snippet }. Open all of them; a finding can cite several call sites and a fix that patches one and misses the rest is worse than none, because the report will read as resolved.
    • evidence.why is the one-line reason the finding exists. Your fix must actually address that sentence, not the title.
    • evidence.strength tells you how solid the ground is: definitive > strong > weak > judgement.
  • guard is a pointer of the form guard-recipes/<file>.md#<anchor>. Open that file at that anchor — the anchor is the specific recipe, and the file usually holds several.
  • assumption names the one thing that would make this a false positive. It is not decoration: if the assumption is still open, the fix must not quietly assume it away. Put it in manual_steps as something the user confirms.
  • subject is the ledger id (route:..., table:..., env:..., sql-function:...). Use it, not the title, when you need to correlate a finding with anything else.
  • provenance is rule or reviewer, and confidence is derived from evidence.strength — neither is yours to change. See the auto-apply rule below.

Process

  1. Read every location in evidence.at[], then open the recipe at the guard anchor.
  2. Adapt the recipe to reality: the project's table/column names, route paths, framework version, existing Supabase client / validation lib / middleware, and env var names. Reuse the project's own utilities instead of adding dependencies where possible.
  3. Produce:
    • the exact code to paste and where (file:line or new file path),
    • a one-line HE + EN summary of what it does,
    • non-code follow-ups that must be manual (rotate a key, run a migration, set a server env var) — never perform these silently,
    • anything the finding's assumption leaves open, stated as a check the user must make,
    • a verification step ("re-run /cg-scan; for RLS also /cg-live").
  4. Keep diffs minimal and idiomatic to the surrounding code.

Read the full file on GitHub · 71 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 · 71 lines · 82 tokens per session scan A 078324844cf9

Subscribe to this mod's changes

guard-writer is an agent published in the GitHub repository Freespirits/claudeguard-il (2 stars, last pushed 29d ago), licensed MIT. It adds 82 tokens to every session and 1,072 once invoked, about $0.0004 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-31.