Skip to main content
F5 Guardrails (formerly CalypsoAI) provides a sophisticated content moderation service that enables users to detect harmful text content and PII across multiple policy dimensions, helping to secure LLM applications and ensure safe AI interactions.

Using F5 Guardrails with Portkey

1. Add F5 Guardrails Credentials to Portkey

  • Navigate to the Plugins page under Admin Settings
  • Click on the edit button for the F5 Guardrails integration
  • Add your F5 Guardrails API Key (obtain this from your F5/CalypsoAI account)
  • (Optional) Add your F5 Gaurdrail API URL, defaults to https://us1.calypsoai.app.

2. Add F5 Guardrails Check

  • Navigate to the Guardrails page and click the Create button
  • Search for “F5 Guardrails” and click Add
  • Configure your moderation checks:
    • Project ID: Your F5 Guardrails project identifier (Required)
    • Redact: Whether to redact PII data detected by the guardrail. When enabled, detected PII will be masked in the content (Default: false)
    • Timeout: The timeout in milliseconds for the scan (Default: 5000)
  • Set any actions you want on your check, and create the Guardrail!
Guardrail Actions allow you to orchestrate your guardrails logic. You can learn more about them here
Check NameDescriptionParametersSupported Hooks
F5 GuardrailsChecks content using F5 Guardrails scannerProject ID (string), Redact (boolean), Timeout (number)beforeRequestHook, afterRequestHook

3. Add Guardrail ID to a Config and Make Your Request

  • When you save a Guardrail, you’ll get an associated Guardrail ID - add this ID to the input_guardrails or output_guardrails params in your Portkey Config
  • Create these Configs in Portkey UI, save them, and get an associated Config ID to attach to your requests. More here.
Here’s an example config:
{
  "input_guardrails": ["guardrails-id-xxx", "guardrails-id-yyy"],
  "output_guardrails": ["guardrails-id-xxx", "guardrails-id-yyy"]
}
  • NodeJS
  • Python
  • OpenAI NodeJS
  • OpenAI Python
  • cURL
const portkey = new Portkey({
    apiKey: "PORTKEY_API_KEY",
    config: "pc-***" // Supports a string config id or a config object
});
For more, refer to the Config documentation. Your requests are now guarded by F5 Guardrails, and you can see the verdict and any actions taken directly in your Portkey logs!

Get Support

If you face any issues with the F5 Guardrails integration, join the Portkey community forum for assistance.