zeroize-audit
Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and…
Skill by trailofbits
Install
Works with Claude Code. Read the repository before you give any tool access to your data.
npx agentmarket install skill/trailofbits-zeroize-audit
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/zeroize-audit
Tools it pre-approves 11
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
ReadGrepGlobBashWriteTaskAskUserQuestionmcp__serena__activate_projectmcp__serena__find_symbolmcp__serena__find_referencing_symbolsmcp__serena__get_symbols_overview
What's inside
- Skill name
zeroize-audit- Description
- Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C/C++/Rust code handling secrets, keys, passwords, or other sensitive data.
- License
- CC-BY-SA-4.0
- Allowed tools
- Read, Grep, Glob, Bash, Write, Task, AskUserQuestion, mcp__serena__activate_project, mcp__serena__find_symbol, mcp__serena__find_referencing_symbols, mcp__serena__get_symbols_overview
- Instructions
- 383 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Pre-approves any shell command
Files (50)
- SKILL.md
- openai.yaml · agents/
- trail-of-bits-mark.svg · assets/
- c.yaml · configs/
- default.yaml · configs/
- rust.yaml · configs/
- report_template.md · prompts/
- system.md · prompts/
- task.md · prompts/
- compile-commands.md · references/
- detection-strategy.md · references/
- ir-analysis.md · references/
- mcp-analysis.md · references/
- poc-generation.md · references/
- rust-zeroization-patterns.md · references/
- input.json · schemas/
- output.json · schemas/
- analyze_asm.sh · tools/
- analyze_cfg.py · tools/
- analyze_heap.sh · tools/
- analyze_ir_semantic.py · tools/
- diff_ir.sh · tools/
- diff_rust_mir.sh · tools/
- emit_asm.sh · tools/
- emit_ir.sh · tools/
- emit_rust_asm.sh · tools/
- emit_rust_ir.sh · tools/
- emit_rust_mir.sh · tools/
- extract_compile_flags.py · tools/
- generate_poc.py · tools/
- apply_confidence_gates.py · tools/mcp/
- check_mcp.sh · tools/mcp/
- normalize_mcp_evidence.py · tools/mcp/
- check_llvm_patterns.py · tools/scripts/
- check_mir_patterns.py · tools/scripts/
- check_rust_asm.py · tools/scripts/
- check_rust_asm_aarch64.py · tools/scripts/
- check_rust_asm_x86.py · tools/scripts/
- find_dangerous_apis.py · tools/scripts/
- semantic_audit.py · tools/scripts/
- track_dataflow.sh · tools/
- validate_rust_toolchain.sh · tools/
- phase-0-preflight.md · workflows/
- phase-1-source-analysis.md · workflows/
- phase-2-compiler-analysis.md · workflows/
- phase-3-interim-report.md · workflows/
- phase-4-poc-generation.md · workflows/
- phase-5-poc-validation.md · workflows/
- phase-6-final-report.md · workflows/
- phase-7-test-generation.md · workflows/
SKILL.md (first lines)
# zeroize-audit
## When to Use
- Auditing cryptographic implementations (keys, seeds, nonces, secrets)
- Reviewing authentication systems (passwords, tokens, session data)
- Analyzing code that handles PII or sensitive credentials
- Verifying secure cleanup in security-critical codebases
- Investigating memory safety of sensitive data handling
## When NOT to Use
- General code review without security focus
- Performance optimization (unless related to secure wiping)
- Refactoring tasks not related to sensitive data
- Code without identifiable secrets or sensitive values
---
## Execution Contract
Use the agent environment's available tools for file access, shell commands, worker execution, and user input. The `allowed-tools` entry and role-file frontmatter are legacy host metadata; they do not define another environment's tool names or grant permissions there.
- **Resolve resources.** Set `baseDir` to the absolute directory containing this `SKILL.md`. Confirm the linked [input schema](schemas/input.json) and [orchestrator prompt](prompts/task.md) exist there. `{baseDir}`, `{workdir}`, and `{{input}}` are notation for values the orchestrator must substitute, not environment variables or automatic host expansion. Resolve relative Markdown links against the directory of the file containing them; resolve `{baseDir}/…` paths against the skill directory. Pass resolved paths to workers and shell commands.
- **Launch a role.** Read the role prompt linked in the Agent Architecture table. When the environment has a registered worker for the role, use its `zeroize-audit:<role-name>` identifier (for example, `zeroize-audit:0-preflight`); otherwise create an independent worker with the Markdown body of that prompt, the current phase's instructions, and its parameter values. Always include the resolved `baseDir` and, once created, `workdir`, even when a phase table does not repeat them. Resolve resource references using the rules above before delegation. Worker file/search/shell actions use the environment's actual tool schemas and permissions. The role's name identifies its instructions, not a required dispatch API or model.
- **Wait for results.** Retain each worker's handle and wait through the environment's completion mechanism. A launch acknowledgement is not completion. Read the phase's required artifacts before updating its completion state or starting a dependent phase. On worker failure or unavailable dispatch, apply only that phase's documented fallback; otherwise record the failure in the existing run state and report the affected phase as blocked.
- **Concurrency.** Respect available concurrency and phase barriers. Run workers sequentially when parallel execution is unavailable. Per-TU compiler workers write to separate directories and may run concurrently.
- **Collect decisions.** Use the environment's user-input facility or ask in the conversation. When a phase requires an answer, wait for it; do not substitute a default or elapsed time for the user's decision. Preserve the validation and verification outcomes when recording any accepted or rejected PoC result.
## How to Run
On a request like "audit this crate for secrets left in memory" or "check that this C library actually wipes its keys":
1. **Collect inputs.** Map the request onto the Inputs table below (full schema: [schemas/input.json](schemas/input.json)). `path` is required, plus at least one of `compile_db` (C/C++) or `cargo_manifest` (Rust); if neither is given or derivable from the repo, ask the user, because preflight stops the run without one. Leave all other fields at their defaults unless the user says otherwise.
2. **Read the [orchestrator prompt](prompts/task.md)**, substituting the collected inputs for its `{{placeholder}}` values. You act as the orchestrator it describes: it defines state recovery, the phase loop, early termination, and error handling. Read the [shared instructions](prompts/system.md) alongside it for the shared working-directory layout and the agent error protocol every phase depends on.
3. **Execute its phase loop.** Run Phases 0-7 sequentially. Before each phase, read that phase's workflow file from `{baseDir}/workflows/phase-{N}-{name}.md` and follow its Preconditions, Instructions, State Update, and Error Handling sections. Each workflow specifies the role prompt and parameters to use under the Execution Contract above. Honor the per-phase skip conditions and the early-termination rules in task.md.
4. **Return the report** (Phase 8, inline): read `{workdir}/report/final-report.md` and return its contents as the skill output.
To resume an interrupted run: if a `workdir` is known from prior context, read `{workdir}/orchestrator-state.json` and continue from its `current_phase` instead of starting at Phase 0 (see the Recovery section of task.md).
---
## Purpose
Detect missing zeroization of sensitive data in source code and identify zeroization that is removed or weakened by compiler optimizations (e.g., dead-store elimination), with mandatory LLVM IR/asm evidence. Capabilities include:
- Assembly-level analysis for register spills and stack retention
- Data-flow tracking for secret copies
- Heap allocator security warnings
- Semantic IR analysis for loop unrolling and SSA form
- Control-flow graph analysis for path coverage verification
- Runtime validation test generation
## Scope
- Read-only against the target codebase (does not modify audited code; writes analysis artifacts to a temporary working directory).
- Produces a structured report (JSON).
- Requires valid build context (`compile_commands.json`) and compilable translation units.
- "Optimized away" findings only allowed with compiler evidence (IR/asm diff).
---
## Inputs
See [schemas/input.json](schemas/input.json) for the full schema. Key fields:
| Field | Required | Default | Description |
|---|---|---|---|
| `path` | yes | — | Repo root |
| `compile_db` | no | `null` | Path to `compile_commands.json` for C/C++ analysis. Required if `cargo_manifest` is not set. |
| `cargo_manifest` | no | `null` | Path to `Cargo.toml` for Rust crate analysis. Required if `compile_db` is not set. |
| `config` | no | — | YAML defining heuristics and approved wipes |
| `opt_levels` | no | `["O0","O1","O2"]` | Optimization levels for IR comparison. O1 is the diagnostic level: if a wipe disappears at O1 it is simple DSE; O2 catches more aggressive eliminations. |
| `languages` | no | `["c","cpp","rust"]` | Languages to analyze |
| `max_tus` | no | `50` | Limit on translation units processed from compile DB |
| `mcp_mode` | no | `prefer` | `off`, `prefer`, or `require` — controls Serena MCP usage |
| `mcp_required_for_advanced` | no | `true` | Downgrade `SECRET_COPY`, `MISSING_ON_ERROR_PATH`, and `NOT_DOMINATING_EXITS` to `needs_review` when MCP is unavailable |
| `mcp_timeout_ms` | no | `10000` | Timeout budget for MCP semantic queries |
| `poc_categories` | no | all 11 exploitable | Finding categories for which to generate PoCs. C/C++ findings: all 11 categories supported. Rust findings: only `MISSING_SOURCE_ZEROIZE`, `SECRET_COPY`, and `PARTIAL_WIPE` are supported; other Rust categories are marked `poc_supported=false`. |
| `poc_output_dir` | no | `generated_pocs/` | Output directory for generated PoCs |
| `enable_asm` | no | `true` | Enable assembly emission and analysis (Step 8); produces `STACK_RETENTION`, `REGISTER_SPILL`. Auto-disabled if `emit_asm.sh` is missing. |
| `enable_semantic_ir` | no | `false` | Enable semantic LLVM IR analysis (Step 9); produces `LOOP_UNROLLED_INCOMPLETE` |
| `enable_cfg` | no | `false` | Enable control-flow graph analysis (Step 10); produces `MISSING_ON_ERROR_PATH`, `NOT_DOMINATING_EXITS` |
| `enable_runtime_tests` | no | `false` | Enable runtime test harness generation (Step 11) |
---
## Prerequisites
Before running, verify the following. Each has a defined failure mode.
**C/C++ prerequisites:**
| Prerequisite | Failure mode if missing |
|---|---|
| `compile_commands.json` at `compile_db` path | Fail fast — do not proceed |
| `clang` on PATH | Fail fast — IR/ASM analysis impossible |
| `uvx` on PATH (for Serena) | If `mcp_mode=require`: fail. If `mcp_mode=prefer`: continue without MCP; downgrade affected findings per Confidence Gating rules. |
| `{baseDir}/tools/extract_compile_flags.py` | Fail fast — cannot extract per-TU flags |
| `{baseDir}/tools/emit_ir.sh` | Fail fast — IR analysis impossible |
| `{baseDir}/tools/emit_asm.sh` | Warn and skip assembly findings (STACK_RETENTION, REGISTER_SPILL) |
| `{baseDir}/tools/mcp/check_mcp.sh` | Warn and treat as MCP unavailable |
| `{baseDir}/tools/mcp/normalize_mcp_evidence.py` | Warn and use raw MCP output |
**Rust prerequisites:**
| Prerequisite | Failure mode if missing |
|---|---|
| `Cargo.toml` at `cargo_manifest` path | Fail fast — do not proceed |
| `cargo check` passes | Fail fast — crate must be buildable |
| `cargo +nightly` on PATH | Fail fast — nightly required for MIR and LLVM IR emission |
| `uv` on PATH | Fail fast — required to run Python analysis scripts |
| `{baseDir}/tools/validate_rust_toolchain.sh` | Warn — run preflight manually. Checks all tools, scripts, nightly, and optionally `cargo check`. Use `--json` for machine-readable output, `--manifest` to also validate the crate builds. |
| `{baseDir}/tools/emit_rust_mir.sh` | Fail fast — MIR analysis impossible (`--opt`, `--crate`, `--bin/--lib` supported; `--out` can be file or directory) |
| `{baseDir}/tools/emit_rust_ir.sh` | Fail fast — LLVM IR analysis impossible (`--opt` required; `--crate`, `--bin/--lib` supported; `--out` must be `.ll`) |
| `{baseDir}/tools/emit_rust_asm.sh` | Warn and skip assembly findings (`STACK_RETENTION`, `REGISTER_SPILL`). Supports `--opt`, `--crate`, `--bin/--lib`, `--target`, `--intel-syntax`; `--out` can be `.s` file or directory. |
| `{baseDir}/tools/diff_rust_mir.sh` | Warn and skip MIR-level optimization comparison. Accepts 2+ MIR files, normalizes, diffs pairwise, and reports first opt level where zeroize/drop-glue patterns disappear. |
| `{baseDir}/tools/scripts/semantic_audit.py` | Warn and skip semantic source analysis |
| `{baseDir}/tools/scripts/find_dangerous_apis.py` | Warn and skip dangerous API scan |
| `{baseDir}/tools/scripts/check_mir_patterns.py` | Warn and skip MIR analysis |
| `{baseDir}/tools/scripts/check_llvm_patterns.py` | Warn and skip LLVM IR analysis |
| `{baseDir}/tools/scripts/check_rust_asm.py` | Warn and skip Rust assembly analysis (`STACK_RETENTION`, `REGISTER_SPILL`, drop-glue checks). Dispatches to `check_rust_asm_x86.py` (production) or `check_rust_asm_aarch64.py` (**EXPERIMENTAL** — AArch64 findings require manual verification). |
| `{baseDir}/tools/scripts/check_rust_asm_x86.py` | Required by `check_rust_asm.py` for x86-64 analysis; warn and skip if missing |
| `{baseDir}/tools/scripts/check_rust_asm_aarch64.py` | Required by `check_rust_asm.py` for AArch64 analysis (**EXPERIMENTAL**); warn and skip if missing |From trailofbits/skills, CC-BY-SA-4.0.
More from trailofbits/skills
- 0.767score
slicing-code-context
trailofbits
Selects bounded, graph-informed source slices with Trailmark and delegates focused code analysis or patch-proposal work to a smaller subagent.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
diagramming-code
trailofbits
Generates Mermaid diagrams from Trailmark code graphs.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
semgrep
trailofbits
Runs a Semgrep security scan over a codebase: detects languages, selects rulesets, presents the plan for explicit approval, then runs every approved ruleset…
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
mermaid-to-proverif
trailofbits
Translates Mermaid sequenceDiagrams describing cryptographic protocols into ProVerif formal verification models (.pv files).
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
github-triage
trailofbits
Triages a repository's open GitHub issues and pull requests via the gh CLI.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
firebase-apk-scanner
trailofbits
Scans Android APKs for Firebase security misconfigurations including open databases, storage buckets, authentication issues, and exposed cloud functions.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
dimensional-analysis
trailofbits
Audits code for unit and decimal-scaling bugs and annotates it with dimensional comments recording the units of each value.
SkillAFreshness: A★ 7.8KClaude Code - 0.767score
let-fate-decide
trailofbits
Draws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
codeql
trailofbits
Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
interpreting-culture-index
trailofbits
Interprets Culture Index (CI) surveys, behavioral profiles, and personality assessment data.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
entry-point-analyzer
trailofbits
Analyzes smart contract codebases to identify state-changing entry points for security auditing.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
trailmark
trailofbits
Builds and queries multi-language source and binary code graphs for security analysis.
SkillAFreshness: A★ 7.8KClaude Code +9
Signals
- Stars
- 7,783
- Forks
- 671
- Open issues
- 30
- Last commit (this folder)
- Oct 14, 2026 (15 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- CC-BY-SA-4.0
- Repository
- github.com/trailofbits/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from trailofbits
- 0.767score
github-triage
trailofbits
Triages a repository's open GitHub issues and pull requests via the gh CLI.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
entry-point-analyzer
trailofbits
Analyzes smart contract codebases to identify state-changing entry points for security auditing.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
interpreting-culture-index
trailofbits
Interprets Culture Index (CI) surveys, behavioral profiles, and personality assessment data.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
firebase-apk-scanner
trailofbits
Scans Android APKs for Firebase security misconfigurations including open databases, storage buckets, authentication issues, and exposed cloud functions.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
dimensional-analysis
trailofbits
Audits code for unit and decimal-scaling bugs and annotates it with dimensional comments recording the units of each value.
SkillAFreshness: A★ 7.8KClaude Code - 0.767score
let-fate-decide
trailofbits
Draws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated.
SkillAFreshness: A★ 7.8KClaude Code +9
Cite this page
zeroize-audit skill. Agent Mart. https://agentmart.dev/skills/trailofbits-zeroize-audit (last updated 2026-10-24)