Skip to content

feat(litellm): anti-pattern guardrail — OpenAI moderation (monitor-only) - #540

Merged
samxu01 merged 1 commit into
mainfrom
feat/litellm-guardrails-moderation
Jul 1, 2026
Merged

feat(litellm): anti-pattern guardrail — OpenAI moderation (monitor-only)#540
samxu01 merged 1 commit into
mainfrom
feat/litellm-guardrails-moderation

Conversation

@samxu01

@samxu01 samxu01 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Addresses the LiteLLM Guardrails feature ask (detect human/agent anti-patterns), distinct from the rate-limit circuit-breakers already shipped in #531.

Adds a top-level guardrails: block with OpenAI moderation in logging_only / default_on — flags policy-violating content on every proxy request without blocking, using the existing OPENAI_API_KEY (no new secret, no new infra, free moderation endpoint). The point is to start measuring before enforcing.

Honest scoping (from the research): this is mostly a fast-follow, not a launch blocker. Public users bring their own compute, so their agent traffic never hits our proxy — the one genuinely new public-launch exposure is indirect prompt injection of platform features (summarizer/digest/native apps ingesting untrusted pod content on the master key). Next step after flag data: enforce on a scoped platform key, not globally. Broad user-post moderation belongs at the app/ingestion layer, not the LLM proxy.

Revertible: set default_on: false to disable instantly if it adds latency on the proxy. Fast-follows tracked separately (Presidio PII sidecar; scoped-enforce; prompt-injection detector).

🤖 Generated with Claude Code

…i-pattern detection

LiteLLM Guardrails feature: content/behavioral anti-pattern detection on proxy traffic. Starts in logging_only/default_on (flag, never block) using the existing OPENAI_API_KEY — no new secret/infra. Measures policy-violating content from platform features + hosted agents before any enforcement. Real exposure = indirect prompt injection of platform features; broad UGC moderation belongs at the app layer. Presidio PII + prompt-injection detectors are documented fast-follows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
@samxu01
samxu01 merged commit 5a646c0 into main Jul 1, 2026
11 checks passed
samxu01 added a commit that referenced this pull request Jul 1, 2026
…rash-looped litellm (#545)

* Revert "feat(litellm): prompt-injection guardrail + enforce-moderation scoped to platform features (#544)"

This reverts commit 33059c1.

* Revert "feat(litellm): add OpenAI moderation guardrail (monitor-only) for anti-pattern detection (#540)"

This reverts commit 5a646c0.
lilyshen0722 added a commit that referenced this pull request Jul 1, 2026
…rash-looped litellm (#545)

* Revert "feat(litellm): prompt-injection guardrail + enforce-moderation scoped to platform features (#544)"

This reverts commit 33059c1.

* Revert "feat(litellm): add OpenAI moderation guardrail (monitor-only) for anti-pattern detection (#540)"

This reverts commit 5a646c0.
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.

1 participant