
The OpenAI API sees every message and file you send. An API request can contain a system prompt, a conversation, a file, an image and tool output. The developer controls the request, so there is a place to mask before the model sees the text; the same request can also be logged by your own stack.
Part of redact before AI chatbots. For the adjacent case, read redact before local llm and redact before anthropic api.
What leaves the document
Put a middleware between the application and the API. Mask the personal data, send stable tokens, receive the answer and restore the values on your side. Keep the mapping in your environment and out of the request. Use separate keys per application.
Where the data hides
The prompt is only one layer. Check:
- Message history and system prompts
- Uploaded files, images and assistants
- Batch jobs and evaluation sets
- Error logs and request traces
- Tool results and retrieved context
The redaction flow
- Classify the fields and files in the request.
- Mask the personal data in the middleware.
- Send only the tokens and the task instructions.
- Restore the values on your side.
- Log the request id and the policy, not the payload.
Controls to verify
- A middleware on every path, including retries.
- A mapping store with restricted access.
- Separate keys per app and environment.
- Payload-free logging.
- A test with a unique marker in each field.
Retention and evidence
The provider's retention is one copy; your logs, batch files and evaluation sets are others. Ask for the current retention and training terms, then check what your own stack writes to disk.
Limits
Masking is not anonymization. Context can still identify a person, and a tool result can reintroduce a value. The API cannot enforce your policy; the middleware and the reviewer do.
What the API sees
An API call is a disclosure with a receipt: every message, every file, every system instruction travels to the provider and lands in their logs under their retention terms. Consumer and enterprise tiers differ on retention and training use — the enterprise terms generally exclude training and shorten retention, but the current agreement is the only source that counts. Assume the conversation persists until the terms say otherwise, and read the terms when they change, because they do.
The masking habit
Mask before the call, not after the worry. Replace client names with role labels, account numbers with format-matching fakes, and dates with relative ones — the model reasons about the shape, not the identity. Keep a mapping table locally if the response must re-identify values; tools exist for exactly this round trip. The habit that fails is the reverse: paste the file, ask the model to anonymize, and trust the output — the model's idea of anonymized is not a standard.
The team question
Decide which accounts may hold client data and write it down: a team API key under enterprise terms for real work, personal accounts for experiments that never see a client value. The mixed-account period of an adoption is when leaks happen — someone pastes into the wrong surface. The approved-account list plus the masking habit covers most of the category's risk, and it costs a wiki page to maintain.
How Veilbrook fits
Veilbrook can sit in the request path, mask the document before it reaches the model and restore the values on your side. The exact integration depends on your application.
Questions for the vendor
- What is retained for API requests?
- Are files and assistants treated differently?
- Can we disable logging?
- Where is the data processed?
- What happens on deletion?
Before you send
Classify the document, mask the identifiers, attach only what the task needs, and keep the mapping outside the tool. After the answer, restore the values on your side and check that the output did not reintroduce one. If the tool keeps the conversation, decide the retention before you start. A receipt is not a substitute for a review.
Common mistakes
- Masking the body but not the attachment.
- Sending the history from an earlier task.
- Trusting a setting instead of testing the output.
- Calling a masked document anonymous.
- Leaving the mapping in the same folder as the prompt.