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

Prerequisites

Before integrating Enkrypt AI Guardrail, ensure you have the following:
  • API Key: A valid API key is required to access the Enkrypt AI. This key authenticates your requests to the Enkrypt AI resource that provides guardrail capabilities.
  • Guardrail Name: The unique name of your Enkrypt AI guardrail. You can create a new guardrail in the Enkrypt AI portal and get the name from there.

Adding Enkrypt AI Guardrail Integration

To add Enkrypt AI 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.
  • Enkrypt AI Guardrail Config:
    • Name: Enter a name for the Enkrypt AI Guardrail configuration.
    • Guardrail Name: The unique name of your Enkrypt AI guardrail. You can create a new guardrail in the Enkrypt AI portal and get the name from there.
    • Operation: The operation type to use for the Guardrail.
      • Validate: Guardrails with this operation are used to validate requests. These guardrails are run in parallel.
      • Mutate: Guardrails with this operation can both validate and mutate requests. Mutate guardrails are run sequentially.
  • Enkrypt AI Authentication Data:
    • API Key: The API key for the Enkrypt AI.
      This key is required to authenticate requests to Enkrypt AI. You can obtain it from the Enkrypt AI portal by navigating to your Enkrypt AI resource, then selecting “Keys and Endpoint” in the resource menu. Ensure you keep this key secure, as it grants access to your Enkrypt AI resource.

Fill in the Enkrypt AI Guardrail Form

Response Structure

The Enkrypt AI Guardrail API returns a response with the following structure:

Validation Logic

TrueFoundry uses the Enkrypt AI Guardrail response to determine content safety and compliance:
  • If the operation is set to Validate and a policy violation is detected, the request will be blocked and a 400 error is returned.
  • If the operation is set to Mutate and PII or a configured keyword is detected (and no other violation is detected), the detected information will be redacted and the redacted message will be returned in the response.
  • For other types of violations under Mutate, the request will be blocked and a 400 error is returned.
  • If no violations are detected, the original content is passed through unchanged.