审计环境构建
- 作者仓库星标 0
- 作者更新于 2026年8月24日 23:09
- 作者仓库 skills
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @trailofbits · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# 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](resources/ANALYSIS_FORMAT.md) defines it, and
[FUNCTION_MICRO_ANALYSIS_EXAMPLE.md](resources/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](resources/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.
章节与文件索引
按说明文件中的顺序排列。
何时使用
何时不使用
不要在这种情况下进行分析
返回什么以及如何读取它
格式
文件/命令 -> /audit-context-building:audit-context <path> · audit-context/DOSSIER.md · audit-context/functions/ · audit-context-building:function-analyzer · nothing found
内容校验值 -> 0d70471cc677
当前原文的自动摘译,尚未人工审校。
何时使用
在审计、威胁模型或架构审查开始时,当代码不熟悉时。此外,当早期的结果产生时,没有人可以判断,因为没有人规划出系统如何组合在一起。
何时不使用
不要命名漏洞、建议修复、编写概念验证或评估严重性。这些属于狩猎阶段,接下来进行,并掌握整个情况。当代码依赖于某些东西而没有任何东西检查它时,请简单地记录下来并继续 - 是否重要稍后再决定。不值得在您已经理解的代码上花费标记。
不要在这种情况下进行分析
分析很长,并且需要保留此上下文才能使用它。调度它:一个代码库,或多个函数 - 运行
/audit-context-building:audit-context <path>。它在自己的子代理中定向、分析每个函数,并在audit-context/functions/下写入audit-context/DOSSIER.md以及每个函数一个文件。此处仅返回紧凑记录。单一功能 - 向其派遣audit-context-building:function-analyzer代理。它写的是它的返回什么以及如何读取它
每条记录都列出了必须始终为真的内容(用显示它的行)、该函数所相信的内容(以及建立它的任何内容)、它调用哪些函数以及它需要每个函数提供什么,以及任何仍不清楚的内容。该档案添加了跨越多个职能、谁可以执行什么操作以及复杂部分聚集在哪里的规则。有两件事比其他事情更重要:
格式
ANALYSIS_FORMAT.md 定义了它,FUNCTION_MICRO_ANALYSIS_EXAMPLE.md 通过 C 和 Solidity 中的示例进行工作。在扩展此插件或决定记录是否可信时请阅读它们。无论目标是什么,格式都是相同的。变化的是每个槽位的填充内容,以及您在内部看不到的内容算作调用的内容。 DOMAIN_NOTES.md 将其映射到智能合约、C 和