Skip to main content
subagent CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/symfony-security-auditor.md
Open on GitHub

What 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_control rules
  • 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.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

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

Similar subagents

All subagents for Security →

From the same set51

The whole set →
api-platform-dto-resources The api-platform-dto-resources skill decouples your API contract from Doctrine entities in API Platform via Symfony's Object Mapper. CX Codex +1 ★ 234repo stars api-platform-filters api-platform-filters tells the agent how to wire search, range, date and boolean filters into API Platform collection endpoints in Symfony, and how to leave the deprecated attribute behind. CX Codex +1 ★ 234repo stars doctrine-performance-optimizer doctrine-performance-optimizer audits Doctrine ORM code in read-only mode to detect looped relation queries, evaluate fetch strategies, and suggest DTO hydration, batch processing, or database indexes. CX Codex ★ 234repo stars symfony-reviewer symfony-reviewer reviews changed Symfony files for architecture, security, and framework conventions. Run it after edits or ask for a code review. CX Codex ★ 234repo stars doctrine-architect doctrine-architect — a read-only subagent that opens your Symfony entities and migrations, then hands back a relation map with a migration plan. CX Codex ★ 234repo stars symfony-tdd-coach symfony-tdd-coach — a subagent guiding TDD workflows in Symfony apps using Pest PHP or PHPUnit. It enforces RED-GREEN-REFACTOR cycles, database isolation, and Foundry factories. CX Codex ★ 234repo stars api-platform-builder api-platform-builder builds API Platform resources in Symfony projects: entity, operations, DTOs, state provider and processor, access rules, tests. It covers the whole path to a tested endpoint. CX Codex ★ 234repo stars symfony-engineer symfony-engineer implements idiomatic Symfony application code from controllers to DTOs and forms. Useful for day-to-day backend development and service autowiring. CX Codex ★ 234repo stars

Project sponsors

Companies that keep this analytics open