This guide explains how to integrate Azure PII Guardrail with TrueFoundry to enhance the safety and compliance of your LLM applications.

Prerequisites

Before integrating Azure PII Guardrail, ensure you have the following:
  • API Key: A valid API key is required to access the Azure PII detection service. This key authenticates your requests to the Azure Cognitive Services or Azure AI resource that provides PII detection capabilities. You can obtain this API key from the Azure portal under your resource’s “Keys and Endpoint” section.
  • Resource Name: The unique name of your Azure resource (e.g., the Azure Cognitive Services or Azure AI resource) that provides the PII detection capability. You can find this in the Azure portal under the resource’s overview page. This is required to authenticate and route requests to the correct Azure service instance.

Adding Azure PII Guardrail Integration

To add Azure PII Guardrail to your TrueFoundry setup, follow these steps: Fill in the Guardrails Group Form
  • Name: Enter a name for your guardrails group.
  • Collaborators: Add collaborators who will have access to this group.
  • Azure PII Guardrail Config:
    • Name: Enter a name for the Azure PII Guardrail configuration.
    • Resource Name: The unique name of your Azure resource (e.g., the Azure Cognitive Services or Azure AI resource) that provides the PII detection capability. You can find this in the Azure portal under the resource’s overview page. This is required to authenticate and route requests to the correct Azure service instance.
    • API Version: The version of the Azure PII detection API to use. (Default: 2024-11-01)
    • Domain: The domain of the Azure PII detection API to use. (Default: None, If you want to detect PHI, you can set this to Healthcare)
    • PII Categories: The categories of PII to detect.
    • Model Version: The version of the Azure PII detection model to use. (Default: latest)
    • Language Code: The language code of the text to detect PII in. (Default: en)
  • Azure Authentication Data:
    • API Key: The API key for the Azure PII detection service.
      This key is required to authenticate requests to Azure’s PII detection API. You can obtain it from the Azure portal by navigating to your Cognitive Services or Azure AI resource, then selecting “Keys and Endpoint” in the resource menu. Ensure you keep this key secure, as it grants access to your Azure resource.

Fill in the Azure PII Guardrail Form

How Azure PII Guardrail Works

When you integrate Azure PII Guardrail with TrueFoundry, the system sends the last message to Azure PII Guardrail API and receives a response that indicates whether the content violates any configured policies.

Response Structure

The Azure PII Guardrail API returns a response with the following structure:

Validation Logic

TrueFoundry relies on the Azure PII Guardrail response to determine content safety:
  • If Azure PII Guardrail detects any PII, the content will be redacted as you can see in the example response above.
  • If Azure PII Guardrail does not detect any PII, the content will be passed through as is.
  • TrueFoundry AI Gateway will respond with the redacted content if PII is detected.