From ywc-agent-toolkit
Audits code against OWASP Top 10 and project-specific threats, focusing on authentication/authorization, external-facing endpoints, and sensitive data handling.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ywc-agent-toolkit:ywc-security-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Announce at start:** "I'm using the ywc-security-audit skill to inspect the code against OWASP Top 10 and project-specific threats."
Announce at start: "I'm using the ywc-security-audit skill to inspect the code against OWASP Top 10 and project-specific threats."
Security Agent Skill for deep security analysis.
When tempted to skip a step, check this table first:
| Excuse | Reality |
|---|---|
| "Code looks clean, OWASP scan is overkill" | Clean code can still leak. Walk OWASP Top 10 in order — every item, every time. |
| "This is internal-only, threat surface is low" | Internal-only ≠ trusted. Insider threat and lateral movement are real. Audit anyway. |
| "Auth library is well-known, trust it blindly" | Misuse of a good library is the #1 cause of auth bugs. Audit how it is configured. |
| "Severity feels High, mark it Critical to be safe" | Inflated severity wastes triage time. Use Critical only when exploit + impact are both demonstrable. |
| "User input is validated upstream, no need at this layer" | Defense in depth. Validate at every trust boundary, not just at the gateway. |
| "Token/secret/key is just for dev, exposure is fine" | Never. Dev secrets get committed, leak, and become prod credentials. Always flag. |
| "I cannot exploit it locally, finding is theoretical" | Theoretical findings still belong in the report. Mark as unverified — theoretical rather than dropping. |
| "OWASP scan is too fine-grained to parallelize" | Grouping into 3 domain clusters lets each Sonnet subagent focus deeply on 3-4 items; it also prevents cross-category contamination that degrades severity classification in a monolithic pass. |
Violating the letter of these rules is violating the spirit. A clean security report without honest dimensional coverage is dangerous.
| Parameter | Format | Example | Description |
|---|---|---|---|
--code | --code <path> | --code api/src/middleware/ | Code path to audit (required) |
--format | --format markdown|html | --format html | Output format. Default markdown. With html, writes a self-contained HTML report to claudedocs/. See html-output.md |
Collect Project Context — Read CLAUDE.md, package.json to identify tech stack. Pay special attention to authentication method, deployment environment (internal/external), and security libraries in use
Read Target Code Files — Read all source files under the --code path
Phase 1 — Parallel OWASP Analysis — Use the Task tool to spawn 3 Sonnet subagents in parallel. Each covers a grouped slice of OWASP Top 10. For each item in their slice, subagents must: Grep/AST search for patterns, trace data flow (input → processing → output), and apply project context. When the Claude Code runtime is in use and the named-agent catalog at claude-code/agents/ is installed, prefer subagent_type: ywc-security-engineer so each subagent carries the dedicated security worker persona, Mission, Boundaries, and Return Contract.
| Subagent | Model | OWASP Items |
|---|---|---|
| Auth & Data | sonnet | A01 Injection · A02 Broken Auth · A03 Sensitive Data Exposure |
| Web Layer | sonnet | A04 XSS · A05 Broken Access Control · A06 Security Misconfiguration · PI Prompt Injection (LLM-driven surfaces only — user-controlled string → prompt sink; see references/prompt-injection-checklist.md) |
| Infra & Input | sonnet | A07 SSRF · A08 Input Validation · A09 Rate Limiting · A10 Timing Attacks |
Prompt-Injection slice (Web Layer sub-category) — when the audit target includes an LLM-driven surface (agent / chatbot / prompt-template system / function-calling pipeline), the Web Layer subagent additionally walks the four items in references/prompt-injection-checklist.md: user-controlled string flowing directly into a prompt, system/user role separation, canary-token + ML-classifier defense, and external-tool / RAG-result sanitization. The checklist defines default severity and conditions for adjustment. Findings surface under the standard severity rubric below and are reported alongside the OWASP A04-A06 items in the Web Layer subagent's output.
Each subagent classifies its findings:
Each subagent returns:
Aggregate Phase 1 Results — Combine findings from all 3 subagents. Deduplicate by {file}:{line}. Cap advisor candidates at advisor_budget (default: 3), prioritizing Critical > High. Log any dropped candidates in the report.
Phase 2 — Advisor Pass — For each surviving advisor candidate, follow the Advisor Escalation Policy section below. Spawn a short Opus subagent via the Task tool with only the bounded excerpt (≤100 lines). Merge verdicts into the findings list.
Output Severity-Classified Security Report
references/prompt-injection-checklist.md)## Security Audit Result: {target path}
### Summary
- Critical: N, High: M, Medium: K, Low: L
### Findings
1. [{severity}] {file}:{line}
- Issue: ...
- Risk: ...
- Recommended Fix: ...
### Overall Assessment
(Comprehensive security posture summary)
HTML mode (
--format html) — emits the same findings as a self-contained HTML report: severity color coding, tab navigation, and aCopy as Markdownbutton. Structure and conventions follow html-output.md. The Markdown surface is preserved inside the file, so downstream integration is unaffected.
This skill runs the full OWASP Top 10 deep analysis on a single inherited-model executor. Because security findings are the highest-stakes output category in this repository, the executor applies a permissive escalation bar: when a suspected Critical or High finding has indirect evidence, escalate rather than risk mislabeling. This follows Pattern A from advisor-pattern.md — frontier judgment applied at the specific decision points where it carries real value.
Budget: up to 3 Opus advisor calls per invocation. Security gets a slightly larger budget than spec-review because the downside cost of a missed vulnerability is much higher than the downside cost of a missed spec gap. Unused budget is still good; the bar for escalation must still be met.
Escalation conditions — a finding is an advisor candidate when it matches any of the following:
Context payload rules (critical for cost discipline):
Non-goals — do NOT escalate for these:
Report escalations in the output: mark Phase 2 findings with [P2] prefix and include the advisor's verdict. This preserves auditability of which security calls involved frontier judgment and lets the user calibrate their trust in the severity assignments.
npx claudepluginhub yongwoon/ywc-agent-toolkitGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.