-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat: Add Pillar Security guardrail integration #12791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eagle-p
wants to merge
7
commits into
BerriAI:main
Choose a base branch
from
eagle-p:feature/pillar-guardrails
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements comprehensive LLM security guardrails using Pillar Security API with support for prompt injection detection, PII/secret detection, content moderation, and multi-mode execution (pre_call, during_call, post_call). Includes complete documentation, testing, and configurable actions on flagged content.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Restructure PillarGuardrailConfigModel to properly inherit from GuardrailConfigModel[T] and resolve return type compatibility issue in get_config_model method.
Restructure PillarGuardrailConfigModel to properly inherit from GuardrailConfigModel[T] and resolve return type compatibility issue in get_config_model method.
Ready to be merged :) |
Have you manually qa'ed this to confirm it works @eagle-p ? |
Hi Krish! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Pillar Security guardrail integration
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsType
🆕 New Feature
Changes
Overview
This PR implements a comprehensive Pillar Security guardrail integration for LiteLLM, providing advanced security features including prompt injection protection, PII detection, secret detection, and content moderation.
Core Features Implemented
⚙️ Technical Features:
pre_call
,during_call
, andpost_call
modesblock
(raise exception) ormonitor
(log only) on flagged contentFiles Added
Core Implementation:
litellm/proxy/guardrails/guardrail_hooks/pillar/pillar.py
- Main PillarGuardrail class with async hookslitellm/proxy/guardrails/guardrail_hooks/pillar/__init__.py
- Module initialization and registrylitellm/types/proxy/guardrails/guardrail_hooks/pillar.py
- Pydantic configuration modelTesting:
tests/guardrails_tests/test_pillar_guardrails.py
- Comprehensive test suite (623 lines) with:Documentation:
docs/my-website/docs/proxy/guardrails/pillar_security.md
- Complete user guide (408 lines) with:Files Modified
Configuration Integration:
litellm/types/guardrails.py
- Added PILLAR enum value and PillarGuardrailConfigModeldocs/my-website/sidebars.js
- Added Pillar documentation to sidebar navigationConfiguration Examples
Recommended Dual-Mode Configuration:
Alternative Configurations:
Integration Approach
PILLAR_API_KEY
,PILLAR_API_BASE
,PILLAR_ON_FLAGGED_ACTION
Testing Coverage