diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_info.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_info.tsx
index 2151a91d9d7..60400443d5c 100644
--- a/ui/litellm-dashboard/src/components/guardrails/guardrail_info.tsx
+++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_info.tsx
@@ -25,7 +25,12 @@ import React, { useCallback, useEffect, useState } from "react";
import NotificationsManager from "../molecules/notifications_manager";
import ContentFilterManager, { formatContentFilterDataForAPI } from "./content_filter/ContentFilterManager";
import CustomCodeModal, { EditGuardrailData } from "./custom_code/CustomCodeModal";
-import { getGuardrailLogoAndName, guardrail_provider_map } from "./guardrail_info_helpers";
+import {
+ getGuardrailLogoAndName,
+ guardrail_provider_map,
+ skipSystemMessageToChoice,
+ type SkipSystemMessageChoice,
+} from "./guardrail_info_helpers";
import GuardrailOptionalParams from "./guardrail_optional_params";
import GuardrailProviderFields from "./guardrail_provider_fields";
import PiiConfiguration from "./pii_configuration";
@@ -207,9 +212,14 @@ const GuardrailInfoView: React.FC
= ({ guardrailId, onClose,
// Reset form when guardrail data or provider params change
useEffect(() => {
if (guardrailData && form) {
+ const lp = { ...(guardrailData.litellm_params || {}) };
+ delete lp.skip_system_message_in_guardrail;
form.setFieldsValue({
guardrail_name: guardrailData.guardrail_name,
- ...guardrailData.litellm_params,
+ ...lp,
+ skip_system_message_choice: skipSystemMessageToChoice(
+ guardrailData.litellm_params?.skip_system_message_in_guardrail,
+ ),
guardrail_info: guardrailData.guardrail_info ? JSON.stringify(guardrailData.guardrail_info, null, 2) : "",
// Include any optional_params if they exist
...(guardrailData.litellm_params?.optional_params && {
@@ -278,6 +288,20 @@ const GuardrailInfoView: React.FC = ({ guardrailId, onClose,
updateData.litellm_params.default_on = values.default_on;
}
+ const prevSkipChoice = skipSystemMessageToChoice(
+ guardrailData.litellm_params?.skip_system_message_in_guardrail,
+ );
+ const nextSkipChoice = values.skip_system_message_choice as SkipSystemMessageChoice | undefined;
+ if (nextSkipChoice !== undefined && nextSkipChoice !== prevSkipChoice) {
+ if (nextSkipChoice === "inherit") {
+ updateData.litellm_params.skip_system_message_in_guardrail = null;
+ } else if (nextSkipChoice === "yes") {
+ updateData.litellm_params.skip_system_message_in_guardrail = true;
+ } else {
+ updateData.litellm_params.skip_system_message_in_guardrail = false;
+ }
+ }
+
// Only include guardrail_info if it has changed
const originalGuardrailInfo = guardrailData.guardrail_info;
const newGuardrailInfo = values.guardrail_info ? JSON.parse(values.guardrail_info) : undefined;
@@ -647,7 +671,14 @@ const GuardrailInfoView: React.FC = ({ guardrailId, onClose,
onFinish={handleGuardrailUpdate}
initialValues={{
guardrail_name: guardrailData.guardrail_name,
- ...guardrailData.litellm_params,
+ ...(() => {
+ const lp = { ...(guardrailData.litellm_params || {}) };
+ delete lp.skip_system_message_in_guardrail;
+ return lp;
+ })(),
+ skip_system_message_choice: skipSystemMessageToChoice(
+ guardrailData.litellm_params?.skip_system_message_in_guardrail,
+ ),
guardrail_info: guardrailData.guardrail_info
? JSON.stringify(guardrailData.guardrail_info, null, 2)
: "",
@@ -673,6 +704,18 @@ const GuardrailInfoView: React.FC = ({ guardrailId, onClose,
+
+
+
+
{guardrailData.litellm_params?.guardrail === "presidio" && (
<>
PII Protection
diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.test.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.test.tsx
index d9e01acaadf..dfda86c1e4a 100644
--- a/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.test.tsx
+++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.test.tsx
@@ -10,6 +10,8 @@ import {
DynamicGuardrailProviders,
guardrail_provider_map,
GuardrailProviders,
+ skipSystemMessageToChoice,
+ choiceToSkipSystemForCreate,
} from "./guardrail_info_helpers";
describe("guardrail_info_helpers", () => {
@@ -199,4 +201,18 @@ describe("guardrail_info_helpers", () => {
expect(result.logo).toContain("noma_security.png");
});
});
+
+ describe("skipSystemMessageToChoice / choiceToSkipSystemForCreate", () => {
+ it("maps API values to form choices and back for create", () => {
+ expect(skipSystemMessageToChoice(undefined)).toBe("inherit");
+ expect(skipSystemMessageToChoice(null)).toBe("inherit");
+ expect(skipSystemMessageToChoice(true)).toBe("yes");
+ expect(skipSystemMessageToChoice(false)).toBe("no");
+
+ expect(choiceToSkipSystemForCreate("inherit")).toBeUndefined();
+ expect(choiceToSkipSystemForCreate(undefined)).toBeUndefined();
+ expect(choiceToSkipSystemForCreate("yes")).toBe(true);
+ expect(choiceToSkipSystemForCreate("no")).toBe(false);
+ });
+ });
});
diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx
index c78835dae04..38b1b952845 100644
--- a/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx
+++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx
@@ -149,3 +149,19 @@ export const getGuardrailLogoAndName = (guardrailValue: string): { logo: string;
return { logo: logo || "", displayName: displayName || guardrailValue };
};
+
+/** Tri-state UI value for `litellm_params.skip_system_message_in_guardrail` (inherit = use global). */
+export type SkipSystemMessageChoice = "inherit" | "yes" | "no";
+
+export function skipSystemMessageToChoice(v: boolean | null | undefined): SkipSystemMessageChoice {
+ if (v === true) return "yes";
+ if (v === false) return "no";
+ return "inherit";
+}
+
+/** Create flow: omit key when inheriting global default. */
+export function choiceToSkipSystemForCreate(choice: SkipSystemMessageChoice | undefined): boolean | undefined {
+ if (choice === "yes") return true;
+ if (choice === "no") return false;
+ return undefined;
+}
diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_table.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_table.tsx
index 352f3148e7b..5bb2da78fa2 100644
--- a/ui/litellm-dashboard/src/components/guardrails/guardrail_table.tsx
+++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_table.tsx
@@ -11,7 +11,7 @@ import {
SortingState,
useReactTable,
} from "@tanstack/react-table";
-import { getGuardrailLogoAndName, guardrail_provider_map } from "./guardrail_info_helpers";
+import { getGuardrailLogoAndName, guardrail_provider_map, skipSystemMessageToChoice } from "./guardrail_info_helpers";
import EditGuardrailForm from "./edit_guardrail_form";
import { Guardrail, GuardrailDefinitionLocation } from "./types";
@@ -291,6 +291,7 @@ const GuardrailTable: React.FC = ({
accessToken={accessToken}
onSuccess={handleEditSuccess}
guardrailId={selectedGuardrail.guardrail_id || ""}
+ fullLitellmParams={selectedGuardrail.litellm_params}
initialValues={{
guardrail_name: selectedGuardrail.guardrail_name || "",
provider:
@@ -300,6 +301,9 @@ const GuardrailTable: React.FC = ({
mode: selectedGuardrail.litellm_params.mode,
default_on: selectedGuardrail.litellm_params.default_on,
pii_entities_config: selectedGuardrail.litellm_params.pii_entities_config,
+ skip_system_message_choice: skipSystemMessageToChoice(
+ selectedGuardrail.litellm_params?.skip_system_message_in_guardrail,
+ ),
...selectedGuardrail.guardrail_info,
}}
/>