
The Anthropic API sees every message you send. An API request contains the system prompt, the message history, the attachments and any tool result. The developer controls the request, which is an advantage: there is a place to put a redaction step before the model sees the text.
Part of redact before AI chatbots. For the adjacent case, read redact before openai api and redact before claude.
What leaves the document
Put a middleware between your application and the API. It masks the fields that carry personal data, sends stable tokens, receives the answer and restores the values on your side. The mapping stays in your environment, not in the request.
Where the data hides
The prompt is only one layer. Check:
- Message history from earlier turns
- File and image attachments
- Tool results and retrieved context
- Error messages and request logs
- Batch or evaluation copies
The redaction flow
- Classify the request fields and the attachments.
- Mask the personal data in the middleware.
- Send only the tokens and the task instructions.
- Receive the answer and restore on your side.
- Log the request id and the policy, not the content.
Controls to verify
- A middleware on every request path, including retries.
- A mapping store with restricted access and a deletion rule.
- Separate API keys per application and environment.
- Log redaction and retention that exclude payloads.
- A test with a unique marker in each field.
Retention and evidence
The API provider's retention is one copy; your logs, batch files and evaluation sets are others. Ask for the current retention and training terms in writing, then check what your own middleware 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
The same architecture as any model API: messages and files travel to the provider's infrastructure, processed under the commercial terms in force for the account. Enterprise arrangements typically exclude training use and bound retention; verify against the current agreement rather than memory. Prompt caching, where offered, keeps content at the provider for the cache window — convenient, and worth knowing about when the prompt holds client detail.
The masking habit
Strip the identifiers that the task does not need: the contract's party names become 'Party A', the amounts can stand, the bank details become fakes in the right format. If the response must restore real values, keep the mapping on your side of the boundary and re-apply it after the call. Test the habit once with a canary — a value you would catch in the provider's logs — so the masking is practiced before it is needed.
The evaluation habit
If the provider's models change under you, outputs shift. Pin the model version for production uses where the platform allows it, and re-run a small golden set after any version change — the same ten prompts with expected properties. The golden set is the regression suite for behavior you depend on, and it catches the silent changes that no dashboard shows.
The file-handling note
Files uploaded through the API answer to the same terms as the messages around them — retention and training exclusions live in the agreement, and the agreement is the document that decides. For attachments that carry client material, the enterprise terms plus the masking habit is the combination that travels safely. Check whether your plan's file features cache content, and treat the cache window as part of the retention answer.
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; ask for the current API guide.
Questions for the vendor
- What is retained for API requests?
- Are attachments treated differently?
- Can we disable request 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.