
Klarion
io.github.0x1AdiPublished by GitHub account 0x1Adiv0.4.3Updated Oct 24, 2026
Secret scanning for AI agents: rules and entropy find candidates, a model decides which are real.
Overview
Klarion scans code for secrets — API keys, passwords and tokens — using local rules plus an AI model to judge which candidates are real.
- What you can do
- Scan text or a file for secrets before code is written or committed, with candidates judged by a model or handed to the calling agent
- Flag known key formats, password-style assignments, credential files and base64 or hex-hidden secrets, plus entropy checks
- Report findings with severity, location, masked value and a verdict with confidence
- Suppress false positives and review what was suppressed
- Run as a local MCP server alongside CLI scans, commit hooks and CI use
- When to use it
- Use it when an assistant writes or edits code and you want secrets caught before they land in a file or commit, or when you want a second opinion on whether a flagged string is a real credential rather than a test value or hash.
- Requirements
- Runs as a local process (stdio) on the user's machine, installed via Homebrew, Go, a release binary or the packaged bundle. A model is needed for judging: ANTHROPIC_API_KEY by default, or an OpenAI-compatible key, a local Ollama model, or a Claude Code login configured in .klarion.toml. Without a model the server passes candidates to the calling agent instead.
Installation
In SourceWeft
- Open Klarion in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
[CI] [Go Reference] [License MIT]
Install · Use it · Results · How it works · Reference
Klarion finds secrets in your code: API keys, passwords and tokens.
It works in two steps:
- Find. Fast local checks flag anything that looks like a secret.
- Check. An AI model reads each one with the code around it and decides if it is real.
Pattern scanners stop at step 1, so they also flag test values, IDs and hashes. Klarion shows you the real leaks.
It runs where the leak happens
A Claude Code hook that blocks the write before the file exists. The agent cannot route around it, not through the file tools and not through Bash.
Install
macOS:
Anywhere else, with Go 1.25 or newer:
Or download a binary from the releases page.
Klarion needs an AI model. Pick one:
Settings go in .klarion.toml under [ai]. All options are in the reference.
Use it
On a pull request it scans only what the PR adds. It caches the AI answers, so unchanged code
costs nothing. Findings show in the job log. On a private repo without GitHub Code Security,
add upload-sarif: "false" to skip the Security tab upload. GitLab CI and every option are in
the reference.
Without the stages line the hook is off and runs only when you ask for it, with
pre-commit run --hook-stage manual klarion. The klarion hook builds Klarion with Go the
first time it runs; use id: klarion-system if klarion is already installed. Everyone who
commits needs a model set up.
The agent calls scan_text before it writes code and scan_file before it commits. Approve
each call rather than auto-approving the server: scan_file reads any path it is given. With no
model configured the server hands each candidate and its decision rules to that agent to judge,
so it needs no API key. Configure one and Klarion judges instead. Full steps, including the
tools and how to verify the install: llms-install.md.
Results
Klarion found about 1.7× more real secrets than gitleaks, and 89% of its alerts were real (gitleaks: 91%).
We tested Klarion v0.3.0 on CredData: 337 real open source repos where Samsung labeled the lines that hold secrets. These numbers cover code outside test folders.
Good to know:
- Klarion skips test fixtures and docs examples on purpose. CredData counts those as real. Counted that way, Klarion found 9% and gitleaks 46%.
- Klarion's numbers come from a sample of 612 AI checks with one model (Claude Haiku). The likely range is 30 to 40% found and 82 to 97% real.
- CredData's labels came from what other scanners found, which helps those scanners.
Full method and data: benchmark/REPORT.md.
How it works
[Step 1 runs local checks and finds candidates. Step 2 an AI model checks each one: real secrets fail the scan, the rest are hidden.]- Step 1 runs on your machine. It looks for known key formats,
password = valuestyle lines, credential files like.pgpass, and secrets hidden in base64 or hex. It also checks how random a string looks. - Step 2 asks the model. Each candidate goes out with a few lines of code. The model answers secret, false positive or uncertain. Uncertain counts as a secret.
- You can see what was hidden. Run
klarion scan . --show-suppressed. - Your code goes only to the model you pick. Set
send_secret = falseto send a masked value instead. It is less accurate.
Limits
- It needs a model. Without one,
klarion scanand the commit hooks stop with an error. The Claude Code hook still blocks provider keys such as AWS, GitHub and Stripe, and the MCP server hands the candidates and its rules to your agent to judge. - No API key? A hosted judge with no setup is coming. Join the list.
- The model can be wrong. Check what it hid with
--show-suppressed. - It finds secrets, it does not fix them. Rotate any secret it finds.
- Local hooks can be skipped with
git commit --no-verify. Run Klarion in CI too, with the Action. The pre-commit hook checks staged changes only, so in CI it has nothing to check.
More
Reference · Benchmark · Design · Changelog · Contributing · Security
MIT © The Klarion Authors
Source: README.md at commit cb36931
Tools
0Version history
3- v0.4.3LatestSep 21, 2026
- v0.4.1Sep 19, 2026
- v0.3.8Sep 18, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts