threat-model

작성자: anthropic

대상 코드베이스에 대한 위협 모델을 구축합니다. 세 가지 모드: "인터뷰" 모드는 애플리케이션 소유자를 네 가지 질문 프레임워크로 안내하여 위협 모델을 생성합니다…

npx skills add https://github.com/anthropics/defending-code-reference-harness --skill threat-model

threat-model

A threat model answers "what could go wrong with this system, who would do it, and what should we do about it?" independently of whether any specific bug has been found yet. It is the map; vulnerability discovery is the metal detector. A good threat model tells the pipeline where to look and tells triage which findings matter.

Litmus test: If patching one line of code makes an entry disappear, it was a vulnerability, not a threat. A threat ("attacker achieves RCE via untrusted media parsing") still stands after every known bug is fixed; a vulnerability ("dr_wav.h:412 doesn't bounds-check chunk_size") does not. This skill produces threats. Vulnerabilities appear only as evidence that raises a threat's likelihood score.

Invocation: /threat-model [bootstrap-then-interview|bootstrap|interview] <target-dir> [flags]


Step 0 — Safety preamble (always runs first)

This skill performs static analysis only. It reads source, git history, and any vulnerability reports the user supplies, and writes a single output file (<target-dir>/THREAT_MODEL.md). It does not build, execute, fuzz, or modify the target, and does not make network requests against the target's infrastructure.

Before proceeding, confirm and state in your first response:

  1. The target directory exists and is a local checkout you can read.
  2. You will not execute any code from the target directory.
  3. If --vulns points at a URL or you are asked to "fetch CVEs", you will query only public advisory databases (NVD, GitHub Security Advisories, the project's own issue tracker) and never the target's live deployment.

If the user asks you to validate a threat by running an exploit, decline and point them at the vuln-pipeline (README Step 2) instead.


Step 1 — Route to a mode

Parse $ARGUMENTS:

First tokenRoute to
interviewRead interview.md in this directory and follow it.
bootstrapRead bootstrap.md in this directory and follow it.
bootstrap-then-interviewBootstrap first, then interview seeded from the draft. See below.
anything else, or emptyAsk the user: "Is someone who owns or built this system available to answer questions in this session?" Yes and the codebase is checked out → recommend bootstrap-then-interview. Yes but no codebase → interview.md. No → bootstrap.md.

All modes write the same artifact (THREAT_MODEL.md, schema in schema.md) so downstream consumers (pipeline recon/judge, verifier agents) do not need to know which mode produced it.

interviewbootstrap
NeedsAn application owner present in the sessionA local checkout; optionally past vulns
MethodFour-question framework: conversational walk through what are we working on → what can go wrong → what are we going to do about it → did we do a good jobFive stages: parallel research swarm → synthesize sections 1-3 + vuln table → generalize vulns into threat classes → STRIDE gap-fill → emit
Best forNew systems, design reviews, systems where the risk lives in business logic the code doesn't showInherited systems, third-party code, OSS dependencies, anything with a CVE history
Provenance taginterviewbootstrap

Context durability. Interview mode is multi-turn; tool results from early reads may be evicted before you need them. To stay resilient:

  • Do not read interview.md or bootstrap.md in full up front. Read the mode file (or the relevant section of it) at the point you need it, one question or stage at a time.
  • If a re-read via the Read tool is refused as "file unchanged", the prior result was evicted; reload with cat <path> via Bash instead.

Interview backbone (so you can proceed even if interview.md is unavailable mid-session):

QQuestionFills schema sections
Q1What are we working on?section 1 context, section 2 assets, section 3 entry points
Q2What can go wrong?section 4 threat rows (id, threat, actor, surface, asset)
Q3What are we going to do about it?section 4 impact/likelihood/status/controls; section 5 deprioritized; section 8 recommended mitigations
Q4Did we do a good job?validate ranking, coverage check, section 6 open questions

bootstrap-then-interview mode

When the owner is available and the codebase is checked out, this is the recommended path: the owner's time goes to refining a code-grounded draft instead of describing the system from scratch.

  1. Tell the owner: "I'll read the code first and come back with a draft (about 5-10 min), then we'll walk it together. Want that, or would you rather start cold?" Only proceed if they opt in; otherwise fall back to interview.md.
  2. Read bootstrap.md and follow it end-to-end. Write <target-dir>/THREAT_MODEL.md.
  3. Immediately continue into interview mode: read interview.md and follow it with --seed <target-dir>/THREAT_MODEL.md in effect. The section 6 open questions from bootstrap become your Q1-Q4 prompts; the owner confirms, corrects, and adds rather than starting from nothing.
  4. Overwrite <target-dir>/THREAT_MODEL.md with the refined model. Set provenance mode: bootstrap-then-interview.

The same flow is available manually: run bootstrap first, then interview --seed <THREAT_MODEL.md> in a later session.


Step 2 — Shared output contract

All modes MUST emit <target-dir>/THREAT_MODEL.md conforming to schema.md in this directory. Read schema.md immediately before you write the file, not at routing time; in interview mode the gap between routing and emit can be many turns, and an early read will be evicted before it's used.

After writing the file, print to the user:

  1. The path to THREAT_MODEL.md.
  2. The top 5 threats by likelihood × impact (id, one-line description, L×I).
  3. For bootstrap: any open questions the code could not answer (these seed a later interview pass).
  4. For interview: any owner statements that could not be verified in code (these seed follow-up code review).

References

anthropic의 다른 스킬

access
anthropic
Discord 채널 접근을 관리합니다 — 페어링 승인, 허용 목록 편집, DM/그룹 정책 설정. 사용자가 페어링 요청, 승인, 허용된 사람 확인 등을 요청할 때 사용합니다.
official
session-report
anthropic
~/.claude/projects 트랜스크립트에서 Claude Code 세션 사용량(토큰, 캐시, 하위 에이전트, 스킬, 고비용 프롬프트)에 대한 탐색 가능한 HTML 보고서를 생성합니다.
official
build-mcp-server
anthropic
이 스킬은 사용자가 "MCP 서버 구축", "MCP 생성", "MCP 통합 만들기", "Claude용 API 래핑", "도구 노출" 등을 요청할 때 사용해야 합니다.
official
cookbook-audit
anthropic
Anthropic Cookbook 노트북을 루브릭에 따라 감사합니다. 노트북 리뷰나 감사가 요청될 때마다 사용하세요.
official
handle-complaint
anthropic
들어오는 고객 불만을 처음부터 끝까지 처리합니다 — 맥락을 파악하고, 응답을 작성하며, 운영상의 수정을 제안합니다. 선택적으로 이메일이나 티켓 ID를 받습니다…
official
use-case-triage
anthropic
처리 활동이 PIA, 필수 GDPR DPIA가 필요한지 또는 진행 가능한지 신속히 판단하여 개인정보 처리방침 충돌을 표시하고 적절한 경로로 안내합니다…
official
board-minutes
anthropic
이사회 또는 위원회 회의록을 사내 형식으로 작성합니다. 캘린더에서 예정된 이사회 및 위원회 회의를 자동으로 감지하고, 안건을 요청한 후…
official
renewal-tracker
anthropic
유지 관리되는 갱신 등록부를 기반으로 취소 마감일이 다가오는 계약을 표시하고 통지 기간이 종료되기 전에 경고합니다. 사용자가 요청할 때 사용합니다.
official