From 0f28bce05c3dc559dcc9ce70cc889c25320bf3eb Mon Sep 17 00:00:00 2001 From: scthornton Date: Mon, 31 Aug 2026 19:08:08 -0400 Subject: [PATCH] docs(panw_prisma_airs): trim restating comments, document latest-only trust trade-off Addresses Greptile's comment-noise finding and documents the caller-supplied-history trade-off Veria flagged: latest-only scanning is opt-in for non-Anthropic shapes and assumes each turn was scanned when it was the latest message, which is now stated on the config field. Claude-Session: https://claude.ai/code/session_019e3TmBntsNQTBbXB9iu9uZ --- .../guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py | 5 +---- .../proxy/guardrails/guardrail_hooks/panw_prisma_airs.py | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py b/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py index 92296e6cde9..68a403aa3d5 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py +++ b/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py @@ -194,8 +194,7 @@ class PanwPrismaAirsHandler(CustomGuardrail): # internal '<=' comparison and surfaces as a misleading api_error. self.timeout = float(timeout) if timeout is not None else 10.0 - # Tri-state: None = not set (latest-only for Anthropic /v1/messages, full history - # otherwise), True = latest-only for every request shape, False = full history everywhere + # Tri-state scan-scope flag; resolution semantics in _use_latest_user_only() self.experimental_use_latest_role_message_only: bool | None = kwargs.get( "experimental_use_latest_role_message_only" ) @@ -1774,8 +1773,6 @@ class PanwPrismaAirsHandler(CustomGuardrail): if input_type == "request": structured_messages: Final = inputs.get("structured_messages") if structured_messages: - # Latest-user-only scanning: flag-controlled for every request shape, - # default-on only for Anthropic /v1/messages (see _use_latest_user_only). # Uses request_data["messages"] (original format), NOT structured_messages # (which has injected system content from adapter translation). if self._use_latest_user_only(request_data, logging_obj): diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/panw_prisma_airs.py b/litellm/types/proxy/guardrails/guardrail_hooks/panw_prisma_airs.py index f12dd927661..96fcc358fa7 100644 --- a/litellm/types/proxy/guardrails/guardrail_hooks/panw_prisma_airs.py +++ b/litellm/types/proxy/guardrails/guardrail_hooks/panw_prisma_airs.py @@ -58,7 +58,10 @@ class PanwPrismaAirsGuardrailConfigModel(GuardrailConfigModel): "the full conversation history. Set true to enable for every request shape (avoids " "rescanning prior turns on every call of a multi-turn conversation); set false to always " "scan all user/system/developer messages. When unset: defaults to latest-only for " - "Anthropic /v1/messages requests and full-history for all other request shapes.", + "Anthropic /v1/messages requests and full-history for all other request shapes. " + "Latest-only scanning trusts caller-supplied history: earlier messages in the request " + "are not rescanned, so enable it only where each turn was scanned when it was the " + "latest message (well-behaved chat clients) or history is server-controlled.", ) @staticmethod