Skip to content
Trestle

Trestle

NEW
Category: Secrets
License: Free (Open-Source, Apache-2.0)
Suphi Cankurt
Suphi Cankurt
+8 Years in AppSec
Updated August 4, 2026
8 min read
Key Takeaways
  • Trestle parses source files with language-aware parsers rather than plain regex, so it can tell a hardcoded credential apart from a build argument, header, or parameter.
  • It ships as one static Rust binary and runs as a CLI, file watcher, pre-commit hook, LSP server, MCP server for AI assistants, and a native VS Code extension.
  • The default binary is fully offline; a separate trestle-net binary adds optional live validation that checks whether a detected secret is still active.
  • Open core under Apache-2.0: the Community edition handles detection, while the commercial Pro tier adds remediation and rotation guidance.
  • The public GitHub repository is a read-only mirror refreshed on each Community release, with development in a private repository, so its star and contributor counts are not a maturity signal; the current release is Community 1.4.1.

Trestle is an open-source secret scanner that reads your source code the way the program loading it would. It catches API keys, access tokens, passwords, and private keys before they reach a commit.

Instead of running plain regular expressions, Trestle parses each file with language-aware parsers. That lets it tell a hardcoded credential apart from a build argument, a header, or a placeholder.

Trestle is built by S.C. TORO GUAPO S.R.L., a company based in Bucharest, Romania. It follows an open-core model: the Community edition on GitHub is Apache-2.0 and handles detection, while a commercial Pro tier adds remediation and rotation guidance.

This is a new project. The public GitHub repository is a read-only mirror refreshed on each Community release, with development happening in a private repository, so the star and contributor counts there are not a useful maturity signal. The current release is Trestle Community 1.4.1.

What is Trestle?

Trestle is a secret scanner aimed at AI-assisted development, where code an assistant writes can land in commits, client bundles, and future training data within seconds. It scans every file and every commit locally, so credentials never leave your machine.

It ships as one static Rust binary with no runtime to install. The single tool runs in several modes: a command-line scanner, a file watcher, a pre-commit hook, an LSP server, an MCP server for AI assistants, and a native VS Code extension.

CapabilityDetails
Code-aware detectionParses files with language parsers rather than raw-text regex, so the right rule applies to the right kind of value — a constant, an environment variable, a header, or a build argument.
Local and offlineThe default binary runs entirely on your machine. No network, no telemetry, no account, no signup. It honors .gitignore and your own skip rules.
Runs where you workCLI, watch mode, pre-commit hook, LSP for Neovim, Helix, Zed, and JetBrains, plus an MCP server and a VS Code extension.

What are Trestle’s key features?

FeatureDetails
Detection approachLanguage-aware parsing plus entropy, variable names, and surrounding context
CLI commandsscan, watch, lsp, mcp, install, uninstall
Secret typesAPI keys for OpenAI, Anthropic, Stripe, AWS, GitHub, Google, Slack, Sentry; private keys (PEM, OpenSSH, PuTTY, PKCS, DER, x509, PGP); JKS, KeePass, BIP39 recovery phrases, URLs, headers
AI and editorsMCP server (Claude Code, Cursor, Copilot, Codex), LSP server, native VS Code extension
CIOfficial GitHub Action with SARIF upload to the Security tab
Output formatsText, CSV, JSON, JUnit, SARIF, XML
Live validationSeparate trestle-net binary marks findings (active), (inactive), or (could not verify)
Configuration.trestlerc.toml files plus inline trestle:skip directives
LicenseApache-2.0 (Community); commercial Pro tier

Code-aware detection

Most secret scanners match raw text with regular expressions and randomness checks. Trestle parses the file first, which lets it read the structure the way the loading program would.

For example, Trestle reports a Stripe key as “assigned to constant STRIPE_KEY” rather than just flagging a matching string. That structural context is what lets it separate a real assignment from a build argument, a demo placeholder, or a value that happens to look random.

Note
Why parsing over regex
Because Trestle knows whether a value is a constant, an environment variable, a header, or a parameter, it can apply entropy checks against the surrounding code instead of the raw string alone. That context is how it aims to keep false positives down.

What it detects

Detection covers hundreds of credential patterns for named services including OpenAI, Anthropic, Stripe, AWS, GitHub, Google, Slack, and Sentry. It also recognizes private keys and certificates in PEM, OpenSSH, PuTTY, PKCS, DER, x509, and PGP formats.

Beyond service keys, Trestle flags JKS keystores, KeePass databases, BIP39 crypto wallet recovery phrases, URLs, and headers. Unfamiliar keys that match no known pattern can still surface through entropy combined with variable names and context.

The project publishes a reproducible comparison against Gitleaks, TruffleHog , and detect-secrets , using public repositories and short commands. Treat its head-to-head numbers as the vendor’s own claims — the disclosure notes Trestle’s creators authored the benchmark.

Editor, AI-assistant, and CI integration

The MCP server exposes tools like scan_proposed, which scans proposed file content before it is written to disk. An AI assistant calls it, gets the findings back over stdio, and can fix the leak instead of writing the file. The server makes no network calls and retains no scanned content.

For editors, trestle lsp runs a language server for Neovim, Helix, Zed, and JetBrains IDEs, and the official VS Code extension shows findings inline as you type. In CI, the toro-guapo/trestle-action@v1 GitHub Action scans pushes and pull requests and can emit SARIF for the GitHub Security tab.

Live validation and git history

The default trestle binary never touches the network. A separate trestle-net binary adds an optional check that contacts each secret’s provider to confirm whether it is still valid, labeling findings (active), (inactive), or (could not verify).

Removing a secret in a new commit does not erase it from history. The --deep flag scans every reachable commit across branches, tags, remotes, stash, and dangling objects, applying the same rules as the working tree.

How do I install and run Trestle?

Install the binary, then set it up inside a project. The trestle install command wires in the pre-commit hook and AI-assistant instructions in one step.

# macOS via Homebrew
brew install toro-guapo/trestle/trestle

# or build from source (a recent stable Rust toolchain)
cargo build --release

Building from source produces two binaries: trestle (offline) and trestle-net (optional live validation). Once installed, run these in a project root:

trestle install   # adds a pre-commit hook and AI instructions
trestle scan      # scans the current directory
trestle watch     # rescans as files change
  1. Install — Run brew install toro-guapo/trestle/trestle on macOS, or build from source with cargo build --release. The result is a single static binary with no runtime dependencies.
  2. Set up the project — Run trestle install in the repository root. It adds a Git pre-commit hook and writes MCP and AI-assistant instructions to the project.
  3. Scan — Run trestle scan to check the working tree, or trestle scan --deep to walk full git history. Findings print with a severity, location, and fingerprint ID.
  4. Wire into CI — Add toro-guapo/trestle-action@v1 to a workflow, and pass --output-format=sarif to upload results to the GitHub Security tab.

How much does Trestle cost?

Trestle follows an open-core split. The Community edition is free under Apache-2.0; Pro is a commercial tier with no published price.

EditionPriceWhat it covers
CommunityFree, Apache-2.0All detection rules and language parsers, deep git history scanning, editor and AI-assistant integrations, optional live validation, CLI and watch mode and pre-commit hook, every output format, local-only with no account or telemetry
ProNot publishedAI-ready remediation and rotation guidance, secret exposure analysis, priority support, Pro source code included for large teams

Everything a scanner needs to find secrets sits in the free tier. Pro sells what happens after a finding: how to rotate the credential and how far the exposure reached.

Because Pro carries no list price, budget a sales conversation if remediation guidance is the reason you are looking.

What are Trestle’s limitations?

The project is young and single-vendor. Trestle first shipped in 2026 from one company, and the public repository is a read-only mirror rather than the development tree. There is no independent community maintaining rules.

The vendor authored the only head-to-head benchmark. Trestle publishes a reproducible comparison against Gitleaks, TruffleHog, and detect-secrets, and its own disclosure notes the creators wrote it. Treat the numbers as vendor claims and reproduce them on your own repositories.

Detection breadth is unproven at scale. Hundreds of credential patterns is a reasonable starting set, but Gitleaks and TruffleHog have years of community rule contributions and adversarial testing behind theirs.

Live validation needs a second binary. The offline-by-default design is deliberate, but it means trestle-net is a separate install and a separate network-policy decision.

Language-aware parsing has a coverage edge case. A parser-first approach depends on having a parser for the file type in front of it; regex-first scanners degrade more gracefully on unfamiliar or malformed files.

What are the alternatives to Trestle?

The closest alternatives are Gitleaks, TruffleHog, detect-secrets, and GitGuardian. Which one fits depends on whether you value maturity or the code-aware detection approach.

AlternativeWhy consider it instead
GitleaksThe de facto open-source standard: large community rule set, years of production use, fastest pre-commit scanning
TruffleHogLive credential verification built into the core tool rather than a second binary, plus a commercial dashboard tier
detect-secretsYelp-built and baseline-aware, designed for adding secret scanning to a repository that already has findings to triage
GitGuardianManaged platform with incident workflows, historical scanning, and organisation-wide dashboards if you want a vendor rather than a binary

For the wider field, the secret scanning tools category compares the established options side by side, and Gitleaks vs TruffleHog covers the two most common picks head to head.

When to use Trestle

Trestle fits teams that write code with AI assistants and want the scanner to catch leaks at the point of generation, before a commit, rather than after a push. The MCP server and pre-commit hook both sit early in that loop.

Because it parses code instead of matching raw text, it is a reasonable pick when regex-first tools have produced too many false positives on your repositories. It runs offline by default, which suits environments that cannot allow outbound calls during a scan.

Tip
Best for
Developers using AI coding assistants who want local, offline secret scanning wired into the editor, the assistant, the pre-commit hook, and CI from one binary.

It fits less well where maturity is the deciding factor. Teams that need a large community rule ecosystem or a long production track record are better served by Gitleaks or TruffleHog today.

Disclosure

Trestle was submitted to AppSec Santa by Andreea Bardasu of the Trestle project. I received no compensation and the project had no editorial control over this page. Its own comparison against Gitleaks, TruffleHog, and detect-secrets is a vendor-authored benchmark, flagged as such above.

Frequently Asked Questions

What is Trestle?
Trestle is an open-source secret scanner licensed under Apache-2.0. It reads source files with language-aware parsers to find API keys, access tokens, passwords, private keys, and certificates before they get committed. It runs entirely on your machine with no account, telemetry, or network calls.
How is Trestle different from Gitleaks or TruffleHog?
Trestle parses each file the way the program loading it would, so it distinguishes an environment variable from a build argument, header, parameter, or constant. Regex-first scanners like Gitleaks match raw text. The project publishes its own reproducible comparison against Gitleaks, TruffleHog, and detect-secrets, though the vendor authored that benchmark.
Does Trestle work with AI coding assistants?
Yes. Trestle ships an MCP server that Claude Code, Cursor, Copilot, and Codex can call to scan proposed file content before it is written to disk. Running trestle install adds the server entry to the project’s .mcp.json. The MCP server communicates over stdio and makes no network calls.
Is Trestle free?
The Community edition is free and open-source under Apache-2.0, covering all detection rules, git history scanning, editor and AI integrations, and every output format. A commercial Pro tier adds remediation guidance, secret exposure analysis, and priority support.
Can Trestle check whether a leaked secret is still active?
Yes, through a separate trestle-net binary. Running trestle-net scan –validate contacts each detected secret’s provider and labels the finding (active), (inactive), or (could not verify). The default trestle binary stays fully offline and makes no network requests.