Back to Skills

trailmark

Builds and queries multi-language source code graphs for security analysis. Includes pre-analysis passes for blast radius, taint propagation, privilege boundaries, and entry point enumeration. Use when analyzing call paths, mapping attack surface, finding complexity hotspots, enumerating entry points, tracing taint propagation, measuring blast radius, or building a code graph for audit prioritization. Prefer `trailmark.parse.detect_languages()` or `--language auto` when the target language is un

5,841stars513forksUpdated 6/24/2026

Security Assessment

Safe(100/100)
Security Score100/100

About trailmark

A security-analysis skill that builds and queries multi-language source code graphs. It parses source into a directed graph of functions, classes, calls, and semantic metadata, then layers on pre-analysis passes for blast radius, taint propagation, privilege boundaries, and entry-point enumeration. Typical uses include mapping call paths from user input to sensitive functions, finding complexity hotspots for audit prioritization, identifying attack surface and entry points, understanding call relationships in unfamiliar codebases, and preparing for security review across polyglot projects. For unknown or mixed-language trees it prefers `trailmark.parse.detect_languages()` or `--language auto`.

Both a CLI and a programmatic QueryEngine API are provided. The CLI runs analyses like `uv run trailmark analyze --language auto --summary {targetDir}` and complexity hotspot scans, while the API exposes queries such as callers_of, callees_of, paths_between, complexity_hotspots, attack_surface, summary, and to_json. Pre-analysis is run via `engine.preanalysis()` and enriches the graph with four passes: blast radius estimation, entry-point enumeration by trust level, privilege boundary detection where trust transitions untrusted to trusted, and taint propagation marking nodes reachable from untrusted entrypoints. Results are stored as annotations and named subgraphs (for example tainted, high_blast_radius, privilege_boundary, entrypoint_reachable), and the skill stresses always running pre-analysis before handing off to the genotoxic or diagramming-code skills.

The graph model includes node kinds such as function, method, class, module, struct, interface, trait, enum, and contract, and edge kinds calls, inherits, implements, contains, and imports, each carrying a confidence level of certain, inferred, or uncertain. Per code unit it captures parameters with types, return and exception types, cyclomatic complexity, docstrings, and annotations including assumption, precondition, blast_radius, and taint_propagation. A key concept is the gap between a function's declared contract and its effective input domain where vulnerabilities hide, and the skill warns that dynamic dispatch produces uncertain edges that must be accounted for in security claims. Installation is mandatory (`uv pip install trailmark`) and the skill explicitly forbids falling back to manual code reading; it is not for single-file scripts, hand-drawn architecture diagrams, mutation testing triage, or runtime behavior analysis.

FAQ

What languages does Trailmark support?

The skill avoids hardcoding a language table and instructs you to ask the installed build via `supported_languages()` and `detect_languages()`. For unknown or polyglot trees it recommends `--language auto`, or an explicit comma-separated list like `python,rust`.

What does pre-analysis add to the graph?

Running `engine.preanalysis()` adds four passes: blast radius estimation, entry-point enumeration by trust level, privilege boundary detection, and taint propagation. Results are stored as annotations and named subgraphs such as tainted and high_blast_radius.

Do I have to install anything?

Yes. Installation is mandatory: if `uv run trailmark` fails, run `uv pip install trailmark` before doing anything else. The skill forbids substituting manual code reading and says to report installation errors to the user instead.

How does it handle dynamic dispatch?

Dynamic dispatch produces `uncertain` edges, distinct from `certain` direct calls and `inferred` attribute access. The skill warns you to account for edge confidence when making security claims, since type confusion bugs hide in uncertain edges.

When should I not use this skill?

Avoid it for single-file scripts where a call graph adds no value, architecture diagrams not derived from code, mutation testing triage (use the genotoxic skill), and runtime behavior analysis, since Trailmark is static rather than dynamic.

All Files

5 files
assets/trail-of-bits-mark.svg3.0 KB
View
SKILL.md7.9 KB
View
references/preanalysis-passes.md4.6 KB
View
agents/openai.yaml0.1 KB
View
references/query-patterns.md4.2 KB
View

Install trailmark

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill