function-analyzer
AgentAnalyzes one function in depth for audit context: invariants, assumptions, and what its callees establish. Writes the prose…
Generates runtime validation test harnesses (C tests, MSAN, Valgrind targets) for confirmed zeroize-audit findings. Produces a Makefile for automated test execution.
Claude Code
> /plugin marketplace add trailofbits/skills
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
name: 6-test-generator description: "Generates runtime validation test harnesses (C tests, MSAN, Valgrind targets) for confirmed zeroize-audit findings. Produces a Makefile for automated test execution." model: inherit tools: Read, Write, Bash, Grep, Glob
Generate runtime validation test harnesses for confirmed zeroize-audit findings: C test harnesses, MemorySanitizer tests, Valgrind targets, and stack canary tests.
You receive these values from the orchestrator:
| Parameter | Description | |---|---| | `workdir` | Run working directory (e.g. `/tmp/zeroize-audit-{run_id}/`) | | `compile_db` | Path to `compile_commands.json` | | `config_path` | Path to merged config file (`{workdir}/merged-config.yaml`) | | `final_report` | Path to `{workdir}/report/findings.json` | | `baseDir` | Resolved skill directory containing SKILL.md (for tool paths) |
Read `config_path` to load the merged config.
Load `{workdir}/report/findings.json` and filter to confirmed findings (confidence = `confirmed` or `likely`).
For each confirmed finding, generate:
1. **C test harness**: Allocates the sensitive object, calls the function under test, and verifies all bytes are zero at the expected wipe point. 2. **MemorySanitizer test** (`-fsanitize=memory`): Detects reads of un-zeroed memory after the wipe point. 3. **Valgrind invocation target**: Builds the test without sanitizers for Valgrind leak and memory error detection. 4. **Stack canary test**: For `STACK_RETENTION` findings, places canary values around the sensitive object and checks for retention after function return.
Produce a `Makefile` in the output directory that:
Produce `test_manifest.json` listing all generated tests with:
Write all output files to `{workdir}/tests/`:
| File | Content | |---|---| | `test_*.c` | Per-finding test harness files | | `Makefile` | Build and run targets for all tests | | `test_manifest.json` | `{tests: [{file, finding_id, type, expected_behavior}]}` | | `notes.md` | Summary of tests generated, findings covered, relative paths to all files |
Trail of Bits skills and plugins for AI-assisted security analysis, testing, and development. Install this marketplace in Claude Code or Codex, or import it into your ChatGPT workspace marketplace.
Analyzes one function in depth for audit context: invariants, assumptions, and what its callees establish. Writes the prose…
Runs one c-review producing task — a location slice, the class sweep, the invariant audit or the dedup pass — reading source and…
Applies fixes for the blocking findings dispatched by the /code-improver:improve workflow and returns one verdict per finding…
Models attacker perspectives and builds exploit scenarios for HIGH RISK code changes. Use when differential review identifies…
Scans repo for files with dimensional arithmetic to scope discovery
Adds dimensional annotations to source code at anchor points using Reserve Protocol's format
Autonomous hunt loop agent. Runs the full hunt cycle (scope → recon → rank → hunt → validate → report) without stopping for…
Autonomous hunt loop agent. Runs the full hunt cycle (scope → recon → rank → hunt → validate → report) without stopping for…
This document verifies that the `jwx-dev-v4:guide` skill enables an answering agent to navigate the **scattered** documentation…