APIIntermediateClaude API
Redact PII before building the prompt, not after
If sensitive data gets into the prompt, it is exposed in your application's request logs; cleaning it up afterwards is among the costliest things to fix.
Add a server-side redaction layer before calling the API and log only the already-redacted version. Inject the user's identity from the server, not from what the model or the user claims. It looks like extra friction in a demo because it adds no visible capability, but the cost shows up at the first audit.
Example
Flow: 1. User request 2. Server: redacts sensitive fields (ID number, card, health) 3. Prompt with redacted data → API 4. Log: only the redacted prompt