跳到正文
Skillpedia
安全8.0k · #12655

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/trailofbits/skills/blob/main/plugins/audit-context-building/skills/audit-context-building/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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 writes audit-context/DOSSIER.md plus one file per function under audit-context/functions/. Only compact records return here.
  • A single function — dispatch the audit-context-building:function-analyzer agent 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能