Multi-surface, AI-powered STRIDE threat modeling platform. Monorepo with three packages:
- @synthesis/core — Core engine (analyzer, LLM provider, threat engine, DFD generator, formatter)
- @synthesis/github-action — GitHub Actions CI/CD integration (PR comments, SARIF upload)
- synthesis-threat-model — VS Code/Cursor extension (scan workspace/file/git, inline annotations)
- TypeScript monorepo managed with pnpm workspaces
- Zod schemas enforce type safety at every boundary
- LLM providers: Anthropic (claude-sonnet-4-5-20250514), Google (gemini-2.5-flash)
- STRIDE framework with MITRE ATT&CK technique correlation
- OWASP Risk Rating severity matrix (likelihood x impact, always server-side recalculated)
- Outputs: Markdown, SARIF v2.1.0, JSON, Mermaid DFD
- Prompt injection barriers with instruction-hierarchy boundaries
- Input sanitization on all LLM inputs and outputs
- Path traversal prevention, Mermaid injection prevention, HTML escaping
- VS Code SecretStorage for API keys (never plaintext)
- Strict CSP with nonce-based script/style loading in webviews
- Diff size caps (1MB), file count limits, component name sanitization
Business context system that makes threat modeling domain-aware via synthesis.intent.json.
- Intent Schema (
core/src/intent.ts) — Zod-validated project declaration: domain, capabilities, data sensitivity (PCI/PII/PHI), threat actors, compliance frameworks, critical assets, infrastructure - Intent-Aware Prompts (B1) —
buildIntentContext()injects business context into LLM prompts so threats are calibrated to the system's actual risk profile (e.g., PAN exposure in a payment system is critical, not medium) - Severity Calibration (B2) — Post-LLM severity adjustment: critical asset matches boost likelihood +1, PCI/PHI data sensitivity boosts impact +1 for information_disclosure threats.
intentBoostfield explains each adjustment - Compliance Mapping (B3) — Static STRIDE-to-control mappings for PCI DSS v4.0, SOC 2, HIPAA, GDPR. Each threat gets
complianceMapping: string[]with real control IDs - Threat Actor Contextualization (B4) — Declared threat actors are injected into prompts to calibrate threat generation (script kiddies vs nation-state actors produce different threat profiles)
- Data Flow Classification (B5) —
classifyDataFlowsWithIntent()upgrades data flow classifications to PCI when components match payment-related keywords and intent declares PCI sensitivity
Eliminates reviewer fatigue by showing only what changed between scans.
- Fingerprinting (
core/src/baseline.ts) — SHA-256 hash ofcomponent|stride|attackTechniquefor stable threat identity across scans - Delta Comparison —
compareWithBaseline()categorizes threats as new, resolved, changed (severity shift), or unchanged - Baseline Management —
createBaseline(),updateBaseline(),loadBaseline(),serializeBaseline()for lifecycle management - Delta Markdown —
toDeltaMarkdown()renders "3 new | 1 resolved | 12 unchanged" with detail tables; full report in collapsible<details> - GitHub Action — Reads
synthesis-baseline.jsonfrom repo root, writes updated baseline to artifacts; setsnew-threat-countoutput
Catches threats from removed security controls by analyzing 1-hop dependencies.
- Context Expander (
core/src/context-expander.ts) — Two-phase expansion:- Forward: extracts imports from changed files and reads those dependencies
- Reverse: scans repo for files that import changed files
- Import Extraction —
extractImports()supports TypeScript/JavaScript (import/require/dynamic), Python (import/from), Go (single/block), Java/Kotlin - GitHub Integration —
getFileContent()(Contents API) andlistRepoFiles()(Trees API, single call) added to github-client - Capped Expansion — Max 20 related files, 100KB per file, non-fatal on failure
- Action Input —
expand-context(default: true)
Visibility into whether the codebase is getting more or less secure over time.
- Trend Schema (
core/src/trend.ts) — Per-PR entries with severity breakdown, new/resolved counts, capped at 100 entries - Trend Markdown —
toTrendMarkdown()renders PR-by-PR table with trend icons, direction percentage, avg new/resolved per PR, critical-free streak - GitHub Action — Reads
synthesis-trend.jsonfrom repo root, appends current scan, writes updated trend to artifacts, adds collapsible trend summary to PR comment and job summary - Action Input —
trend-tracking(default: true)
Allows reviewers to accept/suppress threats directly from PR comments with audit trail.
- Comment Commands (
github-action/src/acceptance.ts) —@synthesis accept|mitigate|transfer TM-NNN reason: ... - Acceptance Parsing —
parseAcceptanceCommands()fetches PR comments, strict regex matching, filters bot comments, sanitizes reason text and usernames - Status Update —
applyAcceptances()updates matching threat statuses; returns applied and unmatched lists - Audit Log —
formatAcceptanceLog()renders markdown table with threat, action, user, reason, date - Threshold Exclusion — Only
status: "open"threats count toward the failure threshold; accepted/mitigated/transferred are excluded - Action Input —
process-acceptances(default: true)
PR opened → Fetch diff → Expand context (1-hop) → Generate threats (intent-aware)
→ Compare baseline (delta) → Process acceptances (@synthesis accept)
→ Track trends → Post delta report → Enforce threshold (open threats only)
packages/core/src/types.ts— All schemas, enums, severity matrix, intentBoost/complianceMapping fieldspackages/core/src/analyzer.ts— Diff parsing, component extraction, trust boundaries, intent-aware data flow classificationpackages/core/src/threat-engine.ts— Main orchestration pipeline with intent calibrationpackages/core/src/prompts.ts— STRIDE system prompt, ATT&CK mappings, few-shot examples, intent context builderpackages/core/src/llm-provider.ts— Anthropic/Gemini abstraction, rate limiterpackages/core/src/dfd-generator.ts— Mermaid flowchart generationpackages/core/src/formatter.ts— Markdown, SARIF, JSON, delta markdown output formatterspackages/core/src/intent.ts— Intent schema, loader, compliance control mappingspackages/core/src/baseline.ts— Threat fingerprinting, baseline comparison, delta reportingpackages/core/src/context-expander.ts— 1-hop dependency graph expansion, import extractionpackages/core/src/trend.ts— Threat trend tracking, per-PR metrics, trend markdownpackages/github-action/src/index.ts— GitHub Action main entry (full enhanced pipeline)packages/github-action/src/acceptance.ts— PR comment acceptance parsing, audit logpackages/github-action/src/github-client.ts— PR diff, comments, file content, repo tree APIspackages/vscode-extension/src/extension.ts— VS Code activation and command registration
pnpm install— Install dependencies- Build/test commands are per-package
- Tests use Vitest
This project references skills from https://github.com/unitoneai/SecuritySkills for enhanced threat analysis.
Threat Modeling (appsec/threat-modeling)
- STRIDE-per-element methodology with 9-step process
- Asset & entry point identification, threat actor profiling
- Data flow & trust boundary mapping
- MITRE ATT&CK correlation and risk quantification
- Use:
/skill threat-modeling <target>
Secure Code Review (appsec/secure-code-review)
- OWASP ASVS 4.0.3 and CWE Top 25 (2024) aligned
- 8-step methodology: input validation, auth, crypto, error handling, data protection
- Use:
/skill secure-code-review <target>
Agentic AI Top 10 (ai-security/agentic-top-10)
- OWASP Agentic AI Top 10 assessment (AG01-AG10)
- Covers excessive agency, tool misuse, privilege escalation, memory poisoning
- Trust boundary violations, data exfiltration, cascading failures
- Use:
/skill agentic-top-10 <target>
Pipeline Security (devsecops/pipeline-security)
- SLSA v1.0 build maturity (L1-L3) and OWASP Top 10 CI/CD Risks
- Flow control, dependency management, artifact integrity
- Use:
/skill pipeline-security <target>
LLM Top 10 (ai-security/llm-top-10)
- OWASP Top 10 for LLM Applications assessment
- Prompt injection, data poisoning, supply chain, output handling
- Use:
/skill llm-top-10 <target>
Prompt Injection (ai-security/prompt-injection)
- Prompt injection vulnerability assessment
- Direct/indirect injection, jailbreak detection
- Use:
/skill prompt-injection <target>
appsec/api-security— API security assessmentappsec/owasp-top-10-web— OWASP Top 10 web assessmentappsec/dependency-scanning— Dependency vulnerability scanningdevsecops/sast-config— SAST configurationdevsecops/dast-config— DAST configurationdevsecops/secrets-management— Secrets management reviewcompliance/soc2-gap— SOC 2 gap analysiscompliance/nist-csf-assessment— NIST CSF assessmentcompliance/iso27001-gap— ISO 27001 gap analysisvuln-management/cve-triage— CVE triage with CISA KEVvuln-management/sbom-analysis— SBOM analysisidentity/iam-review— IAM reviewidentity/zero-trust-assessment— Zero trust assessmentcloud/— Cloud security skills (AWS, Azure, GCP)incident-response/— IR playbookssecops/— Security operations
- All threat severity is server-side calculated (never trust LLM scores)
- MITRE ATT&CK IDs must match format: T####(.NNN)?
- Component names: alphanumeric + underscore only
- Fail-closed on malformed LLM responses
- Strict Zod validation on all external inputs