api-security-audit — Claude Code subagent: REST API security review
A subagent that hunts for holes in REST API authentication, authorization and data handling. Handy before a release or after an incident.
npx claude-code-templates@latest --agent security/api-security-auditWhat api-security-audit does
The subagent walks through a REST API on several fronts: token and session handling, role checks and access control bypasses, injection flaws, exposure of sensitive data. It also looks at GDPR, HIPAA and PCI DSS requirements, plus OWASP API Top 10 items, security headers and rate limiting.
It runs with Read, Write, Edit and Bash, so it can read project files, change them and execute commands. Findings come back as concrete fixes with code samples rather than vague advice. Typical jobs: a pre-release audit, incident triage, or a review of the security architecture.
Everything rests on the code sitting in your project, so without source access there is little to work with. The author suggests reaching for the agent early instead of waiting for a problem to surface in production.
What it helps with
- check JWT and session handling for weak spots
- trace privilege escalation and access control bypasses
- assess SQL and NoSQL injection risk in request handlers
- map an API against GDPR, HIPAA or PCI DSS rules
- work through an incident and get remediation steps
Example prompts for the agent
- Review the authentication in this REST API and list the weak points
- Find authorization bypasses in the role-protected endpoints
- Audit this API against the OWASP API Top 10
How to install api-security-audit
1claude-code-templates
npx claude-code-templates@latest --agent security/api-security-audit2Manually: put the files in place
.claude/agents/api-security-audit.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/api-security-audit.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/api-security-audit.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 api-security-audit
How do I install api-security-audit in Claude Code?
Run npx claude-code-templates@latest --agent security/api-security-audit, then confirm the agent file landed at .claude/agents/api-security-audit.md.
What does api-security-audit do?
It looks for REST API vulnerabilities: token and session problems, authorization gaps, injection attacks, data exposure. It also checks the API against security standards.
Which tools can the subagent use?
Read, Write, Edit and Bash. That means it can inspect project code, edit files and run terminal commands.