litellm/ui/litellm-dashboard/src
mrinal-berri 43daa2598e
feat(guardrails): write guardrail changes to the audit log (#51118)
* feat(guardrails): write guardrail changes to the audit log

Creating, updating, patching or deleting a guardrail, and registering, approving or rejecting a team guardrail submission, now each write one row to LiteLLM_AuditLog with the guardrail before and after the change. Credentials the guardrails table encrypts at rest are redacted from those rows, and the routes take the litellm-changed-by header like key, team and model routes do. The Admin UI audit page gets a Guardrails table filter.

Resolves LIT-10639

* fix(guardrails): audit an allowlisted guardrail snapshot and drop litellm-changed-by

Guardrail audit rows now keep the guardrail id, name, info, status, team and the provider, mode and default_on settings, and name (never show) any other provider setting an update changed. Provider settings can hold credentials under any name, for example an apikey header, so no other value is written. The changer always comes from the caller's API key, so the litellm-changed-by header is gone. PUT audits the saved guardrail instead of the copy the live sync adds headers to.

Resolves LIT-10639

* fix(guardrails): never let the audit snapshot fail a saved guardrail change

The audit snapshot now reads guardrail settings stored as a JSON string and records empty settings when it cannot read them, so a saved approve or reject can no longer turn into a 500. Only the provider, mode and default_on settings are ever copied, so this cannot leak a credential. The create entry also records the active status the new guardrail is saved with.

Resolves LIT-10639

* test(guardrails): run the guardrail audit tests through the real registry and in-memory handler

The audit tests no longer replace GUARDRAIL_REGISTRY or the in-memory handler, and no test edits its inputs. Only the Prisma guardrails table is faked, returning exactly what the registry writes, so the PUT test now checks the real live sync adding x-api-key to the saved guardrail's headers.

Resolves LIT-10639
2026-11-11 15:55:27 -08:00
..
app refactor(ui): remove the deprecated API Reference page (#51246) 2026-11-11 22:55:32 +00:00
components feat(guardrails): write guardrail changes to the audit log (#51118) 2026-11-11 15:55:27 -08:00
contexts refactor: remove redundant comments from fresh changes (#51163) 2026-11-11 09:18:18 -08:00
data refactor(ui): move remaining outlier text onto i18n (#50312) 2026-11-05 20:59:01 -08:00
hooks refactor(ui): align Chat with dashboard styling (#50034) 2026-11-04 20:48:27 -08:00
i18n feat(guardrails): write guardrail changes to the audit log (#51118) 2026-11-11 15:55:27 -08:00
lib fix(proxy): answer x-litellm-call-id on every token count response (#51037) 2026-11-11 22:26:47 +00:00
utils refactor(ui): remove the deprecated API Reference page (#51246) 2026-11-11 22:55:32 +00:00
next-types.d.ts feat(traces): tracing development seed (#44363) 2026-10-03 09:59:51 +00:00
types.ts added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00