/threat-modeling-toolkit:tm-verifyfrom threat-modeling-toolkit
Verifies that security controls documented in a threat model actually exist in the codebase by searching for implementations, validating configurations, and identifying gaps.
Ships in threat-modeling-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Verify that security controls exist in your codebase by:
/tm-verify [--control <id>] [--category <name>] [--thorough] [--evidence]
Arguments:
--control: Verify specific control by ID--category: Verify controls in category (auth, crypto, access-control, etc.)--thorough: Deep code analysis--evidence: Collect code evidence for documentationRequires threat analysis. Run /tm-threats first if threats.json doesn't exist.
Search patterns:
- passport, authenticate, login, signin
- bcrypt, argon2, scrypt, pbkdf2
- jwt, jsonwebtoken, jose
- session, cookie
- oauth, oidc, saml
- mfa, totp, 2fa, two-factor
Search patterns:
- authorize, isAuthorized, checkPermission
- hasRole, requireRole, role
- rbac, abac, acl
- permission, policy
- canAccess, isAllowed
Search patterns:
- validate, validator, sanitize
- joi, yup, zod, ajv
- escape, encode
- xss, html-entities
Search patterns:
- crypto, cipher, encrypt, decrypt
- hash, hmac, sign, verify
- tls, ssl, https
- certificate, key, secret
Search patterns:
- rate-limit, rateLimit, throttle
- express-rate-limit
- slowDown
- quota, limit
Search patterns:
- audit, log, logger
- winston, bunyan, pino
- monitor, track
- event, activity
Search patterns:
- error, exception, catch
- errorHandler, onError
- try, catch, finally
Search for implementation patterns
Analyze findings
Assess implementation status
implemented: Control fully present and configuredpartial: Control exists but incompleteplanned: Control referenced but not implementedmissing: No evidence of controlCollect evidence
# Control Verification Report
**Generated**: [Date]
**Code Paths Analyzed**: [Paths]
## Summary
VERIFICATION RESULTS ═══════════════════════════════════════════════════════════
Controls Analyzed: 29
STATUS BREAKDOWN ───────────────────────────────────────────────────────── ✓ Implemented │████████████████████████████████████░░░░│ 18 (62%) ⚠ Partial │██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░│ 7 (24%) ✗ Missing │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 4 (14%)
GAPS BY SEVERITY ───────────────────────────────────────────────────────── CRITICAL │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 2 HIGH │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 4 MEDIUM │██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 3 LOW │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 2
## Verified Controls
| Control | Status | Evidence |
|---------|--------|----------|
| Rate Limiting | ✓ Implemented | `src/middleware/rateLimiter.ts:15` |
| JWT Auth | ✓ Implemented | `src/middleware/auth.ts:23` |
| Input Validation | ⚠ Partial | `src/validators/` (missing on 3 routes) |
| MFA | ✗ Missing | No implementation found |
## Gap Details
### GAP-001: MFA Not Enforced (HIGH)
┌─────────────────────────────────────────────────────────┐ │ EXPECTED: MFA required for all admin accounts │ │ ACTUAL: MFA optional, no enforcement check found │ │ │ │ EVIDENCE: │ │ Searched: mfa, totp, 2fa, two-factor │ │ Found: No matches in auth middleware │ │ │ │ REMEDIATION: │ │ Add MFA verification in admin route middleware │ │ Effort: Medium | Priority: High │ └─────────────────────────────────────────────────────────┘
[Additional gaps...]
{
"version": "1.0",
"generated": "ISO-8601",
"controls": [
{
"id": "control-001",
"name": "Rate Limiting on Auth Endpoints",
"type": "preventive",
"category": "authentication",
"description": "Limit login attempts to prevent brute force",
"threats_mitigated": ["threat-001", "threat-002"],
"implementation": {
"status": "implemented",
"method": "express-rate-limit middleware",
"configuration": {
"windowMs": 60000,
"max": 5
}
},
"verification": {
"status": "verified",
"evidence": [
{
"type": "code",
"location": "src/middleware/rateLimiter.ts:15-45",
"verified_at": "2025-01-20T10:00:00Z"
}
]
},
"effectiveness": 0.7
}
]
}
{
"version": "1.0",
"generated": "ISO-8601",
"gaps": [
{
"id": "gap-001",
"control_id": "control-002",
"title": "MFA Not Enforced for Admin Users",
"description": "Multi-factor authentication available but not mandatory",
"expected": "MFA required for all privileged accounts",
"actual": "MFA optional, enforcement check missing",
"severity": "high",
"evidence": {
"code_search": "No MFA enforcement in auth middleware",
"config_check": "MFA_REQUIRED env var not set"
},
"remediation": {
"recommendation": "Add MFA enforcement check in admin routes",
"effort": "medium",
"priority": "high"
},
"related_threats": ["threat-001", "threat-003"]
}
]
}
When executing this skill:
Load threat model state:
.threatmodel/state/threats.json.threatmodel/config.yaml for code pathsDetermine required controls:
Search codebase for each control:
Analyze search results:
Assess implementation status:
Identify gaps:
Write visual report file (.threatmodel/reports/verification-report.md):
✓, ⚠, ✗ symbolsConsole summary (also display to user):
Control Verification Complete
=============================
Controls Analyzed: X
Verification Results:
✓ Implemented: N
⚠ Partial: N
✗ Missing: N
Gaps Identified:
Critical: N
High: N
Medium: N
Low: N
Top Gaps:
[GAP-001] HIGH: MFA not enforced
Expected: Mandatory for admins
Found: Optional in src/auth/mfa.ts
[GAP-002] HIGH: SQL queries not parameterized
Expected: Parameterized queries
Found: Concatenation in src/legacy/reports.ts:120
Files Updated:
.threatmodel/state/controls.json
.threatmodel/state/gaps.json
Next Steps:
Run /tm-compliance to map to frameworks
Run /tm-report to generate risk report
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub josemlopez/threat-modeling-toolkit --plugin threat-modeling-toolkit9 skills in this plugin
/tm-complianceMap threats and controls to compliance frameworks like OWASP Top 10, SOC2, PCI-DSS, HIPAA, GDPR. Generates compliance reports with coverage percentages and gaps. Use when checking compliance status, mapping to security frameworks, or generating audit documentation./tm-driftDetect changes in the threat model since the last baseline snapshot. Identifies new assets, changed flows, new threats, and control status changes. Use when comparing threat model versions, tracking security drift, monitoring for new risks, or validating changes after updates./tm-fullRun the complete threat modeling workflow from initialization through reporting. Orchestrates all other skills in sequence. Use when performing full threat model analysis, running complete security assessment, or generating comprehensive threat documentation./tm-initInitialize a threat modeling project by analyzing architecture documentation. Creates threat model structure with asset inventory, data flows, trust boundaries, and attack surface mapping. Use when starting new threat modeling work, setting up threat model for a project, or creating initial security assessment./tm-reportGenerate comprehensive prioritized risk reports with executive summaries, threat details, gap analysis, and recommendations. Use when creating security reports, generating executive summaries, documenting risk assessments, or preparing audit documentation./tm-statusShow current threat model status including asset counts, threat distribution, control verification status, and compliance coverage. Use when checking threat model status, getting overview of security posture, or reviewing current state.