Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aigw/product/guardrails/pii-redaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ Once you've created your custom PII regex guardrail, add it to your AI Gateway c
You can add the same guardrail to both `before_request_hooks` (input guardrails) and `after_request_hooks` (output guardrails) to scan and redact PII in both user inputs and LLM responses.
</Note>

<Note>
On streaming requests (`stream: true`), output guardrails run on the full response after the stream ends. Redaction does not change the chunks the client has already received, and the result is informational only (see [Streaming Responses](/aigw/product/guardrails#streaming-responses)). To redact PII in LLM responses, send the request with `stream: false`.

Background on filtering streamed output: [OWASP AI Exchange, sensitive output handling](https://owaspai.org/go/sensitiveoutputhandling) and [Split-Boundary Leaks in Streaming Guardrails](https://doi.org/10.5281/zenodo.22909585).
</Note>

### Example Implementation


Expand Down
6 changes: 6 additions & 0 deletions product/guardrails/pii-redaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ Once you've created your custom PII regex guardrail, add it to your Portkey conf
You can add the same guardrail to both `before_request_hooks` (input guardrails) and `after_request_hooks` (output guardrails) to scan and redact PII in both user inputs and LLM responses.
</Note>

<Note>
On streaming requests (`stream: true`), output guardrails run on the full response after the stream ends. Redaction does not change the chunks the client has already received, and the result is informational only (see [Streaming Responses](/product/guardrails#streaming-responses)). To redact PII in LLM responses, send the request with `stream: false`.

Background on filtering streamed output: [OWASP AI Exchange, sensitive output handling](https://owaspai.org/go/sensitiveoutputhandling) and [Split-Boundary Leaks in Streaming Guardrails](https://doi.org/10.5281/zenodo.22909585).
</Note>

### Example Implementation

<Tabs>
Expand Down