threat-model
Skill này làm gì
Skill này xây dựng một mô hình mối đe dọa, tức là bản đồ các cách hệ thống có thể bị tấn công. Nó làm việc từ một buổi phỏng vấn với chủ ứng dụng, từ mã nguồn và các lỗi cũ, hoặc cả hai. Skill dành cho các đội bảo mật lên kế hoạch rà soát.
Khi nào nên dùng
- ✓Khi bạn muốn biết điều gì có thể sai với ứng dụng trước khi tìm lỗi.
- ✓Khi chủ ứng dụng có thể trả lời các câu hỏi về hệ thống và rủi ro của nó.
- ✓Khi không có chủ ứng dụng và bạn muốn một mô hình mối đe dọa dựa trên mã nguồn và các lỗ hổng cũ.
Liên kết skill
https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/threat-model/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể xây dựng mô hình mối đe dọa cho ứng dụng của tôi, dựa trên mã nguồn và các câu hỏi tôi trả lời không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent có thể phỏng vấn chủ ứng dụng bằng một bộ câu hỏi, hoặc đọc mã nguồn và các báo cáo lỗ hổng cũ. Sau đó nó viết một file mô hình mối đe dọa cho dự án.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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:
- The target directory exists and is a local checkout you can read.
- You will not execute any code from the target directory.
- If
--vulnspoints 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 token | Route to |
|---|---|
interview |
Read interview.md in this directory and follow it. |
bootstrap |
Read bootstrap.md in this directory and follow it. |
bootstrap-then-interview |
Bootstrap first, then interview seeded from the draft. See below. |
| anything else, or empty | Ask 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.
interview |
bootstrap |
|
|---|---|---|
| Needs | An application owner present in the session | A local checkout; optionally past vulns |
| Method | Four-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 job | Five stages: parallel research swarm → synthesize sections 1-3 + vuln table → generalize vulns into threat classes → STRIDE gap-fill → emit |
| Best for | New systems, design reviews, systems where the risk lives in business logic the code doesn't show | Inherited systems, third-party code, OSS dependencies, anything with a CVE history |
| Provenance tag | interview |
bootstrap |
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.mdorbootstrap.mdin 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):
| Q | Question | Fills schema sections |
|---|---|---|
| Q1 | What are we working on? | section 1 context, section 2 assets, section 3 entry points |
| Q2 | What can go wrong? | section 4 threat rows (id, threat, actor, surface, asset) |
| Q3 | What are we going to do about it? | section 4 impact/likelihood/status/controls; section 5 deprioritized; section 8 recommended mitigations |
| Q4 | Did 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 goe
Câu hỏi thường gặp
Mô hình mối đe dọa là gì?
Đó là danh sách các cách kẻ tấn công có thể gây hại cho hệ thống, cùng với mức độ có khả năng xảy ra và cách xử lý.
Nó có kiểm tra ứng dụng không?
Không. Skill chỉ đọc mã nguồn và viết báo cáo, không chạy hay thay đổi ứng dụng.
Kết quả được lưu ở đâu?
Nó ghi một file markdown mô hình mối đe dọa trong thư mục dự án mục tiêu.
Chi tiết
Mô tả gốc của tác giả
Build a threat model for a target codebase. Three modes: "interview" walks an application owner through the four-question framework and produces a threat model from their answers; "bootstrap" derives a threat model from the code plus past vulnerabilities (CVEs, git history, pentest reports) when no owner is available; "bootstrap-then-interview" chains the two when both owner and codebase are present. All write THREAT_MODEL.md in a shared schema. Use when asked to "threat model", "build a threat model", "map the attack surface", or "what should we be worried about in this codebase".
Độ phổ biến
- Sao GitHub
- 7.7k
- Vị trí xếp hạng
- #13105
- Giấy phép
- —
- Cập nhật
- 6/8/2026
Bình luận
- …
Thêm skill từ kho mã này
customize
7.7kGiúp agent của bạn điều chỉnh một pipeline tìm lỗ hổng bảo mật bằng AI cho loại lỗi, ngôn ngữ hoặc mục tiêu mới, bằng cách viết lại các phần đặc thù.
dnr-hunt
7.7kGiúp agent của bạn săn tìm trong log web khi chưa có cảnh báo nào, tìm dấu hiệu tấn công và ghi lại các sự cố phát hiện được.
dnr-respond
7.7kGiúp agent của bạn xử lý một cảnh báo hoặc dấu hiệu bảo mật, kiểm tra cuộc tấn công có thành công không và đã lan rộng đến đâu.
patch
7.7kGiúp agent của bạn soạn các bản sửa code đề xuất cho những phát hiện bảo mật đã xác minh, lưu dưới dạng diff để người xem xét.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.