trailmark
Builds and queries multi-language source and binary code graphs for security analysis. Includes pre-analysis passes for blast radius, taint propagation, privilege boundaries, entry point enumeration, proxy/unresolved-call tracking, type/reference queries, structural traversal, graph diffs, audit aug…
Install / Use
npx skills add trailofbits/skills --skill trailmarkInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
SecuritySupported Platforms
Our assessment of trailmark
trailmark scores 96/100 on our quality scale, 145th of 774 Security skills we index (top 19%).
Its SKILL.md is 17 KB long, well organised into 37 sections with 9 code examples: a thorough specification that gives an agent plenty to work with.
With 7,225 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 4 days ago, so trailmark is actively maintained.
- It is released under the CC-BY-SA-4.0 license; check its terms before commercial use.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-28. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
trailmark compared with similar skills
All 4 of these similar skills score higher than trailmark; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| trailmark (this skill)by trailofbits | 96 | 7.2k | 4d ago | SKILL.md |
| claude-memby thedotmack | 100 | 94.8k | today | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 5d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 5d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 6d ago | SKILL.md |
Frequently asked questions
- How do I install trailmark?
- Run
npx skills add trailofbits/skills --skill trailmark. The install tabs above show the steps for each supported agent. - Which AI agents does trailmark work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is trailmark safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is CC-BY-SA-4.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is trailmark still maintained?
- The repository was last updated 4 days ago, so trailmark is actively maintained.
Skill content
View source on GitHubname: trailmark
description: "Builds and queries multi-language source and binary code graphs for security analysis. Includes pre-analysis passes for blast radius, taint propagation, privilege boundaries, entry point enumeration, proxy/unresolved-call tracking, type/reference queries, structural traversal, graph diffs, audit augmentation, declared cross-language/FFI/external links via .trailmark/links.toml, and SQL schema graphs. Use when analyzing call paths, mapping attack surface, finding complexity hotspots, enumerating entry points, tracing taint propagation, measuring blast radius, importing SARIF/weAudit/binary findings, linking source graphs across language or RPC boundaries, or building a code graph for audit prioritization. Feature-gate version-specific Trailmark APIs before using them; prefer trailmark.parse.detect_languages() or --language auto when the target language is unknown or polyglot."
Trailmark
Parses source code into a directed graph of functions, classes, calls, and semantic metadata for security analysis.
When to Use
- Mapping call paths from user input to sensitive functions
- Finding complexity hotspots for audit prioritization
- Identifying attack surface and entrypoints
- Understanding call relationships in unfamiliar codebases
- Security review or audit preparation across polyglot projects
- Adding LLM-inferred annotations (assumptions, preconditions) to code units
- Importing external binary-analysis graphs to connect source and binary views
- Querying transitive slices, entrypoint paths, subgraph edges, or type references
- Producing graph evidence for one suspicious function or candidate finding
- Pre-analysis before mutation testing (genotoxic skill) or diagramming
When NOT to Use
- Single-file scripts where call graph adds no value (read the file directly)
- Architecture diagrams not derived from code (use the
diagramming-codeskill or draw by hand) - Mutation testing triage (use the genotoxic skill, which calls trailmark internally)
- Runtime behavior analysis (trailmark is static, not dynamic)
Rationalizations to Reject
| Rationalization | Why It's Wrong | Required Action |
|-----------------|----------------|-----------------|
| "I'll just read the source files manually" | Manual reading misses call paths, blast radius, and taint data | Install trailmark and use the API |
| "Pre-analysis isn't needed for a quick query" | Blast radius, taint, and privilege data are only available after preanalysis() | Always run engine.preanalysis() before handing off to other skills |
| "The graph is too large, I'll sample" | Sampling misses cross-module attack paths | Build the full graph; use subgraph queries to focus |
| "Uncertain edges don't matter" | Dynamic dispatch is where type confusion bugs hide | Account for uncertain edges in security claims |
| "Single-language analysis is enough" | Polyglot repos have FFI boundaries where bugs cluster | Use the correct --language flag per component |
| "Complexity hotspots are the only thing worth checking" | Low-complexity functions on tainted paths are high-value targets | Combine complexity with taint and blast radius data |
| "The docs mention a version-gated method, so I can call it anywhere" | Many environments still have Trailmark 0.2.x installed | Check the installed version or probe feature availability before using v0.4+/v0.5+ features |
Installation
MANDATORY: If trailmark is not found, install the CLI before doing anything else:
uv tool install trailmark
A tool install provides the CLI only — it does not make import trailmark resolvable.
Run the Python snippets in this skill with uv run --with trailmark python -; that, not
installation, is the fix for an import error or ModuleNotFoundError in a snippet.
DO NOT fall back to "manual verification", "manual analysis", or reading source files by hand as a substitute for running trailmark. The tool must be installed and used programmatically. If installation fails, report the error to the user instead of silently switching to manual code reading.
Version Gate
Trailmark 0.4.0 expands the graph model and query surface, and 0.5.0 adds a SQL parser, repository-link configuration, and richer entrypoint metadata. Before using a feature listed as v0.4+ or v0.5+, check the installed version:
trailmark --version 2>/dev/null || uv run trailmark --version 2>/dev/null
Compare the reported version numerically (not lexically). 0.4.0 or newer
means the full v0.4 surface is available. The version command itself was added
in 0.2.2, so a failure means either a pre-0.2.2 install or trailmark missing
entirely — distinguish with trailmark analyze --help. When working
programmatically, probe with hasattr() and fall back instead of assuming a
v0.4-only method exists:
if hasattr(engine, "subgraph_edges"):
edges = engine.subgraph_edges("tainted")
else:
# v0.2 fallback: filter engine.to_json() edges whose endpoints
# are both in engine.subgraph("tainted")
edges = []
v0.2-safe baseline: CLI analyze, diff, entrypoints, augment, and
--language auto; QueryEngine.from_directory(), callers_of(),
callees_of(), paths_between(), ancestors_of(), reachable_from(),
entrypoint_paths_to(), complexity_hotspots(), attack_surface(),
summary(), to_json(), preanalysis(), annotate(), annotations_of(),
nodes_with_annotation(), clear_annotations(), findings(), subgraph(),
subgraph_names(), diff_against(), augment_sarif(), and
augment_weaudit().
Added in 0.2.2: CLI --version flag and version subcommand.
Added in 0.3.x: the trailmark.parse module with module-level
detect_languages() and supported_languages(). detect_languages() itself
is v0.2-safe via from trailmark.query.api import detect_languages (kept as a
deprecated alias in 0.3+); supported_languages() has no 0.2.x equivalent.
v0.4+ features: native diagram subcommand; expanded parser coverage;
proxy nodes for unresolved calls; node origins; binary graph augmentation via
augment_binary(); connect_subgraphs(); subgraph_edges();
generic_parameters(); and type_references().
v0.5+ features: sql parser (PostgreSQL-oriented schemas, tables, views,
functions, procedures, dependencies); node kinds schema, table, view,
procedure; .trailmark/links.toml repository-link configuration (see
Repository Links below), including proxy.external:<symbol> nodes for
declared external endpoints; repository links, unresolved-call proxies, and
type_uses edges now materialize for single-language directory parses (0.4
emitted them only for polyglot parses); Solidity entrypoints detected from
parser metadata (interfaces excluded; solidity_visibility,
solidity_mutability, solidity_override, solidity_container_kind, and
solidity_overridden_by node attributes); attack_surface() entries carry an
attributes key when the node has attributes; TypeScript resolves receivers
assigned with new ConcreteClass(); C# file-scoped namespaces.
v0.5.0 adds no new QueryEngine methods, so hasattr(engine, ...) cannot
detect it. Gate v0.5 features on the reported version, or probe structurally:
from trailmark.models.nodes import NodeKind
has_v05 = "SCHEMA" in NodeKind.__members__ # sql kinds are 0.5+
Quick Start
# Auto-detect and merge every supported language under the tree
uv run trailmark analyze --language auto --summary {targetDir}
# Explicit languages (single language or comma-separated list)
uv run trailmark analyze --language rust {targetDir}
uv run trailmark analyze --language python,rust {targetDir}
# Complexity hotspots
uv run trailmark analyze --language auto --complexity 10 {targetDir}
# Entrypoint inventory and structural diff (v0.2-safe)
uv run trailmark entrypoints --language auto {targetDir}
uv run trailmark diff --language auto --repo {repoDir} main HEAD --json
# Version report (0.2.2+)
uv run trailmark --version
# v0.4+: native diagram command
uv run trailmark diagram -t {targetDir} -T call-graph -f main --depth 2
Programmatic API
# trailmark.parse is a 0.3+ module; on 0.2.x import detect_languages from
# trailmark.query.api instead (supported_languages has no 0.2.x equivalent)
from trailmark.parse import detect_languages, supported_languages
from trailmark.query.api import QueryEngine
# Ask the installed Trailmark build what it supports
supported_languages()
detect_languages("{targetDir}")
# Prefer auto for unknown or polyglot trees; use explicit lists when needed
engine = QueryEngine.from_directory("{targetDir}", language="auto")
engine = QueryEngine.from_directory("{targetDir}", language="python,rust")
engine.callers_of("function_name")
engine.callees_of("function_name")
engine.paths_between("entry_func", "db_query")
engine.complexity_hotspots(threshold=10)
engine.attack_surface()
engine.summary()
engine.to_json()
# Transitive slices and entrypoint path queries (v0.2-safe)
engine.ancestors_of("sensitive_sink")
engine.reachable_from("entry_func")
engine.entrypoint_paths_to("sensitive_sink")
# v0.4+: connect named subgraphs
if hasattr(engine, "connect_subgraphs"):
engine.connect_subgraphs("tainted", "privilege_boundary")
# Run pre-analysis (blast radius, entrypoints, privilege
# boundaries, taint propagation)
result = engine.preanalysis()
# Query subgraphs created by pre-analysis
engine.subgraph_names()
engine.subgraph("tainted")
engine.subgraph("high_blast_radius")
engine.subgraph("privilege_boundary")
engine.subgraph("entrypoint_reachable")
if hasattr(engine, "subgraph_edges"):
engine.subgraph_edges("tainted")
# Add LLM-inferred annotations
from trailmark.models import AnnotationKind
engine.annotate("function_name", AnnotationKind.ASSUMPTION,
"input is URL-encoded", source="llm")
# Query annotations (including pre-analysis results)
engine.annotations_of("function_name")
engine.annotations_of("function_name",
kind=AnnotationKind.BLAST_RADIUS)
engine.annotations_of("function_name",
kind=AnnotationKind.TAINT_PROPAGATION)
engine.nodes_with_annotation(AnnotationKind.FINDING)
engine.clear_annotations("function_name", kind=AnnotationKind.ASSUMPTION)
# v0.4+: generic/type-reference and binary augmentation APIs
if hasattr(engine, "generic_parameters"):
engine.generic_parameters("GenericTypeOrFunction")
if hasattr(engine, "type_references"):
engine.type_references("function_name")
if hasattr(engine, "augment_binary"):
engine.augment_binary("binary_graph.json")
Pre-Analysis Passes
Always run engine.preanalysis() before handing off to genotoxic or
diagramming-code skills. Pre-analysis enriches the graph with four passes:
- Blast radius estimation — counts downstream and upstream nodes per function, identifies critical high-complexity descendants
- Entry point enumeration — maps entrypoints by trust level, computes reachable node sets
- Privilege boundary detection — finds call edges where trust levels change (untrusted -> trusted)
- Taint propagation — marks all nodes reachable from untrusted entrypoints
Results are stored as annotations and named subgraphs on the graph.
For detailed documentation, see references/preanalysis-passes.md.
Language Selection
Do not hardcode a stale language table in downstream workflows. Ask the installed Trailmark build what it supports:
from trailmark.parse import detect_languages, supported_languages
supported_languages()
detect_languages("{targetDir}")
CLI patterns:
# Auto-detect and merge
uv run trailmark analyze --language auto {targetDir}
# Explicit list for a known polyglot target
uv run trailmark analyze --language python,rust {targetDir}
As of Trailmark 0.5.0, parser names include: `pytho
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
94.8kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
