security-audit

A security-audit command for checking, validating, and hardening a repository against its actual security risks.

In plain words
What is it for?
Reviewing a static site repository, testing security claims, checking its documented threat model, and fixing verified issues.
Why use it?
It requires findings to be demonstrated and avoids treating unsupported guesses as vulnerabilities.

Command for Claude Code

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/rewritingthecode/workshop/security-audit
Clone the repo
git clone --depth 1 https://github.com/RewritingTheCode/workshop

Made for: Claude Code.

Per session 17 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,969 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00017 $0.01969
Opus 5 $0.00009 $0.00984
Sonnet 5 $0.00003 $0.00394
Haiku 4.5 $0.00002 $0.00197

Measured yesterday against content hash 8d162db6f979, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

security-audit scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

header is missing, `curl -I` the deployed site or read the config. A finding you could not
.claude/commands/security-audit.md · 134 lines

How it starts

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

Security audit: verify, validate, harden

You are doing an offensive-minded security review of this repository, then fixing what you find. Work through every section. Do not skip a section because it "looks fine" - say what you checked and what the result was.

Rules that override your instincts

  1. Verify, do not pattern-match. Every finding must be demonstrated, not asserted. If you claim a schema accepts a javascript: URL, run it and paste the output. If you claim a header is missing, curl -I the deployed site or read the config. A finding you could not reproduce is not a finding - drop it or label it clearly as unverified.
  2. No invented vulnerabilities. A speculative "an attacker could theoretically..." with no path to impact is noise. Rank by reachability first, severity second.
  3. This is a static site with no backend, no database, no auth, and no user input. That is a deliberate architectural decision (see docs/adr/). Do not propose adding a backend, a WAF, rate limiting, input sanitisation middleware, or auth. Findings that only apply to a server do not apply here. Say so and move on.
  4. Never add a dependency to fix a finding without saying what it is, what it costs, and what the no-dependency alternative was.
  5. Never read, echo, print, or cat .env. Not to check it, not to verify a fix. Prove things about it with git check-ignore, ls -l, and git log instead. This repo is demoed on a shared screen.
  6. Follow the loop in CLAUDE.md. Anything you change gets an ADR in docs/adr/ first and a test that would fail without the fix.

Threat model - who actually attacks this

Rank findings against these, in order. If a finding does not serve one of them, it is a nice-to-have and should be labelled as such.

  • T1 - Credential leak. The Netlify token, in the repo, in git history, in the build output, in CI logs, on a shared screen. This is the one that costs real money and a real account takeover.
  • T2 - Supply chain. A malicious or compromised npm package or GitHub Action running with the deploy token in its environment. The deploy step is the crown jewel: it has the token.
  • T3 - Content injection. This is a template. Strangers fork it and paste content in from resumes, from LLM output, from a friend. Content is untrusted input to this codebase even though it lives in a .ts file.
  • T4 - The visitor's browser. Clickjacking, MIME sniffing, referrer leakage, mixed content, reverse tabnabbing, and whatever a stray injected script would be able to reach.
  • T5 - Doxxing the author. A real resume in the repo, a home address in a PDF's metadata, an email harvested from the built page. Low severity for a machine, high for a person.

Read the full file on GitHub · 134 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. yesterday First seen · 134 lines · 17 tokens per session scan A 8d162db6f979

Subscribe to this mod's changes

security-audit is a command published in the GitHub repository RewritingTheCode/workshop (10 stars, last pushed 5d ago), licensed MIT. It adds 17 tokens to every session and 1,969 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.