audit-context-building
它能做什么
在进行任何漏洞查找之前,指导对陌生代码的仔细阅读,让团队理解各部分如何组合在一起。适用于开始审计新代码的安全审查人员。
适用场景
- ✓安全审查人员开始审计一段从未见过的代码的时候。
- ✓团队计划对现有系统进行架构审查或威胁建模的时候。
- ✓之前的审查产生了一些无人能判断的发现,因为系统本身不清楚的时候。
技能链接
https://github.com/trailofbits/skills/blob/main/plugins/audit-context-building/skills/audit-context-building/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我要对一个我不熟悉的代码库开始安全审计。请先帮我梳理它是怎么运作的。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能在不指出漏洞、也不评估风险的前提下建立理解。它记录每个函数所假设和依赖的内容,并把详细笔记保存到文件中,使主要工作保持聚焦。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Audit Context Building
Build understanding, not verdicts. This runs before anyone hunts for bugs, and feeds that work.
When to Use
At the start of an audit, a threat model, or an architecture review, when the code is unfamiliar. Also when an earlier pass produced findings nobody could judge, because no one had mapped out how the system fits together.
When NOT to Use
Do not name vulnerabilities, suggest fixes, write proofs-of-concept, or rate severity. Those belong to the hunting phase, which runs next and with the whole picture in hand. When the code counts on something and nothing checks it, record that plainly and move on — whether it matters is decided later.
Not worth the tokens on code you already understand.
Do not analyze in this context
The analysis is long, and this context needs to survive to use it. Dispatch it:
- A codebase, or more than one function — run
/audit-context-building:audit-context <path>. It orients, analyzes each function in its own subagent, and writesaudit-context/DOSSIER.mdplus one file per function underaudit-context/functions/. Only compact records return here. - A single function — dispatch the
audit-context-building:function-analyzeragent at it. It writes its prose to disk and returns a record.
Then work from what comes back: the index, the unenforced assumptions, the open questions. Read a function's file when you need its detail.
The workflow is what enforces this, not this text: a subagent bound to a return schema cannot return prose. Treat this section as routing, and route.
What comes back, and how to read it
Each record lists what must always be true (with the line that shows it), what the function takes on faith (with whatever establishes it), which functions it calls and what it needs from each, and anything still unclear. The dossier adds the rules that span several functions, who can reach what, and where the complicated parts cluster.
Two things matter more than the rest:
- Assumptions marked
nothing found. The code counts on something being true and nothing anywhere makes it true. This is the most useful thing to hand the hunting phase. - The open questions. An honest list of what is still unclear beats a confident answer that turns out to be wrong. Carry them forward instead of closing them out.
Where two records disagree, both are quoted rather than quietly reconciled. That is a fact about the code, not a flaw in the analysis.
The format
ANALYSIS_FORMAT.md defines it, and FUNCTION_MICRO_ANALYSIS_EXAMPLE.md works through examples in C and Solidity. Read them when extending this plugin or deciding whether a record can be trusted.
The format is the same whatever the target. What changes is what fills each slot, and what counts as a call you cannot see inside. DOMAIN_NOTES.md maps that across smart contracts, C and C++, decompiled firmware, and web services — read it when the target is not plain source code.
The rule that matters most: follow the calls. Whether a function is correct usually depends on something
another function does, and you cannot see that from the caller alone. A limit looks enforced because the
value came back from a function whose name suggests it was checked. So read the function being called, follow
every path through it rather than only the one that succeeds, and say what makes each assumption true. When
nothing does, use those words: nothing found. Every claim cites a line, or becomes an open question.
常见问题
它会查找漏洞吗?
不会。该技能先帮助理解代码,查找漏洞属于之后的步骤。
它会一次分析整个代码库吗?
对于整个代码库或多个函数,该技能会把分析交给子智能体,并将结果写入一个档案文件。
它会产出什么?
会产出一份索引、一份未经强制执行的假设列表和待解决问题,以及每个函数的笔记。
详情
作者的原始描述
Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere. Use when starting an audit, threat model, or architecture review on unfamiliar code, and before any vulnerability-hunting pass.
repo: trailofbits/skills
热度
- GitHub 星标
- 8.0k
- 排名
- #12655
- 许可证
- CC-BY-SA-4.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
algorand-vulnerability-scanner
8.0k帮你的智能体扫描 TEAL 或 PyTeal 编写的 Algorand 智能合约,检查 11 类常见安全问题,如重新密钥攻击和未校验费用。
audit-prep-assistant
8.0k帮你的智能体为外部安全审查做好代码准备,包括静态分析、测试覆盖、死代码清理和清晰的文档。
cairo-vulnerability-scanner
8.0k帮你的智能体扫描 StarkNet 上的 Cairo 智能合约,检查 6 类严重问题,包括算术溢出、有风险的跨层消息和签名重放。
code-maturity-assessor
8.0k帮你的智能体按 9 个成熟度领域为智能合约或区块链代码库评分,附上证据和改进优先级清单。