- Keeping system prompts out of stored traces while still tracing the request.
- Excluding user-submitted content from logs to meet data-handling requirements.
- Redacting model output from traces without changing what the caller receives.
security parameter controls what gets written to stored traces. It does not change the live request or response: the caller always receives the full, unmasked output. Only the copy persisted to trace storage is affected.
security is set per request. There is no workspace, project, or API-key default. A request sent without a security block is traced in full. To mask consistently, include security.mask on every request, for example by setting it as a default on your SDK client so it is attached automatically.Quick Start
Configuration
An unrecognized value in
mask is rejected with a 400 error.
What each value masks
Coverage
security is supported across the AI Gateway’s endpoints, including responses, chat/completions, completions, embeddings, images, ocr, rerank, speech, transcriptions, and translations.
security is unrelated to the PII Redaction plugin, which rewrites sensitive values in the live request and response, and to Guardrails, which can block a request outright. security only changes what is written to trace storage.