symfony-agent-mcp: Command for Claude Code

.claude/commands/security-audit.md

security-audit is a command for Claude Code from shakaran/symfony-agent-mcp. It costs 0 tokens per session (1,313 once invoked), scanned A, original, MIT.

A command for checking a Symfony MCP server codebase for security weaknesses. Symfony is a PHP framework, and an MCP server provides tools that an AI agent can call.

In plain words
What is it for?
Use it to review tool code and its input, path, audit-log, and output-sanitizing security pipeline.
Why use it?
It helps identify unsafe file paths, exposed credentials, weak secret masking, problematic regular expressions, and related risks before they cause harm.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

This is shakaran/symfony-agent-mcp's own configuration. It tells Claude Code how to work on symfony-agent-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything symfony-agent-mcp configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node node_modules/jest/bin/jest.js --maxWorkers=1 --forceExit.

Reuse

Borrowing it

Nothing to install: this file belongs to shakaran/symfony-agent-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shakaran/symfony-agent-mcp/main/.claude/commands/security-audit.md
Clone the repo
git clone --depth 1 https://github.com/shakaran/symfony-agent-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/shakaran/symfony-agent-mcp/security-audit.svg)](https://agentmods.dev/commands/shakaran/symfony-agent-mcp/security-audit)
Your own site
<a href="https://agentmods.dev/commands/shakaran/symfony-agent-mcp/security-audit"><img src="https://agentmods.dev/badge/commands/shakaran/symfony-agent-mcp/security-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,313 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01313
Opus 5 $0.00000 $0.00656
Sonnet 5 $0.00000 $0.00263
Haiku 4.5 $0.00000 $0.00131

Measured 7d ago against content hash 95cb28f46471, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

security-audit scanned grade A with 0 findings 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 7d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/security-audit.md · 124 lines

How it starts

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

Security Audit — symfony-agent-mcp

Run a comprehensive security audit of the Symfony MCP server codebase.

Architecture context

The security pipeline in server.ts is applied to every tool call:

validateToolArgs()       ← input-validator.ts: schema + PATH_SAFE regex
  → guardAppPath()       ← app-guard.ts: path traversal + symlink + allowlist
    → withAudit()        ← audit-logger.ts: encrypted audit log
      → tool handler()   ← src/tools/*.ts
    → sanitizeToolResult() ← output-sanitizer.ts: DLP + injection filter + size cap

What to look for in tool files

Real vulnerabilities:

  • Secondary user-supplied param (not app_path) joined into a filesystem path without containment check
  • Regex with nested quantifiers (a+)+ on large file content (no file size guard)
  • DSN/URL credentials not caught by DLP: ?password= query-string, redis://:pass@, redis://token@host
  • HTTP headers Authorization, X-Api-Key emitted verbatim (DLP only catches JWT-format tokens)
  • Env var masking missing: PASS, KEY, DSN, AUTH, CERT
  • Stateful /g regex with lastIndex shared across loop iterations → false negatives

Not vulnerabilities (pipeline handles them):

  • Reading files under appPath — guardAppPath validated it
  • Returning credential-shaped strings — DLP redacts AWS keys, JWTs, PEM blocks, URLs with user:pass@host
  • Large output — size cap enforced
  • Missing per-tool input validation — validateToolArgs handles it centrally

Key utility files

File Purpose
src/utils/dlp-detector.ts DLP patterns: AWS, GitHub, Stripe, Slack, SendGrid, JWT, PEM, CREDENTIALS_IN_URL
src/utils/app-guard.ts Path traversal prevention, symlink resolution, allowlist
src/utils/input-validator.ts TOOL_SCHEMAS — all tool params with type/length/pattern constraints
src/utils/output-sanitizer.ts Wraps DLP + prompt injection + size cap
src/utils/prompt-injection-detector.ts 9 regex patterns; see PATTERNS array for exact syntax
src/utils/startup-audit.ts Warns on missing SIGNING_SECRET, SESSION_SECRET, DLP disabled, key TTL
src/utils/audit-logger.ts AES-256-GCM encrypted audit log, key rotation (SIGUSR2), TTL enforcement
src/utils/anomaly-detector.ts Detects PATH_TRAVERSAL_PROBE, TOOL_SCANNING, AUTH_FAILURE_SPIKE, etc.
src/utils/vault-resolver.ts HashiCorp Vault + AWS Secrets Manager integration
src/fuzz/generators.ts Deterministic PRNG + SECRET_SAMPLES / INJECTION_SAMPLES for fuzz tests

Read the full file on GitHub · 124 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. 7d ago First seen · 124 lines · 0 tokens per session scan A 95cb28f46471

Subscribe to this mod's changes

security-audit is a command published in the GitHub repository shakaran/symfony-agent-mcp (0 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,313 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.