The AI Azure Content Safety plugin can be applied to:
- Input data (requests)
- Output data (responses) v3.12+
- Both input and output data v3.12+
Here’s how it works if you apply it to both requests and responses:
- The plugin intercepts the request and sends the request body to the Azure AI Content Safety service.
- The Azure AI Content Safety service analyzes the request against configured moderation categories and allows or blocks the request.
- If allowed, the request is forwarded upstream with the AI Proxy or AI Proxy Advanced plugin.
- On the way back, the plugin intercepts the response and sends the response body to the Azure AI Content Safety service. v3.12+
- The Azure AI Content Safety service analyzes the response against configured moderation categories and allows or blocks the response.
- If allowed, the response is forwarded to the client.
sequenceDiagram
autonumber
participant Client
participant Plugin as AI Azure Content Safety plugin
participant Safety as Azure AI Content Safety service
participant Proxy as AI Proxy/Advanced
participant AI as Upstream AI Service
Client->>Plugin: Send request
Plugin->>Safety: Intercept & send request body
Safety->>Safety: Check against moderation
categories and blocklists
Safety->>Plugin: Allow or block request
Plugin->>Proxy: Forward allowed request
Proxy->>AI: Process allowed request
AI->>Proxy: Return AI response
Proxy->>Plugin: Forward response
Plugin->>Safety: Intercept & send response body
Safety->>Safety: Check against moderation
categories and blocklists
Safety->>Plugin: Allow or block response
Plugin->>Client: Forward allowed response
Figure 1: Diagram showing the request and response flow with the AI Azure Content Safety plugin.