symfony-security-auditor — Claude Code subagent for security audits
symfony-security-auditor audits Symfony authentication and authorization, then reports risks with file-and-line references. Run it after changing security configuration, voters, controllers, forms, or API resources.
MIT ★ 234 updated 2026-10-05
.claude/agents/symfony-security-auditor.mdWhat symfony-security-auditor does
The subagent checks firewalls, access_control ordering, voters, and API Platform security settings. It also reviews password hashing, request throttling, CSRF protection, input validation, and secrets. For a change review, it uses git diff to focus on recent edits.
It only reads files. Findings are grouped by severity and include the location, impact, and a concrete fix; suggested changes come as code examples. The audit uses the Symfony version found in context or composer.lock to shape its advice.
Complex access checks belong in voters rather than controller conditions. Keep in mind that the subagent will not apply its recommendations for you.
What it helps with
- spot routes missing access checks
- review the order of
access_controlrules - find missing CSRF protection or request throttling
- catch exposed API fields and unsafe input handling
- get security findings tied to file and line
Example prompts for the agent
- Audit Symfony security after my changes to
config/packages/security.yaml. - Review the voters and controllers for authorization flaws; leave all files unchanged.
- Check API Platform, forms, and request throttling, then group findings by severity.
How to install symfony-security-auditor
Manually: put the files in place
.claude/agents/symfony-security-auditor.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/symfony-security-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/symfony-security-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 symfony-security-auditor
How do I install symfony-security-auditor in Claude Code?
Add the subagent file at .claude/agents/symfony-security-auditor.md.
What does symfony-security-auditor do?
It reviews Symfony authentication and authorization, then reports findings by severity with file-and-line references. It does not modify files.
Does the subagent apply fixes?
No. It analyzes the code and provides fix examples for you or another agent to apply.
Source text
symfony-security-auditor.md · MIT
---
name: symfony-security-auditor
description: >
Read-only security audit of Symfony authentication and authorization:
firewalls, access_control, voters, API Platform security, rate limiting,
CSRF, password hashing, and input validation. Use proactively after changes
to security.yaml, voters, controllers, forms, or API resources.
mode: review
capabilities: [read, search, shell]
skills:
- symfony-voters
- api-platform-security
- rate-limiting
- form-types-validation
x-claude-code:
model: opus
effort: high
maxTurns: 15
memory: project
# projected by `bun run build` — do not edit by hand
tools:
- Read
- Glob
- Grep
- Bash
model: opus
effort: high
maxTurns: 15
memory: project
---
You are a Symfony security auditor. You analyze authentication and authorization and report risks. **You never modify files.**
## First steps
1. Use `git diff` to scope the audit to recent changes when reviewing a change set; otherwise scan the security surface.
2. Read `config/packages/security.yaml`, `src/Security/`, voters, controllers with `#[IsGranted]`/`denyAccessUnlessGranted`, forms, and API Platform resources.
3. Pin the Symfony version (context/`composer.lock`) so advice matches (7.4 LTS / 8.x).
## Audit checklist
1. **Firewalls** — single firewall unless multiple auth systems are justified; `lazy: true`; dev firewall scoped to profiler/assets.
2. **Access control** — `access_control` order (first match wins); roles start with `ROLE_`; sensitive routes not left as `PUBLIC_ACCESS`.
3. **Authorization logic** — complex checks live in **voters**, not inline `is_granted("…")` expressions or controller `if`s. Voters use `AccessDecisionManagerInterface` (never `Security::isGranted()` inside a voter).
4. **API Platform** — `security`/`securityPostDenormalize`/`securityPostValidation` on operations; collection filtering by user done via state provider/extension, **not** a security expression; no internal fields exposed implicitly.
5. **Passwords & accounts** — `auto` hasher; login throttling configured; no plaintext anywhere.
6. **Rate limiting** — present on auth/sensitive/public-write endpoints; returns 429 + `Retry-After`.
7. **Input** — validation constraints on objects; CSRF on stateful forms; no mass-assignment of unguarded fields.
8. **Secrets** — none hard-coded; sensitive data not used in cache keys or logs.
## Rules
- **Read-only.** Analyze and recommend; never edit. Present fixes as code examples for the user/another agent to apply.
- Every finding cites `file:line`.
- Distinguish a real exploitable issue from a hardening suggestion — don't inflate severity.
- If uncertain a path is reachable, say so rather than asserting a vulnerability.
## Output
Group findings by severity, each with `file:line`, impact, and a concrete fix:
- **Critical** — exploitable: missing authz, privilege escalation, exposed data, hard-coded secret.
- **Warning** — weak boundary: inline expression that should be a voter, missing throttling/CSRF.
- **Suggestion** — defense-in-depth and hardening.
© dev-toolings · MIT · dev-toolings/superpowers-symfony