본문으로 건너뛰기
Skillpedia
보안8.0k · #12737

trailmark

하는 일

소스 코드와 일부 경우 바이너리 코드를 함수, 호출, 클래스의 그래프로 분석합니다. 여러 언어로 된 프로젝트에서 보안 검토를 하는 검토자를 위한 것입니다.

사용하는 경우

  • ✓사용자 입력이 민감한 함수에 어떻게 닿는지 추적해야 할 때.
  • ✓프로젝트의 진입점과 공격 표면을 찾고 싶을 때.
  • ✓보안 검토를 준비하며 코드의 호출 구조를 탐색해야 하는 경우.

스킬 링크

https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 프로젝트의 코드 그래프를 만들고, 사용자 입력으로 도달할 수 있는 함수를 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 코드를 함수와 그 관계의 그래프로 분석한 다음, 그 그래프의 경로를 검색해 질문에 답합니다. 정적 분석이므로 프로그램이 실행되는 모습은 보지 않습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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-code skill 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(),

자주 묻는 질문

제 프로그램을 실행하나요?

아니요. 소스 코드를 정적으로 분석하므로 실행 중 동작은 볼 수 없습니다.

어떤 언어를 다루나요?

여러 언어를 다루며, 언어를 자동으로 감지할 수 있습니다.

코드 그래프에 메모를 추가할 수 있나요?

네. 가정이나 전제 조건 같은 모델이 추론한 메모를 코드 단위에 추가할 수 있습니다.

상세 정보

작성자의 원본 설명

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 fi

repo: trailofbits/skills

인기도

GitHub 스타
8.0k
순위
#12737
라이선스
CC-BY-SA-4.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬