Skip to content

Getting Started

github-actions[bot] edited this page Nov 12, 2026 · 4 revisions

Getting started

This page builds tripcord, scans a sample with two known findings, and explains the result. For every command and flag, see Commands.

Build

Download a release archive, or build from source with Go 1.27.3 (Installation covers both, and how to verify a release):

git clone https://github.com/vgmartinez/tripcord.git
cd tripcord
CGO_ENABLED=0 go build -trimpath -o tripcord ./cmd/tripcord

go install github.com/vgmartinez/tripcord/cmd/tripcord@main installs the same binary into $(go env GOPATH)/bin. Either way, tripcord version prints dev, because the version is only set at link time (Development).

Scan a sample

tripcord scan PATH scans the Git repository that contains PATH, or PATH itself when it is not inside a checkout. From that checkout, this scans two fixtures in a temporary directory. A raw fixture is a text archive: each file follows a -- path -- line, and member prints one file of it.

bin="$PWD/tripcord"
sample=$(mktemp -d)
mkdir -p "$sample/.vscode" "$sample/.github/workflows"
member() { awk -v want="-- $2 --" '/^-- .* --$/ { on = ($0 == want); next } on' "$1"; }
member rules/TC-CFG-002.test/positivos/folderopen-local-script.txtar .vscode/tasks.json > "$sample/.vscode/tasks.json"
member rules/TC-CFG-009.test/positivos/copilot-curl-pipe-sh.txtar .github/workflows/copilot-setup-steps.yml > "$sample/.github/workflows/copilot-setup-steps.yml"
(cd "$sample" && "$bin" scan .)

That command exits 1. This is the output, captured from that run (the rule id is a terminal link to its doc; the link target is not shown here):

2 finding(s): 0 critical, 2 high, 0 medium, 0 low; 0 warning(s); exit 1
HIGH TC-CFG-002 VS Code task that runs when the folder opens… .vscode/tasks.json
HIGH TC-CFG-009 Environment setup… .github/workflows/copilot-setup-steps.yml
re-run with -v for details

The default fail-on is high, and both findings are high, so the process exits 1. The same scan with mode: audit still prints the findings and exits 0. Save this as audit.yaml in the sample and pass it with --policy:

version: 1
mode: audit
fail-on: critical    # low | medium | high | critical
(cd "$sample" && "$bin" scan . --policy audit.yaml)

That prints the same two findings and exits 0. Layers, locks, and exceptions are in Policy.

The first line is the summary: counts by severity and the exit verdict. Each following line is one finding: severity, rule id (a link to that rule's doc), a short title, and the path. The last line says to re-run with -v, which prints the evidence, the fix, and a fingerprint you can use to triage it. --format json, sarif, md, and gha write the same findings for machines and ignore -v (Output and sinks).

How it works

  • The scan is local: adapters read configuration files and do not start the agent, run a hook, or make a network call, and --since denies Git's network transports (scan).
  • Rules are CEL with a fixed budget, so a busy machine does not change the result (scan).
  • Findings are built from sanitized text, and sinks redact again before display (Output and sinks).
  • Fingerprints are stable ids for triage; findings that involved a redacted secret use a per-machine key (Fingerprints).

Next steps

  • Scan a repository before you clone it: preopen.
  • Commit a policy and, optionally, embed tripcord into the repository's agent hooks: init.
  • Run it in CI: GitHub Action, or before each commit: pre-commit.

Clone this wiki locally