PII Redaction
NanoGPT supports optional PII redaction for API and web chat requests. When redaction is enabled, personal information in your request is replaced with placeholders and the real values are put back into the response. PII redaction is opt-in. You choose between two providers:
Tinfoil is the default in web chat and for new setups, and Grepture is opt-in. An account or API key default turned on before November 6, 2026 with no provider chosen stays on Grepture for now. In web chat, you may need to choose Grepture again.
This is useful when you want to keep personal or sensitive data away from model providers and other services while still getting a useful final answer.
How Redaction Works
With Tinfoil:- The user sends a request to NanoGPT.
- NanoGPT sends the request’s text, encrypted, to the attested Tinfoil privacy filter, which returns where personal information appears.
- NanoGPT replaces each value with a placeholder such as
⟦PERSON_k3x9q⟧. The same value keeps the same placeholder throughout a conversation. - Memory, web search, moderation and the model see only placeholders.
- NanoGPT restores the placeholders in the response, including streamed responses and tool-call arguments.
- NanoGPT returns the final response to the user.
Supported API Endpoints
PII redaction can be enabled on:POST /v1/chat/completionsPOST /v1/completionsPOST /v1/messagesPOST /v1/responsesPOST /v1/decisions
state and each question’s instructions and criteria, including choice option names, and answers come back with the original names. Tinfoil-hosted decision models (vllm-sr/decision-large, vllm-sr/decision-medium, vllm-sr/decision-small; the earlier decision-large, decision-medium and decision-small IDs remain accepted) already run in an attested enclave and do not support redaction.
Responses API requests that need OpenAI’s built-in tools (web search, file search, computer use and similar) are always redacted through Grepture and billed at its price, whichever provider you chose.
Enable With API Headers
Pass any one of these headers with a truthy value:
Truthy values accepted by the API:
true1yesontinfoil(also chooses Tinfoil for this request)grepture(also chooses Grepture for this request)
true and the other truthy values use the provider set on your API key, then your account (Settings > Privacy), then Tinfoil. An older account or API key default with no provider chosen keeps Grepture.
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:
redaction: tinfoil or redaction: grepture header if you send one, else from your API key or account setting.
Redaction suffixes can be combined with other supported NanoGPT model routing suffixes. For example:
:online, the web search runs on the redacted query, so results about a redacted person or company can be missing.
For general suffix composition rules, see Model Suffixes.
Enable In Web Chat
In the NanoGPT web app, users can enable PII redaction from:Redact on this device
With PII redaction for chats on and Tinfoil as the provider, you can also turn on:API Default Settings
Users can enable redaction by default for API requests from:redaction: false. Redaction provider for API requests sets the provider for API requests that do not name one.
API keys can also be configured individually from the API key settings modal:
The provider is chosen in this order: the request header (
redaction: tinfoil or redaction: grepture), the API key, the account, then Tinfoil. Turning on an account or API key default now saves Tinfoil as its provider when there is none to inherit. A default turned on before November 6, 2026 with no provider chosen stays on Grepture for now.
Explicit per-request headers and model suffixes are still the clearest way to control redaction for a single request.
What Gets Redacted
All message text is scanned: system, developer, user, assistant and tool messages, earlier turns, tool-call arguments in the history, and instruction fields.Personal Information
These values are replaced with placeholders before reaching the model and restored in the response.
With Tinfoil, in addition to the enclave model, NanoGPT runs deterministic checks for email addresses, IBANs (with checksum), payment cards (with checksum), IP addresses, profile links and common secret formats. Grepture applies its own detection.
Secrets And Credentials
Pricing
Tinfoil: $0.00021 per detection call plus $0.84 per million input tokens. The charge depends on how much new text a request carries, so Tinfoil has no fixed price per request. One call scans up to about 35,000 tokens, about 25,000 words of English. Longer text is split into several calls, and short texts in one request share a call. Overlapping text submitted across calls is counted again. Text scanned in the last 3 days is not scanned or charged again, so in a conversation each turn usually pays only for its new message and the previous reply.
Code, JSON and text in other languages use more tokens per word, so they cost more for the same number of words.
Grepture: $0.0005 per request, whatever its size.
The charge appears as a separate PII redaction add-on in usage details, with the number of Tinfoil detection calls. Before any text is sent to Tinfoil, NanoGPT checks that your balance covers the calls the request needs; if it does not, the request is refused for insufficient balance and nothing is charged.
Failure Behavior
Redaction is fail-closed. With Tinfoil, if the detector cannot be reached, its attestation does not verify, or it does not answer in time, NanoGPT refuses the request with HTTP 503 and codepii_redaction_unavailable instead of sending it unredacted. A request with more new text than redaction can scan at once (about 160,000 tokens) is refused with HTTP 413 and code pii_redaction_too_large. Tinfoil charges for each detection call, including calls for requests that are then refused, fail or end without an answer (for example, a stream stopped before its first token); once an account has 100 such unpaid calls in a day, further detection is refused with HTTP 429 and code pii_redaction_unbilled_limit until the day’s count resets.
Private (TEE) models already keep your prompt confidential from the provider; requests for them with redaction enabled are refused with HTTP 400 and code pii_redaction_unsupported_model.
Limitations
- Redaction is a privacy and safety layer, not a compliance guarantee.
- Detection is best-effort. It can miss items (most often names) and occasionally mask public names; it is strongest in English.
- Restoration depends on the model keeping the placeholder. If the model rewrites or drops a placeholder, the original value cannot be put back.
- Images, audio and files are sent as they are. Redaction applies to text only.
- With Claude models, prior signed reasoning is not replayed while redaction is on; Claude starts fresh reasoning on each turn. Some Claude thinking modes cannot continue tool calls with redaction; use adaptive thinking on a supported model.
- 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 text the model receives, not the model or provider.Does redaction work with streaming?
Yes. Placeholders are restored as the response streams, including placeholders split across chunks and inside tool-call arguments.Are redacted values restored in the final answer?
For personal information, yes, when the model keeps the placeholder. Secrets 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.