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.
| Capability | Details |
|---|---|
| Code-aware detection | Parses 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 offline | The 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 work | CLI, 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?
| Feature | Details |
|---|---|
| Detection approach | Language-aware parsing plus entropy, variable names, and surrounding context |
| CLI commands | scan, watch, lsp, mcp, install, uninstall |
| Secret types | API 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 editors | MCP server (Claude Code, Cursor, Copilot, Codex), LSP server, native VS Code extension |
| CI | Official GitHub Action with SARIF upload to the Security tab |
| Output formats | Text, CSV, JSON, JUnit, SARIF, XML |
| Live validation | Separate trestle-net binary marks findings (active), (inactive), or (could not verify) |
| Configuration | .trestlerc.toml files plus inline trestle:skip directives |
| License | Apache-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.
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
- Install — Run
brew install toro-guapo/trestle/trestleon macOS, or build from source withcargo build --release. The result is a single static binary with no runtime dependencies. - Set up the project — Run
trestle installin the repository root. It adds a Git pre-commit hook and writes MCP and AI-assistant instructions to the project. - Scan — Run
trestle scanto check the working tree, ortrestle scan --deepto walk full git history. Findings print with a severity, location, and fingerprint ID. - Wire into CI — Add
toro-guapo/trestle-action@v1to a workflow, and pass--output-format=sarifto 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.
| Edition | Price | What it covers |
|---|---|---|
| Community | Free, Apache-2.0 | All 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 |
| Pro | Not published | AI-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.
| Alternative | Why consider it instead |
|---|---|
| Gitleaks | The de facto open-source standard: large community rule set, years of production use, fastest pre-commit scanning |
| TruffleHog | Live credential verification built into the core tool rather than a second binary, plus a commercial dashboard tier |
| detect-secrets | Yelp-built and baseline-aware, designed for adding secret scanning to a repository that already has findings to triage |
| GitGuardian | Managed 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.
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.