Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Lakera Guard screens prompts and responses via the /v2/guard API β€” blocking on policy hits and redacting PII spans when only pii/* detectors fire.
Requires Backend v1.16.2+.

Using Lakera with Portkey

1. Add Lakera Credentials to Portkey

  • Navigate to Admin Settings β†’ Plugins
  • Edit the Lakera integration
  • Add your Lakera API Key (create a Guard API key at platform.lakera.ai)
  • Optionally set API Base URL (defaults to https://api.lakera.ai)

2. Add Lakera Guardrail Check

  • Navigate to Guardrails β†’ Create
  • Search for β€œLakera Guard” and click Add
  • Configure:
    • Lakera Project ID (projectID, optional) β€” project whose policy defines detectors to run
    • Payload End Offset Is Inclusive (endInclusive, default false)
    • Timeout (timeout, default 30000 ms)
  • Set guardrail actions and create the guardrail
Check NameDescriptionParametersSupported Hooks
Lakera GuardCalls Lakera /v2/guard with payload+breakdownprojectID, endInclusive, timeoutbeforeRequestHook, afterRequestHook

3. Attach to a Config

{
  "input_guardrails": ["guardrails-id-xxx"],
  "output_guardrails": ["guardrails-id-yyy"]
}
See Configs for usage with SDKs and the gateway.
Last modified on May 27, 2026