Trestle
Local secret scanning for AI-assisted development

Bots scrape every public push within seconds. Don't let your AI hand them your secrets.

Code your AI writes ends up in more places than you'd want. Scrapers pull it from public commits in almost real time, client bundles ship it to every visitor's browser, and today's commits train tomorrow's models. Trestle works alongside your AI assistant, scanning every file and every commit, so your secrets stay yours.

>Add an OpenAI client to src/api.ts.

I'll write the client and use trestle to verify it doesn't leak any secrets.

scan_proposed
CRITICAL ./src/api.ts:3:16 OpenAI API key assigned to constant "apiKey".

Found a hardcoded API key. I'll move it to .env and reference it via process.env.API_KEY.

edit src/api.ts
- const apiKey = "sk-proj-LgIBYkSBMSqOCxIvBN77FLNPLY7uuxNyrWlyPaBi7dNWb6OR"
+ const apiKey = process.env.API_KEY
write .env
+ API_KEY=sk-proj-LgIBYkSBMSqOCxIvBN77FLNPLY7uuxNyrWlyPaBi7dNWb6OR

Done. The key is now in .env (already gitignored). Set API_KEY on your deployment environments too.

Reality check

Secrets in code, by the numbers.

Features

How Trestle stops the leak before it ships.

A local secret scanner that plugs into your editor, your AI assistant, and your CI. Every file and every commit gets checked before it leaves your machine.

Detection

Catches hundreds of real credential patterns, and can still flag unfamiliar keys by looking at entropy, variable names, and surrounding context.

Services
OpenAIAnthropicStripeGitHubAWSGoogleSlackSentry + more
Private keys & certificates
PEMOpenSSHPuTTYPKCSDERx509PGP
Other formats
JKSKeePassBIP39URLsHeaders + more

AI and editors

MCP server for Claude Code, Cursor, Copilot, Codex, and any MCP-aware tool. Native VS Code extension. Language server for Neovim, Helix, Zed, JetBrains, and any LSP-aware editor.

src/payments.ts
3 const STRIPE_KEY = "sk_live_OmU9EOoilAk4SsMg4iGWduUM";
4 const stripe = new Stripe(STRIPE_KEY);
5
6 function processPayment() {
CRITICAL Stripe API key found
Fix...
Pro

Remediation guidance

Every finding ships with the steps to extract the secret out of source, what to put in your .env locally, and per-platform rotation steps tailored to the deployment targets it finds in your repo.

Rotation playbooks for
AWS Secrets ManagerGitHub ActionsVercelNetlifyKubernetes SecretsDoppler + more

Understands your code

Language parsers, not just regular expressions. Trestle can tell apart environment variables, build arguments, headers, parameters, and source code variables and constants, so the right rule applies to the right kind of value.

Languages
JavaScriptTypeScriptPythonGoRubyJavaPHPShellDart + more
Deployment targets
VercelNetlifyAWSGCPAzureKubernetesCloudflareHeroku + more
CI manifests
GitHub ActionsGitLab CIKubernetes SecretsJupyter + more

Command line and CI

One static binary. trestle scan, plus trestle watch for live rescans. Auto-installed pre-commit hook stops bad commits.

Output formats
TextCSVJSONJUnitSARIFXML

Local and fast

Runs entirely on your machine. No network, no telemetry, no account, no signup.

Multi-threaded with an incremental cache. Honors .gitignore plus your own skip rules.

Soon
Pro

Deep git history scanning

Removing a leaked secret in a new commit does not erase it from history. Anyone with the repo can still pull it back.

Trestle will scan every commit on every branch, applying the same detection rules as your working tree, so old leaks stop hiding in plain sight.

Pricing

Free for individuals, priced for any team.

Open source and free for personal use. Pro adds remediation guidance as well as commercial licensing and per-seat pricing that scales as you grow.

$0

Free, open source, and yours. No account, no telemetry. Just install and scan.

Community

  • All detection rules and language parsers.
  • Editor and AI assistant integrations.
  • Command line, watch mode, pre-commit hook.
  • Every output format.
  • Local-only. No account, no telemetry.
  • AI-ready remediation and rotation guidance.
  • Deep git history scanning (when available).
  • Commercial use license.
  • Priority support.
Install

Install Trestle in seconds.

Trestle is a single static binary: no runtime to install, nothing to configure. Download a build for your platform, or compile from source.

  1. Download Trestle Community 1.0.0 for Apple Silicon (M1 or later) or Intel (older Macs).
  2. Double-click the downloaded file to extract it.
  3. Open your home folder in Finder and drag the extracted file there.
  4. Open Terminal and run: echo 'export PATH="$HOME:$PATH"' >> ~/.zshrc && source ~/.zshrc.

Once installed, set up Trestle in a project by running trestle install in that project's root directory.

AI assistants

Claude Code, Cursor, Copilot and other AI agents can use Trestle to scan their output before writing files. They get the same findings as on the command line.

Git

Trestle runs automatically before each commit. If secrets are found, the commit is aborted and the findings are reported so they can be addressed.

Editors

Set trestle --lsp as the language server in Neovim, Helix, Zed, or JetBrains IDEs, or install the official Trestle extension for Visual Studio Code.