Skip to content

Users paste sensitive data into AI prompts — card numbers, phone numbers, home addresses, and whole résumés — often without realizing the risk. Once that data reaches your AI provider it can end up in logs, training pipelines, or model outputs, well outside your control.

Arcjet sensitive info detection scans prompt content inside your application, before it reaches the AI provider. Detection runs locally in your own environment, so the raw text never leaves your app: only the decision — whether sensitive data was found — is reported to Arcjet. When something is detected you choose what happens next: block the request, strip the data, or warn the user.

Sensitive info detection runs through a detection backend — the engine that scans the text and identifies entities. There are two:

  • Built-in engine (default). A WebAssembly engine bundled with the SDK. It detects four structured types — card numbers, email addresses, phone numbers, and IP addresses — runs anywhere the SDK runs (including edge runtimes), and needs no extra dependencies.
  • Rampart backend (optional, JavaScript SDKs). An on-device named-entity-recognition (NER) model that adds the free-form PII people actually paste into prompts — names, street addresses, and government or financial identifiers. This is often the more valuable engine for AI data loss prevention, because that is exactly the data a structured-pattern matcher can’t catch.

Both engines run entirely on your own infrastructure. Nothing is sent to a third party for analysis, which is what makes this safe to put in front of an AI provider in the first place.

Use deny to list the entity types to block, or allow to block everything except the types you list (the two are mutually exclusive). Tune the list to your app — a support bot that legitimately collects phone numbers should leave PHONE_NUMBER out of deny:

The built-in engine detects CREDIT_CARD_NUMBER, PHONE_NUMBER, EMAIL, and IP_ADDRESS. See the entity detection table for every type each backend supports, and for defining your own custom detectors.

Pass the text to scan as sensitiveInfoValue (JS) / sensitive_info_value (Python). For a chat endpoint this is usually the user’s most recent message. Pass the full conversation history instead if you want to scan every message, not just the latest one — useful when PII may have been introduced earlier in the exchange.

Set mode to "DRY_RUN" (JS) / Mode.DRY_RUN (Python) to log detections without blocking any requests. Run this in production for a while to audit what PII actually shows up in your prompts, then switch to "LIVE" once you’re confident in the entity list.

Sensitive info detection controls what data reaches your AI provider. Pair it with the other AI protection layers for full coverage: