Repository navigation
docs(guardrails): skip_system_message_in_guardrail skips only the top-level system prompt on /v1/messages - #2530
Merged
yucheng-berri merged 2 commits intoOct 26, 2026
Conversation
…-level system prompt on /v1/messages role: system entries inside messages, which Claude Code sends mid-conversation, are still scanned. Point Bedrock users at experimental_use_latest_role_message_only to keep them out of the scan.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tem prompt since v1.103.0 skip_system_message_in_guardrail keeps it out of the scan.
yucheng-berri
deleted the
litellm_guardrail_skip_system_messages_scope
branch
October 26, 2026 18:37
This branch was previously deployed
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
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.
Two changes left the guardrail docs behind for Claude clients on Anthropic
/v1/messagesSince BerriAI/litellm#40984 (first in v1.103.0) guardrails also scan the top-level
systemprompt there. Claude Desktop and Cowork send a system prompt of about 69k chars with every request, and a strict BedrockPROMPT_ATTACKfilter blocks it even for a harmless question.skip_system_message_in_guardrail: truealready removes it, but the docs never said the prompt is scanned nowSince BerriAI/litellm#34290 (first in v1.98.0) the skip flag removes only that top-level prompt, and
role: systementries insidemessagesare always scanned as client input. Claude Code sends such an entry mid-conversation (an environment block of about 9k chars), and on its own that entry trips the same filter, so the skip flag does not help Claude Code users.experimental_use_latest_role_message_only: truekeeps it out of the scan. The docs said the flag omitsrole: systemon/v1/messagesBoth PRs declared these changes on purpose, so the code stays and the docs catch up. This updates the
config_settings.mdrow, adds two paragraphs to the quick start skip section, and adds a pointer in the Bedrock experimental sectionEvidence
Real clients through a real LiteLLM proxy to a real Bedrock guardrail with
PROMPT_ATTACKon input at LOW, prompt "What are three tips for running an effective leadership meeting?", read from the proxy's Bedrock request logClaude Desktop 2.19675.0 Cowork (agent SDK 0.3.286), driven through the macOS accessibility API
Claude Code 2.1.306 and 2.1.304 (
claude -p)A direct ApplyGuardrail call with only the Claude Code mid-turn entry returns PROMPT_ATTACK, and with only the Claude Code top-level system prompt returns NONE, 3 out of 3 times each. Bedrock's verdict depends on what is sent together, which is why the Claude Code default passes on v1.104.2
Linear ticket
LIT-9984
Checks
npm run lint:writingandnpm run lint:docspass locally