Skip to main content

Sensitive data scanning

A developer can paste a card number or a live API key into a prompt by mistake. Proxium is the last stop before the request goes to a vendor. So it is the last place where that value can still be stopped.

:::info State on proxium.tech Each project uses the default policy of the gateway until it sets its own classes. On proxium.tech the default is credit_card, card_security, iban, national_id and credential on redact, with an alert, and every other class off. You set each class on the Data protection screen. See Protect sensitive data. :::

What it finds​

ClassFindsCheck against false matches
credit_cardCard numbersThe Luhn check digit
ibanBank account numbersThe mod-97 check
emailEmail addresses
phonePhone numbers
credentialAWS, GitHub, Slack, Stripe, OpenAI, Anthropic, Google and GitLab keys, JWTs, private key blocks, passwords in URLs such as postgres://user:pass@host, Authorization: Bearer values, *_KEY=, *_SECRET= and *_TOKEN= assignmentsThe known format of each key, or a long random value after a secret word
card_securityAn expiry date or a security codeOnly near a card number
national_idUS SSN, UK National Insurance number, Romanian CNP, Spanish DNI and NIE, Italian codice fiscaleThe check digit or check letter, or the strict structure of the number
ip_addressIPv4 and IPv6 addressesEach part in range; no version numbers such as 1.2.3.4.5
customThe words and phrases of your project's listA whole word, in any case
prompt_injectionKnown instruction-override shapes, also in base64

The scan reads the whole request body except the model field. Each matcher reads the text one time, from start to end, with no regular expressions. One automaton finds your terms in a single pass too. So a long or a hostile prompt cannot slow it down.

What it does with a match​

Each class has one of four actions:

ActionThe requestThe match
offGoes out unchangedNot looked for
flagGoes out unchangedLogged, and an alert is sent
redactGoes out with a placeholder in place of the valueLogged, and an alert if you turned it on
blockIs refused with 403 guardrail_blockedLogged, and an alert if you turned it on

Use flag to watch real traffic before you choose redact or block.

Fig. 1 · what the scan does with a card number

Example: a request holds the text Refund card 4242 4242 4242 4242. Proxium scans it in one pass, before the response cache, the stored prompts, the memory and the vendor.

  • credit_card on block: the call gets 403 guardrail_blocked. Nothing is sent or stored.
  • credit_card on redact: the value becomes [REDACTED:credit_card:1]. Only the placeholder reaches the response cache, the stored prompts, the memory and the vendor.
  • No match, or credit_card on flag: the request goes out unchanged. A flag logs the match and sends an alert.

A project on the default policy has credit_card, card_security, iban, national_id and credential on redact, with an alert.

Example. The prompt Refund card 4242 4242 4242 4242, please, with credit_card set to redact, goes to the vendor as Refund card [REDACTED:credit_card:1], please. The same value two times gets the same number, so the model can still tell that two mentions are one card.

With block, your app gets:

403 body
{
"error": {
"message": "blocked by egress guardrail: credit_card detected at /messages/0/content (the matched value is deliberately not echoed)",
"type": "guardrail_blocked",
"code": "guardrail_blocked"
}
}

Where the value never goes​

The scan runs first in a call, before the response cache, the stored prompts, the memory and the vendor. A redacted or blocked value is therefore never written anywhere.

Each match writes an audit record: the project, the app, the key prefix, the time, the class and the action. It also names the place in the request, such as /messages/0/content. The record never holds the matched value. The refusal message and the alert do not hold it either. A flag sends the value to the vendor unchanged, so it is in the stored prompts if your project keeps them.

The secrets that memory already stored​

The scan above runs before memory stores a call. So a redact policy keeps a key out of memory. A project on flag, or one that turned a class off, stores the prompt as the person typed it.

Memory reads that text again when it writes a chunk. It keeps a finding for each secret it sees: the detector, the rule, the message and the window, and a preview. The preview is the secret with its middle cut out, and it holds at most 4 characters at each end. A hash of the preview names the finding. The secret itself never comes back.

A row also answers the app of the conversation, its first line and its start, so a person knows where the secret was pasted.

A value that no person can act on is no finding. The scan reads a value as a URL when it starts //, holds :// or ends /v1. It reads a value as the path of a file when it starts /, ~/ or ./, as in cat /data/build/app.rs. It reads a value as a documented example when it holds example, or a run of four characters that climb or fall by one. The scan closes each with a reason: not a secret: URL, not a secret: a path or example: a documented value or a run of characters. A row that an older scan stored closes on the first read of the page. That holds when an older pass judged its value as a secret. When a read finds a row that no pass judged, it closes the rows that the preview settles. It then starts the pass over the stored text in the background, so the read answers at once. An operator can ask for the pass again with POST /provision/teams/{tenant}/memory/secrets-recheck.

Four tools and four routes answer the findings. An agent uses proxium_security_summary for the count by detector, rule, conversation or day. proxium_security_session answers the findings of one conversation. proxium_security_dismiss dismisses one finding as fixed, false-alarm or ignored. proxium_security_rules reads, adds and removes the shapes of the project's own tokens. A person dismisses a finding in the console. The button of a kind closes every open finding of that kind, and calls POST /api/teams/{slug}/memory/secrets/dismiss-kind.

One dismissal covers every finding with the same preview. So a key that a person pasted in two conversations is one decision. A dismissed finding leaves the summary. It stays in the answer about its conversation, because that text still holds the secret. A person has to change the secret at its provider: a dismissal does not remove the text of the conversation.

The detector set finds the shape of a key. It looks for a literal prefix such as sk_live_, ghp_ or AKIA, and for an Authorization: Bearer value. It also looks for a JWT, a private key block, and a secret word with a value after it, such as password or api_key. A word like password with no value is no finding. A rule is a prefix and the shortest secret that follows it. A rule is not a regular expression, so a pattern from a person cannot make the writer of memory slow.

Alerts​

An alert goes to the channels of Settings › Spend alerts: Slack, Discord, Telegram or a webhook. Proxium sends at most one alert for each class and app in a short window. The alert says how many requests matched since the last alert of that class and app, and it never holds the value.