When the user needs a security assessment — threat modeling, vulnerability review, auth flow audit, dependency scanning, or says "is this secure", "review for vulnerabilities", "threat model", "security audit", "pen test prep".
From startup-context: tech stack, deployment environment, compliance requirements, data types. Also ask:
Follow a five-phase methodology. Automated scanning precedes manual review. Authorization verification is mandatory before active testing.
semgrep --config=auto across the codebasenpm audit / pip-audit / govulncheck / trivy fs .trivy image for containerized deployments# Security Review: [Scope Description]
## Executive Summary
Overall risk posture (Critical / High / Medium / Low), top findings count, and business impact summary.
## Threat Model (STRIDE)
| Threat | Category | Asset | Impact | Likelihood | Risk |
## Findings
### Critical / High / Medium / Low
- **[SEC-N] Title** — CVSS X.X — file:line — description, business impact, remediation with code example
## Auth Flow Assessment
End-to-end trace of authentication and authorization with findings.
## Dependency Vulnerabilities
| Package | Current Version | CVSS | Fix Version | Exploitable in Context? |
## Remediation Roadmap
Prioritized action list with timelines.
Apply to every component and data flow:
npm audit, pip-audit, trivy, govulnchecksemgrep --config=auto (all stacks), bandit (Python), gosec (Go), eslint-plugin-security (Node)npm audit / pip-audit / govulncheck / trivy fs .trivy imagecode-review — chain when findings require code-level fixes and reviewarchitecture-design — chain when findings reveal architectural security flawssoc2-prep — chain when review is part of compliance preparationExample prompt: "Review the security of our user authentication system. We use JWT with Express."
Good output snippet:
# Security Review: JWT Authentication System
## Executive Summary
Risk posture: **Critical**. Hardcoded JWT secret and non-expiring tokens.
## Findings
### Critical (CVSS 9.8)
- **[SEC-1] Hardcoded JWT secret** — auth/config.js:3 — Secret is
"supersecret123". Attacker can forge any token.
**Fix:** Move to env var, generate with `openssl rand -base64 64`.
### Critical (CVSS 9.1)
- **[SEC-2] Tokens never expire** — auth/jwt.js:12 — No `expiresIn`.
**Fix:** Set `expiresIn: '15m'`, implement refresh token rotation.