PII Redaction
NanoGPT supports optional PII redaction for API and web chat requests. When redaction is enabled, NanoGPT routes the request through Grepture before it reaches the selected model. Grepture masks supported personal information before the model sees the prompt, then restores masked values in the model response when possible. This is useful when you want to reduce the amount of personal or sensitive data sent to model providers while still getting a useful final answer. PII redaction is opt-in and costs $0.0005 per redacted request.How Redaction Works
When redaction is enabled:- The user sends a request to NanoGPT.
- NanoGPT routes that request through Grepture.
- Grepture detects supported personal information and replaces it with temporary placeholders before the request reaches the model.
- The model processes the redacted prompt.
- Grepture restores masked personal information in the response where possible.
- NanoGPT returns the final response to the user.
Supported API Endpoints
PII redaction can be enabled on:POST /v1/chat/completionsPOST /v1/completionsPOST /v1/responses
Enable With API Headers
Pass any one of these headers with a truthy value:
Truthy values accepted by the API:
true1yeson
Chat Completions Example
Responses Example
Disable For One Request
If redaction is enabled by an account-level or API-key default, a request can opt out with any supported redaction header set to a falsy value:
Falsy values accepted by the API:
false0nooff
:redaction, redaction remains enabled.
Enable With Model Suffixes
You can also enable redaction by appending a redaction suffix to the model name:
Example:
Enable In Web Chat
In the NanoGPT web app, users can enable PII redaction from:API Default Settings
Users can enable redaction by default for API requests from:redaction: false.
API keys can also be configured individually from the API key settings modal:
Explicit per-request headers and model suffixes are still the clearest way to control redaction for a single request.
What Gets Redacted
The redaction layer is designed to detect and mask common personal information and sensitive credentials.Personal Information
Supported PII categories:
For these PII categories, values are temporarily replaced with placeholders before reaching the model. When the response comes back, Grepture restores placeholders to the original values where possible.
Secrets And Credentials
NanoGPT also replaces common credential-like values with safe labels. These values are not restored. Examples of secret categories:
PII such as names, emails, and phone numbers is masked and restored. Credentials such as API keys, private keys, webhooks, and passwords are replaced permanently and are not restored into the model response.
Pricing
PII redaction costs $0.0005 per redacted request. This charge is added only when redaction is enabled for the request. It is shown as a separate PII redaction add-on in usage details. The redaction charge is per request, not per token.Failure Behavior
Redaction is fail-closed. If a request asks for redaction and the redaction layer cannot be used, NanoGPT does not silently retry the request without redaction. If redaction is enabled but the redaction service is unavailable, the request may fail rather than being sent without redaction. This prevents accidental unredacted fallback behavior.Limitations
- Redaction is a privacy and safety layer, not a compliance guarantee.
- Detection is best-effort and may not catch every possible form of personal information or secret.
- PII restoration depends on the placeholder appearing in the model response. If the model rewrites, omits, or transforms the placeholder, restoration may not occur exactly as expected.
- Redaction applies to request content that can be processed as text. It should not be treated as pixel-level image redaction, file sanitization, malware scanning, or document de-identification.
- Users should still avoid sending unnecessary personal data or credentials to AI systems.
FAQ
Does redaction change the model I selected?
No. Redaction changes the route the request takes before it reaches the model. It does not change the selected model.Does redaction work with streaming?
Yes. Redaction is intended to work with streaming responses. The request is still routed through the redaction layer before the model sees it.Are redacted values restored in the final answer?
For supported personal information categories, yes, where possible. For secrets and credentials, no. Secrets are replaced with safe labels and are not restored.Can I enable redaction globally for API requests?
Yes. Users can enable an account-level API redaction default inSettings > Privacy. API keys can inherit that default, always redact, or opt out of the account default. Per-request headers and model suffixes are also supported.
Can I opt out if my account or API key has redaction enabled by default?
Yes. Sendredaction: false on the request to opt out of account-level or API-key redaction defaults. Model suffixes such as :redaction explicitly enable redaction for that request.