What happened?
Adding a pattern or toggling mode then saving causes the custom regex list to be cleared on persist/reload.
Custom regex patterns in a Guardrail (pre_call mode, Provider: LiteLLM Content-Filter) are removed or reset when editing patterns (add/modify) or when toggling the guardrail mode between "mask" and "block" and saving.
All custom regex patterns and guardrail settings persist after saving, regardless of adding/modifying patterns or toggling between "mask" and "block"
Steps to Reproduce
- Open LiteLLM UI → Guardrails / Policy editor.
- Select an existing guardrail that contains custom regex patterns (confirm patterns are present).
- Path A — Add/Modify pattern:
- Add a new custom regex pattern or edit an existing one.
- Click Save.
- Reopen the guardrail → observe whether the new/modified pattern persisted.
- Path B — Toggle mode:
- Change representation from mask ⇄ block.
- Click Save.
- Reopen the guardrail → observe whether original patterns remain.
- Path C — Combined:
- Add a pattern, toggle mode, Save, then Reopen → check persisted patterns.
Relevant log output
What part of LiteLLM is this about?
SDK (litellm Python package)
What LiteLLM version are you on ?
V1.80.11
Twitter / LinkedIn details
No response
What happened?
Adding a pattern or toggling mode then saving causes the custom regex list to be cleared on persist/reload.
Custom regex patterns in a Guardrail (pre_call mode, Provider: LiteLLM Content-Filter) are removed or reset when editing patterns (add/modify) or when toggling the guardrail mode between "mask" and "block" and saving.
All custom regex patterns and guardrail settings persist after saving, regardless of adding/modifying patterns or toggling between "mask" and "block"
Steps to Reproduce
Relevant log output
What part of LiteLLM is this about?
SDK (litellm Python package)
What LiteLLM version are you on ?
V1.80.11
Twitter / LinkedIn details
No response