litellm/ui
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
..
docker-entrypoint.d feat(helm): support a separate hostname per component in the componentized deploy (#46360) 2026-10-14 14:56:36 -07:00
litellm-dashboard feat(guardrails): write guardrail changes to the audit log (#51118) 2026-11-11 15:55:27 -08:00
nginx.conf feat(docker)!: one shipped image and one entrypoint beside the Dockerfile (#43332) 2026-11-10 18:32:16 -08:00