/security-audit — OWASP-Coverage Security Audit
Comprehensive security scan with OWASP Top 10 (Web 2021) + OWASP GenAI/LLM Top 10 (2025) coverage. Diagnostic + automated fixes for safe issues + remediation plan for the rest. No effort estimates — security agent does not size remediation work; user/PM owns sizing per Q2.
When to use
- Pre-release security audit
- Compliance check (SOC 2, ISO 27001, PCI-DSS)
- Threat modeling exercise
- Vulnerability scan after dependency update
- Periodic (quarterly) security health check
Not for
- Code-review security feedback (line-level) →
/code-review (uses code-review skill with security-checklist companion)
- Penetration testing → professional pen-test service
- Production incident response → on-call SRE +
/analyze-prod
Invocation
/security-audit
/security-audit --scope "secrets,deps,auth" --report-type detailed
/security-audit --scope all --report-type summary
Arguments
| Flag |
Default |
Effect |
--scope <areas> |
all |
Comma-separated: secrets, deps, auth, access-control, data-handling, crypto, infra |
--report-type |
summary |
summary (1-page exec) or detailed (full per-finding analysis) |
Output
<repo>/.ai-skills-memory/security-audits/<run-id>/SECURITY-REPORT.md — findings by category with severity:
- Secrets scan (hardcoded creds, API keys) — CRITICAL if found
- Dependency audit (CVE, outdated libs) — HIGH
- Auth review (credentials, sessions) — MEDIUM
- Access control (RBAC, data scoping) — MEDIUM
- Data handling (PII exposure, encryption, logging) — MEDIUM
- Cryptography (algorithm choices, key management) — MEDIUM
- Infrastructure (network policies, TLS, secrets store) — MEDIUM
<repo>/.ai-skills-memory/security-audits/<run-id>/REMEDIATION-PLAN.md — per finding: severity, mitigation steps, suggested owner role. No effort estimate (Q2)
- Pull request with fixes for automatable issues (dep updates, secret removal from code)
Agent roster
| Agent |
Model |
Effort |
Tools |
Role |
security-engineer |
sonnet |
high |
Read, Grep, Glob, Bash |
Main audit; threat modeling; OWASP coverage |
devops-engineer |
inherit |
high |
Bash, Read, Grep |
Infrastructure security review |
developer (per-stack) |
inherit |
medium |
Read, Bash, Grep, Write, Edit |
Credential/secret removal; code-level fixes for automatable issues |
Pipeline
┌─ Scope parsing: audit --scope areas
│
├─ security-engineer + devops-engineer in parallel:
│ ├─ security-engineer:
│ │ - Grep for secrets (hardcoded keys, tokens, passwords) — see pii-patterns.txt
│ │ - Dependency scan (npm audit, pip check, cargo audit, etc.)
│ │ - Auth flow review (login, session, token, CSRF)
│ │ - Access control review (data scoping, RBAC)
│ │ - Cryptography review (algorithms, key rotation, TLS)
│ │ - Per OWASP coverage matrix below (G3)
│ │ → SECURITY-FINDINGS.md per scope
│ │
│ └─ devops-engineer:
│ - Infrastructure review (network policies, secrets store, TLS)
│ - Container scanning (if Docker)
│ - CI/CD security (secret management, artifact verification)
│ → INFRA-FINDINGS.md
│
├─ Lead consolidates → SECURITY-REPORT.md
│
├─ Lead generates REMEDIATION-PLAN.md:
│ └─ Per finding: severity, mitigation steps, suggested owner role
│ (NO effort estimate — user/PM owns sizing per Q2)
│
└─ developer (if applicable): fix automatable issues in a separate PR:
- Update dependencies with security patches
- Remove hardcoded secrets (replace with env-var refs + add to secret store)
- Add missing security headers (CSP, X-Frame-Options, HSTS)
Memory write: L4 audit summary; if CRITICAL → committed incident record
No RALF — audit is pass-once.
OWASP coverage (G3)
Eval rubric (plugin/eval/judge-rubrics/security-audit.md) MUST verify coverage of: OWASP Web Top 10 (2021) + OWASP GenAI/LLM Top 10 (2025) — see @owasp-coverage.
If the audit target includes any AI/LLM component (agent harness, prompt template, LLM API integration, RAG pipeline), the GenAI Top 10 IS in scope by default.
Methodology — SAST / DAST / SCA / IAST
| Approach |
Surface |
Tools |
| SAST (static) |
Source code at rest — dangerous APIs, taint paths, hardcoded secrets |
Semgrep, CodeQL, SonarQube, Snyk Code |
| DAST (dynamic) |
Running app — injection, auth bypass, header issues |
OWASP ZAP, Burp Suite, Nuclei |
| SCA (composition) |
Dependencies — known CVEs in libs + base images |
osv-scanner, Snyk, Trivy, Grype, Dependabot |
| IAST (interactive) |
Running app + instrumentation — runtime data-flow |
Contrast Security, Seeker |
security-engineer covers SAST + SCA + secret scanning. DAST runs only when an instance is reachable (typically follow-up against staging). IAST is mention-only.
Supply chain
SBOM tooling + SLSA levels + Cosign + EPSS/KEV patterns — see @supply-chain-security.
G7 spawn payloads
All spawns use structured G7 payloads. security-engineer is read-only by frontmatter (disallowedTools: Write, Edit); developer fixes happen in a separate phase with explicit user approval.
Eval rubric
Pointer: plugin/eval/judge-rubrics/security-audit.md (B10).
Dimensions:
- Completeness — all requested scopes covered
- OWASP coverage — Top 10 Web + GenAI Top 10 systematically addressed where applicable
- Accuracy — findings are real issues, not false positives
- Clarity — each finding explains the risk and impact
- Prioritization — severity correctly assessed (CRITICAL > HIGH > MEDIUM > LOW)
- Remediation guidance — mitigations are specific and testable
Pass: avg ≥ 4.0, no dimension < 3.
Memory writes
| Layer |
When |
Shape |
| L4 |
After audit complete |
.ai-skills-memory/security-audits/<run-id>/findings.json — structured findings (for trend tracking) |
| L4 (committed) |
If CRITICAL severity found |
.ai-skills-memory/.committed/security/incidents/<date>.md — critical finding + immediate action taken |
pre-tool-use-committed-write.py hook enforces .committed/security/incidents/*.md matches allowlist.
Failure modes
- False positive (e.g., secret string in test fixture comment): security-engineer reviews, confirms, removes from report if benign — but ALWAYS documents the false-positive review trail
- Dependency CVE has no fix available: documented in REMEDIATION-PLAN with risk acceptance note + escalation deadline
- Auth flow too complex to audit in one pass: security-engineer flags as needs-deeper-review; recommends threat-modeling session via
/spike
Observability events
workflow_start — security-audit + scope
finding_identified (per finding + severity)
automatable_fix_applied (per fix in developer phase)
workflow_end — COMPLETE with critical/high/medium/low counts
Integration
- Orchestrator:
feature-design-lead
- Primary agent:
security-engineer (the B5 agent — read-only, OWASP-aware)
- Schemas:
plugin/schemas/spawn-payload.schema.json, plugin/schemas/return-contract.schema.json
- Sub-workflow: developer fix phase uses
/develop for the remediation PR
- Companions:
/subagent-spawn, /context-load
- Rules:
subagent-isolation, untrusted-content-wrapping (CRITICAL — audit reads project files which may have hostile content), memory-discipline (CRITICAL incidents → committed)
- Hooks:
pre-tool-use-committed-write.py (enforces incident allowlist), tool-output-normalize.py (G2 on npm audit / pip check / cargo audit outputs)
- Templates:
plugin/hooks/scripts/pii-patterns.txt (secret-pattern source)
1---2name: security-audit3description: Use this skill when running a pre-release audit, compliance check, or threat modeling — to perform a full security scan of codebase and infrastructure (secrets, dependencies, auth, access control, data handling, cryptography, infra) with coverage against OWASP Top 10 (Web 2021) AND OWASP GenAI/LLM Top 10 (2025) per G3. Not for code-review security feedback (use /code-review) or pen testing (use professional service).4---56# /security-audit — OWASP-Coverage Security Audit78Comprehensive security scan with OWASP Top 10 (Web 2021) + OWASP GenAI/LLM Top 10 (2025) coverage. Diagnostic + automated fixes for safe issues + remediation plan for the rest. **No effort estimates** — security agent does not size remediation work; user/PM owns sizing per Q2.910## When to use1112- Pre-release security audit13- Compliance check (SOC 2, ISO 27001, PCI-DSS)14- Threat modeling exercise15- Vulnerability scan after dependency update16- Periodic (quarterly) security health check1718## Not for1920- Code-review security feedback (line-level) → `/code-review` (uses `code-review` skill with security-checklist companion)21- Penetration testing → professional pen-test service22- Production incident response → on-call SRE + `/analyze-prod`2324## Invocation2526```27/security-audit28/security-audit --scope "secrets,deps,auth" --report-type detailed29/security-audit --scope all --report-type summary30```3132## Arguments3334| Flag | Default | Effect |35|---|---|---|36| `--scope <areas>` | `all` | Comma-separated: `secrets`, `deps`, `auth`, `access-control`, `data-handling`, `crypto`, `infra` |37| `--report-type` | `summary` | `summary` (1-page exec) or `detailed` (full per-finding analysis) |3839## Output4041- `<repo>/.ai-skills-memory/security-audits/<run-id>/SECURITY-REPORT.md` — findings by category with severity:42 - Secrets scan (hardcoded creds, API keys) — **CRITICAL** if found43 - Dependency audit (CVE, outdated libs) — **HIGH**44 - Auth review (credentials, sessions) — **MEDIUM**45 - Access control (RBAC, data scoping) — **MEDIUM**46 - Data handling (PII exposure, encryption, logging) — **MEDIUM**47 - Cryptography (algorithm choices, key management) — **MEDIUM**48 - Infrastructure (network policies, TLS, secrets store) — **MEDIUM**49- `<repo>/.ai-skills-memory/security-audits/<run-id>/REMEDIATION-PLAN.md` — per finding: severity, mitigation steps, suggested owner role. **No effort estimate** (Q2)50- Pull request with fixes for automatable issues (dep updates, secret removal from code)5152## Agent roster5354| Agent | Model | Effort | Tools | Role |55|---|---|---|---|---|56| `security-engineer` | sonnet | high | Read, Grep, Glob, Bash | Main audit; threat modeling; OWASP coverage |57| `devops-engineer` | inherit | high | Bash, Read, Grep | Infrastructure security review |58| `developer` (per-stack) | inherit | medium | Read, Bash, Grep, Write, Edit | Credential/secret removal; code-level fixes for automatable issues |5960## Pipeline6162```63┌─ Scope parsing: audit --scope areas64│65├─ security-engineer + devops-engineer in parallel:66│ ├─ security-engineer:67│ │ - Grep for secrets (hardcoded keys, tokens, passwords) — see pii-patterns.txt68│ │ - Dependency scan (npm audit, pip check, cargo audit, etc.)69│ │ - Auth flow review (login, session, token, CSRF)70│ │ - Access control review (data scoping, RBAC)71│ │ - Cryptography review (algorithms, key rotation, TLS)72│ │ - Per OWASP coverage matrix below (G3)73│ │ → SECURITY-FINDINGS.md per scope74│ │75│ └─ devops-engineer:76│ - Infrastructure review (network policies, secrets store, TLS)77│ - Container scanning (if Docker)78│ - CI/CD security (secret management, artifact verification)79│ → INFRA-FINDINGS.md80│81├─ Lead consolidates → SECURITY-REPORT.md82│83├─ Lead generates REMEDIATION-PLAN.md:84│ └─ Per finding: severity, mitigation steps, suggested owner role85│ (NO effort estimate — user/PM owns sizing per Q2)86│87└─ developer (if applicable): fix automatable issues in a separate PR:88 - Update dependencies with security patches89 - Remove hardcoded secrets (replace with env-var refs + add to secret store)90 - Add missing security headers (CSP, X-Frame-Options, HSTS)91 Memory write: L4 audit summary; if CRITICAL → committed incident record92```9394No RALF — audit is pass-once.9596## OWASP coverage (G3)9798Eval rubric (`plugin/eval/judge-rubrics/security-audit.md`) MUST verify coverage of: OWASP Web Top 10 (2021) + OWASP GenAI/LLM Top 10 (2025) — see `@owasp-coverage`.99100If the audit target includes any AI/LLM component (agent harness, prompt template, LLM API integration, RAG pipeline), the GenAI Top 10 IS in scope by default.101102## Methodology — SAST / DAST / SCA / IAST103104| Approach | Surface | Tools |105|---|---|---|106| **SAST** (static) | Source code at rest — dangerous APIs, taint paths, hardcoded secrets | Semgrep, CodeQL, SonarQube, Snyk Code |107| **DAST** (dynamic) | Running app — injection, auth bypass, header issues | OWASP ZAP, Burp Suite, Nuclei |108| **SCA** (composition) | Dependencies — known CVEs in libs + base images | osv-scanner, Snyk, Trivy, Grype, Dependabot |109| **IAST** (interactive) | Running app + instrumentation — runtime data-flow | Contrast Security, Seeker |110111`security-engineer` covers SAST + SCA + secret scanning. DAST runs only when an instance is reachable (typically follow-up against staging). IAST is mention-only.112113## Supply chain114115SBOM tooling + SLSA levels + Cosign + EPSS/KEV patterns — see `@supply-chain-security`.116117## G7 spawn payloads118119All spawns use structured G7 payloads. `security-engineer` is read-only by frontmatter (`disallowedTools: Write, Edit`); developer fixes happen in a separate phase with explicit user approval.120121## Eval rubric122123Pointer: `plugin/eval/judge-rubrics/security-audit.md` (B10).124125Dimensions:1261. **Completeness** — all requested scopes covered1272. **OWASP coverage** — Top 10 Web + GenAI Top 10 systematically addressed where applicable1283. **Accuracy** — findings are real issues, not false positives1294. **Clarity** — each finding explains the risk and impact1305. **Prioritization** — severity correctly assessed (CRITICAL > HIGH > MEDIUM > LOW)1316. **Remediation guidance** — mitigations are specific and testable132133Pass: avg ≥ 4.0, no dimension < 3.134135## Memory writes136137| Layer | When | Shape |138|---|---|---|139| L4 | After audit complete | `.ai-skills-memory/security-audits/<run-id>/findings.json` — structured findings (for trend tracking) |140| L4 (committed) | If CRITICAL severity found | `.ai-skills-memory/.committed/security/incidents/<date>.md` — critical finding + immediate action taken |141142`pre-tool-use-committed-write.py` hook enforces `.committed/security/incidents/*.md` matches allowlist.143144## Failure modes145146- **False positive (e.g., secret string in test fixture comment):** security-engineer reviews, confirms, removes from report if benign — but ALWAYS documents the false-positive review trail147- **Dependency CVE has no fix available:** documented in REMEDIATION-PLAN with risk acceptance note + escalation deadline148- **Auth flow too complex to audit in one pass:** security-engineer flags as needs-deeper-review; recommends threat-modeling session via `/spike`149150## Observability events151152- `workflow_start` — security-audit + scope153- `finding_identified` (per finding + severity)154- `automatable_fix_applied` (per fix in developer phase)155- `workflow_end` — `COMPLETE` with critical/high/medium/low counts156157## Integration158159- **Orchestrator**: `feature-design-lead`160- **Primary agent**: `security-engineer` (the B5 agent — read-only, OWASP-aware)161- **Schemas**: `plugin/schemas/spawn-payload.schema.json`, `plugin/schemas/return-contract.schema.json`162- **Sub-workflow**: developer fix phase uses `/develop` for the remediation PR163- **Companions**: `/subagent-spawn`, `/context-load`164- **Rules**: `subagent-isolation`, `untrusted-content-wrapping` (CRITICAL — audit reads project files which may have hostile content), `memory-discipline` (CRITICAL incidents → committed)165- **Hooks**: `pre-tool-use-committed-write.py` (enforces incident allowlist), `tool-output-normalize.py` (G2 on `npm audit` / `pip check` / `cargo audit` outputs)166- **Templates**: `plugin/hooks/scripts/pii-patterns.txt` (secret-pattern source)