Dashboard|

PII Protection

Opt-in blocking of requests that contain personal data. Off by default; turn it on per project.

PII protection is off by default. Cencori does not make security decisions for your project unless you turn this on. If you send an email address or a card number and get 200 OK, that is the expected default. This page covers the gateway. For scanning code repositories, see Cencori Scan.

PII protection is the only built-in request check in the Cencori gateway. When it is on, any request whose input contains personal data is blocked before it reaches the model provider.

Turn it on

PII protection is available on paid plans (Pro, Team, and Enterprise).

  1. Open your project and go to Settings → General.
  2. Under Request handling, turn on PII protection.

The change applies to the next request. Turn the switch off to stop checking.

What is detected

The check runs on the input text of a request (for chat, the last user message). It looks for:

TypeWhat matches
Email address[email protected], plus written-out forms such as jane dot doe at example dot com or jane.doe [at] example [dot] com
Phone numberUS-style 10-digit numbers such as 555-123-4567 or (555) 123-4567, with an optional country code
SSN (US)123-45-6789
Card number13–19 digit numbers that pass the Luhn check, or digit runs next to words like card or payment

Any single match blocks the request. There is no score or sensitivity setting, and nothing is masked: the request is either blocked or passed through unchanged.

Only input is checked. Model responses are not scanned.

The check applies to every gateway endpoint that takes text input: chat, Responses, sessions, embeddings, images, speech, transcription, documents, vision, and memory.

What a blocked request returns

The request never reaches the provider. The gateway returns 403:

{
  "error": {
    "message": "Request contains personal data (PII)",
    "type": "invalid_request_error",
    "code": "security_violation"
  },
  "message": "This request was blocked because it contains personal data such as an email, phone number or card number.",
  "reasons": ["[PII] Email address detected", "[PII] Phone number detected"]
}

reasons lists each type of personal data that was found.

Handling blocks in code

try {
  const response = await cencori.ai.chat({
    model: 'gpt-4o',
    messages: [{ role: 'user', content: userInput }],
  });
  return response.content;
} catch (error: any) {
  if (error.code === 'security_violation') {
    return {
      error: 'Your message contains personal information. Please remove it and try again.',
      reasons: error.reasons,
    };
  }
  throw error;
}

See the Error Reference for the general error shape.

Seeing blocked requests

Blocked requests appear in AI Gateway → Logs with the Filtered status.

To be notified as they happen, add a webhook in Settings → Webhooks and subscribe to the Security Violation event (security.violation):

{
  "event": "security.violation",
  "timestamp": "2026-10-24T10:00:00.000Z",
  "project_id": "proj_123",
  "data": {
    "incident_type": "pii_input",
    "severity": "high",
    "description": "Blocked PII: Email address detected",
    "end_user_id": "user_456"
  }
}

end_user_id is included when the request identified an end user.

Skipping the check

Chat requests sent with passthrough: true or fast_lane: true in the body, or with the x-cencori-passthrough: true or x-cencori-fast-lane: true header, skip PII protection. They also skip response caching and gateway retries. Use these only for callers that run their own checks.

False positives

The phone pattern matches any 10-digit number in the formats above, so order numbers, account numbers, or reference IDs can be blocked. Example data such as [email protected] is also blocked. If your traffic legitimately contains these, keep PII protection off for that project, or reformat the identifiers before sending them.

Best practices

  • Turn PII protection on for production projects that handle real user input, and leave it off where you send test or synthetic data.
  • Tell your users not to share personal details in prompts — the gateway blocks, it does not mask.
  • Watch the Filtered requests in Logs after turning it on, to catch false positives early.