Before AI

The Anthropic API sees every message you send

A practical guide to redact before anthropic api: what leaves the document, what to mask, and how to verify the result.

Redact Before Anthropic API: what to mask

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.

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:

The redaction flow

  1. Classify the request fields and the attachments.
  2. Mask the personal data in the middleware.
  3. Send only the tokens and the task instructions.
  4. Receive the answer and restore on your side.
  5. 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

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

Questions

Can we mask only the user message?

No. The system prompt, history, attachments and tool results can all carry data.

Does the API train on our data?

Ask for the current terms. A developer setting or a contract clause is stronger than a general page.

Where should the mapping live?

In your environment, with restricted access and a deletion rule. It should not travel with the request.