Skip to content

Conversation

@jroberts2600
Copy link
Contributor

Title

Add content masking with streaming support to PANW Prisma AIRS guardrail

Relevant issues

N/A

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem, masking with streaming support

Type

🆕 New Feature
📖 Documentation
✅ Test
🐛 Bug Fix

Changes

Features Added

  • Content masking parameters: mask_request_content, mask_response_content, and backwards-compatible mask_on_block
  • Streaming support: Real-time response scanning and masking via async_post_call_streaming_iterator_hook
  • Text completion support: Handles both chat (messages) and text completion (prompt) request formats

Fixes

  • Environment variable fallback: Made api_key/api_base optional to properly support PANW_PRISMA_AIRS_API_KEY env var

Testing

  • 31 comprehensive tests covering initialization, masking, streaming, tool calls, multi-choice responses, text completion, and error handling
  • All tests passing ✅
Screenshot 2025-10-17 at 12 00 56 PM

…risma AIRS

- Add mask_request_content and mask_response_content parameters
- Implement content masking for prompts and responses
- Add streaming support with real-time masking
- Add comprehensive test coverage (28 tests)
- Update documentation with masking examples and security notes
@vercel
Copy link

vercel bot commented Oct 17, 2025

@jroberts2600 is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@jroberts2600 jroberts2600 force-pushed the panw-prisma-airs-masking branch 2 times, most recently from 97f244a to 6f5b872 Compare October 17, 2025 18:23
@jroberts2600 jroberts2600 force-pushed the panw-prisma-airs-masking branch from 6f5b872 to cc8cadb Compare October 17, 2025 18:33
@krrishdholakia krrishdholakia merged commit c471bf1 into BerriAI:main Oct 18, 2025
4 of 6 checks passed
AlexsanderHamir pushed a commit that referenced this pull request Oct 20, 2025
…risma AIRS guardrail (#15666)

* feat(guardrails): Add content masking and streaming support to PANW Prisma AIRS

- Add mask_request_content and mask_response_content parameters
- Implement content masking for prompts and responses
- Add streaming support with real-time masking
- Add comprehensive test coverage (28 tests)
- Update documentation with masking examples and security notes

* fix(guardrails): Fix PANW Prisma AIRS env var fallback and text completion support
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.

2 participants