Threat Model Verify (Question 4: Did We Do a Good Enough Job?)
Use this skill to independently audit completed fixes, verify security regression tests, detect newly introduced threats in a git diff / PR, and keep docs/THREAT-MODEL.md accurate as a living security document.
Verification Mindset
Treat every "mitigated" claim as unverified until proven by code inspection and test execution. Look specifically for incomplete fixes, bypassed sibling paths, weak assertions in tests, and newly introduced trust boundaries.
Workflow
Step 1: Audit Every Mitigated Finding
For each finding marked mitigated in docs/THREAT-MODEL.md (and docs/threat-model.json if present):
- Inspect the actual fix in the codebase (
git diffor current files). - Confirm the root cause—not just one symptom—is closed:
- Are sibling routes, GraphQL resolvers, Server Actions, or background jobs also protected?
- Does the fix fail closed on null, malformed input, missing claims, or thrown exceptions?
- Are bypass variants blocked (URL encoding, case folding, IPv6-mapped SSRF, HTTP method override, redirect chains, prototype keys)?
- Inspect the accompanying security regression test:
- Does it genuinely test the attack vector (not mocked away so heavily that it cannot fail if the fix is reverted)?
- Does it verify both the blocked attacker case and the allowed legitimate case?
Step 2: Run Automated Tests & Available Security Scanners
Run the project's test suite and any security tooling installed in the environment (do not install unapproved global tools without asking; gracefully note unavailable tools):
- Project unit, integration, and security tests.
- Language dependency audits where applicable:
npm audit/pnpm audit,pip-audit,cargo audit/cargo deny,govulncheck,dotnet list package --vulnerable,bundle audit,composer audit. - Static & secret scanners if installed:
semgrep,gitleaks,trivy,bandit,gosec,clippy,eslint,ruff. - If
validate_threat_model.pyanddocs/threat-model.jsonare present:python3 /path/to/scripts/validate_threat_model.py docs/threat-model.json --fail-on high
Step 3: PR / Git-Diff Threat Model Drift Check
Inspect git diff (or commit range since docs/THREAT-MODEL.md was last updated) using references/verification-checklist.md to check whether code changes introduced:
- New public endpoints, webhooks, Server Actions, GraphQL mutations, or MCP tools
- Changes to auth/session/RBAC middleware or tenant scoping
- New outbound network calls, file operations, subprocesses, or deserializers
- New dependencies, Docker/IaC changes, or GitHub Actions workflow edits
- Hardcoded secrets, debug bypasses, or loosened CORS/CSP/TLS settings
If new attack surfaces were added without threat model coverage, flag them as Threat Model Drift and list the new threats to analyze.
Step 4: Produce Verification Verdict & Update Sign-Off
Update Section 5 (Verification & Residual Risk Sign-Off) of docs/THREAT-MODEL.md and output a crisp verification report:
- Per-finding table:
TM-ID|Claimed Status|Verified? (PASS / FAIL / PARTIAL)|Evidence / Gap - Test & scanner results: Exact commands run and pass/fail outcomes.
- Drift check result: Clean or list of newly introduced trust boundaries / findings.
- Residual risks: Explicit list of any remaining
openoracceptedCritical/High/Medium items with recommended next action.