---
title: "Keep secrets out of Claude Code — redacted in flight · Selan"
description: "With secret scanning on, Selan replaces each credential Gitleaks' rules find in a Claude Code, Codex or Claude Desktop request before the provider gets it."
url: https://selan.ai/solutions/secrets
updated: 2026-11-15T18:34:23+02:00
---

Protect

# Stop secrets before they reach a provider.

Run Claude Code through Selan and turn secret scanning on: every request is swept for credentials on its way out, and each one Selan recognises is swapped for a placeholder before the request reaches the provider. People paste passwords and keys into AI tools without meaning to, and tools read them out of files.

[Start for free](https://auth.selan.ai/r)

**What Selan is, in one go.** Your company already pays for several AI accounts and models. Selan puts them in one setup, shows what each person spends, lets you set limits, and removes secrets it recognises before a request is sent.

01

## Nothing is scanned until you say so.

Scanning ships switched off. An owner turns it on once for the whole company, and the switch keeps the date it was moved and the name of the person who moved it.

-   One decision for everybody. Nobody has to install or configure anything.
-   The same is true of every other switch here. New abilities arrive off.
-   Turn it back off and scanning stops with the next request.

Privacy · reliability

Privacy & data

Secret scanningRedact credentials before a request reaches the model.23 Aug 15:12

InsightsRecord which repository each coding session ran in.23 Aug 09:31

Reliability

Fail over during an Anthropic outageOn a 529, send requests to your own provider keys instead.23 Aug 15:12

One request, on its way out

What the person pastedAWS\_SECRET\_ACCESS\_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCY

What the provider receivedAWS\_SECRET\_ACCESS\_KEY=\[REDACTED: aws-access-token\]

02

## It replaces the secret, not the work.

A matched value is swapped for a placeholder and the request carries on to the provider. Nobody gets an error, nobody loses a conversation, and the provider never sees the real value.

-   The rules are the ones the industry's own leak scanners use, not regular expressions we invented.
-   They are kept inside Selan, so a check does not depend on fetching a list from somewhere else.
-   Only what goes out is read. The model's answer coming back is never scanned.

03

## You see that it happened, not the secret.

The feed records who sent it, when, and which kind of credential matched. The value itself is not kept, so reading the record does not leak the thing it is about.

-   Treat a row as a job to do. A redaction is a reason to rotate that key, not an incident already closed.
-   The exact list of what is stored, and the one case where a provider's reply is written down, is on [Trust](https://selan.ai/trust).
-   The technical detail is in [the secret scanning docs](https://selan.ai/docs/secrets).

Logs · requests, and the secrets tab beside them

RequestsSecrets 0

TimeSessionWhoModelPriceStatus

14:32:1897f31fb1lleosonnet-5$0.0331200

14:31:2897f31fb1lleohaiku-4-5$0.0108200

14:29:3997f31fb1lleoopus-5$0.1847200

14:28:5597f31fb1lleosonnet-5$0.1243200

14:27:4138aa08d8aavasonnet-5$0.0847200

14:26:1038aa08d8aavaopus-5—429

14:25:5238aa08d8aavasonnet-5$0.0385200

## How it works

1.  01
    
    **An owner turns scanning on** for the company. Until then nothing is scanned.
    
2.  02
    
    **Selan checks the request** on its way out and replaces anything it recognises.
    
3.  03
    
    **The request goes on** to the provider, and the swap is noted in the feed.
    

FAQ

## Questions about keeping secrets out of Claude Code

How do I stop secrets in our code from being sent to the LLM provider when developers use Claude Code?

Run Claude Code through Selan and have an owner turn on secret scanning for the company. Each request is then held at the proxy and swept with Gitleaks' own rule set, and every match is replaced with a placeholder such as `[REDACTED: jwt]` before the request goes on to the provider.

Does it cover what Claude Code reads from files, such as `cat .env`?

Yes. Every message in the request is scanned, including the tool results that carry what a command printed or a file contained, which is how a secret usually arrives. The system prompt, the tool definitions and the commands the model asked to run are scanned too.

Does secret scanning block the request or stop the session?

No. It redacts and forwards, so nobody gets an error over a secret and the conversation carries on. It refuses a request in two cases: when the scanner cannot be reached, the request is not sent at all, so nothing goes upstream unscanned; and a body over 24 MiB, more than it will hold to sweep, is refused with a 413.

Does it work for Codex and Claude Desktop as well?

Yes. The setting is per company, not per client. Codex and Claude Desktop send their requests through the same proxy, so they get the same sweep, and there is nothing to switch on a second time.

Does Selan keep a copy of the secret it removed?

No. A detection records the rule that fired, how many values it matched and twelve hex characters of a hash, never the value or any part of it. The request body is held in memory for the length of the request and is not stored.

How can I test it without a real credential?

Assemble a JWT that signs nothing and ask Claude Code to read it back to you. If scanning is on, the model only ever sees the placeholder; if it reads the token back, scanning is off. [The secret scanning docs](https://selan.ai/docs/secrets) have the three lines that build the token.

## What to know

-   The secret does leave the laptop. It is caught at Selan, on the way to the provider, which is the last point we control.
-   It catches secrets that match a known shape. A password that looks like ordinary text is not something any scanner can recognise.
-   The request is held for as long as the check takes, so scanning adds a little delay.
-   Selan receives the whole request, including your prompts. The text of it is not stored: there is no field that holds a prompt. What does reach our log is about failures. When a provider rejects a request, up to 2 KB of its reply is written down, and a provider's message can quote the part of your request it objected to. When a stream breaks halfway, the provider's error is written down too, along with a shape record of what we had sent: how many items, what kind each was, and how many bytes. Never the words.
-   Selan is built and hosted in the EU. The provider you send a request to is not, and that hop is theirs.

## The other three

## Turn it on and watch one week.

Switch scanning on for your company and watch a week of your own traffic — what the feed catches, and what it honestly cannot. Free for up to three seats, and the Free plan needs no card.

[Start for free](https://auth.selan.ai/r)
