Skip to main content
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

3. Attach to a Config

See Configs for usage with SDKs and the gateway.
Last modified on May 26, 2026