read-only-auditor — Claude Code subagent: security audit without edits
read-only-auditor — a security audit subagent that cannot touch your files. Hooks in its frontmatter block Write, Edit, and Bash for the whole session.
no license 434 installs updated 2026-10-24
npx claude-code-templates@latest --agent security/read-only-auditorWhat read-only-auditor does
Most audit prompts rely on trust: you ask the model not to change anything and hope it complies. read-only-auditor takes a different path. PreToolUse hooks reject Write, Edit, and Bash calls before they run, so the read-only guarantee is enforced by the system.
Coverage includes hardcoded credentials, SQL injection through raw queries, XSS, path traversal, permissive CORS, and debug endpoints left in production config. For each finding it records the file path, line number, vulnerability class, and severity from Critical down to Low. Fixes are described in prose, never applied to the code.
It uses only Read, Grep, and Glob, with the sonnet model. The report ends with a table sorted by severity and a note that no files were modified.
Installation drops .claude/agents/read-only-auditor.md into your project. For PCI-DSS reviews of payment code or pre-merge audits, the guarantee being mechanical rather than conversational matters.
What it helps with
- Run a security audit that cannot alter the codebase
- Check payment processing code for PCI-DSS issues safely
- Find hardcoded secrets and JWT misconfigurations
- Produce a severity-ranked report for each finding
- Audit a branch before merge without touching it
Example prompts for the agent
- Audit
src/payments/for PCI-DSS compliance, do not change anything - Review
src/auth/for hardcoded secrets and JWT problems - Run a read-only audit of
app/before merging to main
How to install read-only-auditor
1claude-code-templates
npx claude-code-templates@latest --agent security/read-only-auditor2Manually: put the files in place
.claude/agents/read-only-auditor.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/read-only-auditor.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/read-only-auditor.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about read-only-auditor
How do I install read-only-auditor in Claude Code?
Run npx claude-code-templates@latest --agent security/read-only-auditor. This creates .claude/agents/read-only-auditor.md and the subagent becomes available in your project.
What does read-only-auditor do?
It performs a security audit with write access blocked at the hook level. Write, Edit, and Bash calls are rejected automatically, so files stay untouched even if the model tries to modify them.
How is it different from just prompting the model to stay read-only?
The restriction lives in PreToolUse hooks, not in a polite instruction. An attempt to call Write, Edit, or Bash is interrupted before execution, which a plain prompt cannot guarantee.