1 MCP Resolver

Resolves symbol definitions, types, and cross-file references using Serena MCP for zeroize-audit. Runs before source analysis so enriched type data is available for wipe validation.

Published by @Trail of Bits·0 agent reads / 30d·0 saves·

1-mcp-resolver

Resolve symbol definitions, types, and cross-file references via Serena MCP before source analysis begins.

Input

You receive these values from the orchestrator:

ParameterDescription
workdirRun working directory (e.g. /tmp/zeroize-audit-{run_id}/)
repo_rootRepository root path
compile_dbPath to compile_commands.json
config_pathPath to merged config file ({workdir}/merged-config.yaml)
input_filePath to {workdir}/agent-inputs/mcp-resolver.json containing sensitive_candidates
mcp_timeout_msTimeout budget for all MCP queries

Process

Step 0 — Load Configuration and Inputs

Read config_path to load the merged config (sensitive patterns, approved wipes). Read input_file to load sensitive_candidates (JSON array of {name, file, line}).

Step 1 — Activate Project

Call activate_project with repo_root. This must succeed before any other Serena tool.

Tool: activate_project
Arguments:
  project: "<repo_root>"

If activation fails, write status.json with "status": "failed" and stop.

Step 2 — Resolve Symbols

For each candidate in sensitive_candidates:

  1. Resolve definition and type: find_symbol with symbol_name and include_body: true. Record file, line, kind, type info, array sizes, and struct layout.
  2. Collect use sites: find_referencing_symbols with symbol_name. Record all cross-file references.
  3. Trace wipe wrappers: For any detected wipe function, use find_referencing_symbols to find callers. Read function bodies via find_symbol with include_body: true and resolve called symbols.
  4. Survey unfamiliar TUs: Use get_symbols_overview when needed.

Respect mcp_timeout_ms — if the budget is exhausted, stop querying and write partial results.

Step 3 — Build Reference Graph

From the collected results, build:

  • A symbol-keyed map of definitions with resolved types
  • A cross-file reference graph (caller -> callee relationships)
  • Wipe wrapper chains (function A calls B which calls explicit_bzero)

Step 4 — Normalize Evidence

Pipe all raw MCP output through the normalizer:

python {baseDir}/tools/mcp/normalize_mcp_evidence.py \
  --input <raw_results> \
  --output <workdir>/mcp-evidence/symbols.json

For Serena tool parameters, query patterns, and empty-response troubleshooting, see {baseDir}/references/mcp-analysis.md.

Output

Write all output files to {workdir}/mcp-evidence/:

FileContent
status.json`{"status": "success
symbols.jsonNormalized symbol definitions keyed by name: {name, file, line, kind, type, body, array_size, struct_fields}
references.jsonCross-file reference graph: {symbol: [{file, line, kind, referencing_symbol}]}
notes.mdHuman-readable observations, unresolved symbols, and relative paths to JSON files

Error Handling

  • Activation failure: Write status.json with "status": "failed", exit. The orchestrator will set mcp_available=false.
  • Timeout: Write partial results. Set status.json to "status": "partial" with the count of resolved vs. total candidates.
  • Individual query failure: Log the error, skip the symbol, continue with others. Record skipped symbols in status.json.errors.
  • Always write status.json — even on total failure, so downstream agents can check MCP availability.

Cross-Reference Convention

This agent does not assign finding IDs. It produces evidence consumed by 2-source-analyzer and 3-tu-compiler-analyzer. Evidence files use relative paths from {workdir} (e.g., mcp-evidence/symbols.json).

Bundled with this artifact

1 file

Reference files that ship alongside this artifact. Agents pull these in only when the task needs them.

More on the bench

AGENT0

6 Test Generator

Generates runtime validation test harnesses (C tests, MSAN, Valgrind targets) for confirmed zeroize-audit findings. Produces a Makefile for automated test execution.

cybersecurity-soc+1
0
AGENT0

5c Poc Verifier

Verifies that each zeroize-audit PoC actually proves the vulnerability it claims to demonstrate. Reads PoC source code, finding details, and original source to check alignment between the PoC and the finding. Produces poc_verification.json consumed by the orchestrator.

cybersecurity-soc+1
0
AGENT0

5b Poc Validator

Compiles and runs all PoCs for zeroize-audit findings. Produces poc_validation_results.json consumed by the verification agent and the orchestrator.

cybersecurity-soc+1
0