Skip to content

feat(lakera): add Lakera Guard plugin with Anthropic and apiBase support#1671

Open
teddyamkie-lakera wants to merge 1 commit into
Portkey-AI:mainfrom
teddyamkie-lakera:integration/lakera-guard
Open

feat(lakera): add Lakera Guard plugin with Anthropic and apiBase support#1671
teddyamkie-lakera wants to merge 1 commit into
Portkey-AI:mainfrom
teddyamkie-lakera:integration/lakera-guard

Conversation

@teddyamkie-lakera
Copy link
Copy Markdown

@teddyamkie-lakera teddyamkie-lakera commented May 28, 2026

Summary

  • Adds Lakera Guard as a native guardrail provider via /v2/guard
  • Supports beforeRequestHook (prompt screening) and afterRequestHook (response screening)
  • Automatically redacts PII when only pii/* detectors fire; blocks on other policy hits

PR fixes

  • Anthropic messages format support (system field, content blocks, response shape)
  • Normalizes apiBase when users paste the full /v2/guard endpoint path

Related to #1647 / closes #1636

Test plan

  • npx jest plugins/lakera — 20 tests (redaction helpers + handler + Anthropic/apiBase)
  • npm run format:check on changed files
  • Manual test with a valid Lakera API key and project ID

Made with Cursor

Adds Lakera Guard as a native guardrail provider via /v2/guard with PII
redaction, full conversation screening, Anthropic messages format support,
and apiBase URL normalization when users paste the full endpoint path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Lakera Guard guardrail plugin

1 participant