litellm/ui/litellm-dashboard/public/assets/logos
Sean Yasnogorodski 8a4ba78869
feat(guardrails): add Alice guardrail (#38898)
* feat(guardrails): add Alice by ActiveFence guardrail

Adds `guardrail: alice` — policy-based guardrails for prompts and model
responses, evaluated against ActiveFence's Alice.

What makes this different from the other providers: Alice evaluates against
policies configured per *application*, and a proxy typically fronts several of
them, so the application cannot be a static config value. It is named on the
LiteLLM virtual key instead:

    curl $PROXY/key/generate -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
      -d '{"key_alias": "payments-bot",
           "metadata": {"alice_app_id": "payments-bot"}}'

read via `CustomGuardrail._get_admin_metadata`, with `key_alias` as the
fallback. That helper is what makes it trustworthy: it reads whichever metadata
holder the proxy wrote the authenticated key's values into — which differs by
route — and the proxy strips caller-supplied `user_api_key_*` from both, so a
caller cannot point its own traffic at an application with laxer policies than
the one its key was issued for. A request whose key names no application is
refused rather than evaluated against a guess.

Implements `apply_guardrail` only, so pre_call, during_call, post_call and
streaming all come from UnifiedLLMGuardrails. Blocks with
GuardrailRaisedException; masks by substituting Alice's redacted text; a MASK
carrying no replacement blocks rather than passing the original through. A
verdict reporting `errors[]` is treated as a failure, not a pass — otherwise a
half-evaluated message would be allowed. `unreachable_fallback` (already on
LitellmParams) chooses fail-closed or fail-open on transport failure.

Config:

    guardrails:
      - guardrail_name: alice
        litellm_params:
          guardrail: alice
          mode: [pre_call, post_call]
          api_key: os.environ/ALICE_API_KEY

21 tests in tests/test_litellm/proxy/guardrails/guardrail_hooks/test_alice.py
cover registration, credential resolution, the app-id ladder including the
forged-metadata case, every verdict, and both unreachable policies.

No new LitellmParams field, so no schema.d.ts regeneration is needed.

* refactor(guardrails): post to Alice's LiteLLM endpoint and forward verbatim

Switches from `/v2/evaluate/message` — Alice's single-text endpoint — to
`/v2/evaluate/litellm`, which takes the hook's arguments as they arrive and
answers with a verdict.

That inverts where the work happens, and shrinks this plugin accordingly. It
now selects nothing and renames nothing: it posts `{input_type, inputs,
request_data}` and enforces `{verdict, categories, correlation_id, message,
replacements}`. Which parts of a conversation are worth evaluating, and how a
verdict is reached, are decided by Alice — so changing either is a change on
their side rather than a LiteLLM upgrade for every user.

The app-id resolution this plugin carried is gone with it. Alice reads the
application off the authenticated key's metadata itself, from the payload it is
handed, so the ladder here was duplicating a decision the far side already
makes. The security property is unchanged and still comes from the proxy
stripping caller-supplied `user_api_key_*` before a guardrail sees the request.

Masking is now positional — the far side chose which texts it was answering
for, so it says which by index. Only `texts` is written; a new
`structured_messages` object would make the chat translation layer skip the
`texts` write-back and silently drop the edits. A mask that lands nowhere
blocks rather than passing the original through.

`request_data` carries live Python objects (an OpenTelemetry span among them),
so `_json_safe` copies it into something serialisable by a mechanical rule
rather than a field list — a list drifts from what the far side needs, a rule
cannot. Serialising naively raises, and that error would read as "guardrail
unavailable" on every request.

26 tests, covering verbatim forwarding, each verdict, positional masking, the
`structured_messages` identity trap, both unreachable policies, and the
serialiser's handling of unserialisable values and cycles.

* fix(alice guardrail): satisfy lint and code-quality CI gates

- Bound _json_safe's recursion and register it in recursive_detector's
  ignore list (it already caps depth and dedupes cycles by id, matching
  the repo's established pattern for legitimate bounded recursion).
- Clear ruff-strict budget breaches: annotate __init__'s return type,
  raise TypeError (not ValueError) for a bad response body, type
  _json_safe's payload as object instead of Any, and file-scope-ignore
  ANN401 for **kwargs (forwarding it as object broke the call into
  CustomGuardrail.__init__, confirmed via basedpyright).
- Clear type-discipline budget breaches: suppress the construction/
  annotation checks on one-shot HTTP payloads, the module-level
  guardrail registries, and _json_safe's bounded accumulator; narrow
  AliceVerdict's list fields to tuples and _evaluate's request_data to
  Mapping[str, object] where nothing downstream mutates them.

* test(alice guardrail): assert the guardrail actually registers

The registration test called init_guardrails_v2 and asserted nothing, so it
passed whether or not the guardrail was ever registered — TQ001 in the
test-quality gate, and a fair catch: a test that cannot fail is not covering
the thing it names.

Now asserts exactly one AliceGuardrail lands in litellm.callbacks under the
configured name.

This surfaced only after the ruff-strict and type-discipline gates stopped
failing ahead of it; the lint job runs its gates in sequence, so an earlier
failure masks every later one.

* fix(alice guardrail): reach 100% patch coverage, drop the ActiveFence naming

Codecov flagged 10 uncovered lines, all of them error paths — which is where a
guardrail most needs covering, since each one decides whether traffic flows
unscreened.

Two of the ten turned out to be dead rather than untested, and are removed:

- `except GuardrailRaisedException: raise` in apply_guardrail. `_evaluate`
  raises httpx errors, Timeout and TypeError, never that — so the clause could
  never fire.
- the trailing `json.dumps` probe in `_json_safe`. Everything json.dumps
  handles natively is caught by the isinstance branches above (a dict or list
  subclass included), so anything reaching the bottom — bytes, datetime, an
  OpenTelemetry span — cannot cross the wire regardless. It now says so and
  returns None.

The rest are now tested: a timeout, 502/503/504 as unreachable, a 4xx as NOT
unreachable (a rejected credential is our misconfiguration, not an outage, and
must not fail open), a non-object response body, and a model whose model_dump
raises.

Also drops "by ActiveFence" throughout — the product is Alice — and points the
header at alice.io. `ui_friendly_name` is now "Alice", which is the key
guardrailLogoMap and the garden card look up, so all three moved together.

* fix(alice guardrail): strip caller credentials, widen unreachable detection, block partial MASK

Addresses PR review: request_data no longer forwards secret_fields.raw_headers or
the root api_key to Alice (the caller's Authorization token in the clear otherwise);
HTTP 500, malformed JSON, and a non-object body now route through the configured
unreachable_fallback instead of raising raw, so fail_open still fails open on those;
a MASK verdict with even one out-of-range replacement now blocks entirely instead of
silently letting the rest through unmasked. Also tightens request_data's type and
documents the known streaming-mask limitation on the class.

* fix(alice guardrail): strip credentials at any depth, stop filtering on texts

secret_fields/api_key/headers/provider_specific_header can appear nested
under proxy_server_request, metadata, litellm_metadata, and their
requester_metadata/body sub-paths in a real captured payload — a
top-level-only strip missed all of those. _json_safe now drops these keys
by name wherever they occur during serialization, so a new nesting path
can't reintroduce the leak.

apply_guardrail also stopped skipping the call whenever texts was empty,
even when tool_calls/images/structured_messages carried content — that
was the plugin making a selection decision Alice's design says belongs on
the far side. It now only skips when none of the selectable fields have
anything in them.

* fix(alice guardrail): route an undecodable response body through the fallback

`response.json()` raises UnicodeDecodeError when the body carries bytes that
are not valid UTF-8, and that escaped the except clause: UnicodeDecodeError is
a *sibling* of json.JSONDecodeError under ValueError, not a subclass of it, so
naming only JSONDecodeError left it uncaught. Both fallback modes surfaced a
raw decoding error instead of applying unreachable_fallback — which for a
fail_open deployment meant a hard failure where it had asked for an allow.

Named explicitly rather than widening to ValueError, so the clause still says
which three conditions it means. Tested under both policies.
2026-09-01 12:33:39 -07:00
..
a2a_agent.png [Feat] Agent Gateway - Allow tracking request / response in "Logs" Page (#17449) 2025-12-03 18:57:18 -08:00
ai21.svg fix(ui): bundle provider logos as static imports and unify fallback in Logo component (#34125) 2026-07-21 14:27:36 -07:00
aim_logo.jpeg [UI] Allow adding Bedrock, Presidio, Lakera, AIM guardrails on UI (#10874) 2025-05-15 21:22:56 -07:00
aim_security.jpeg updates guardrail provider logos 2025-10-10 11:39:14 -07:00
aiml_api.svg [Feat] New LLM API - AI/ML API for Image Gen (#13893) 2025-08-23 13:12:44 -07:00
akto.svg Add Akto Guardrails to LiteLLM (#23250) 2026-03-17 14:38:04 -07:00
alice.svg feat(guardrails): add Alice guardrail (#38898) 2026-09-01 12:33:39 -07:00
anthropic.svg set_local_icons 2025-03-19 14:37:57 +00:00
aporia.png updates guardrail provider logos 2025-10-10 11:39:14 -07:00
arize.png [Feat] UI - Allow adding team specific logging callbacks (#12261) 2025-07-02 16:35:22 -07:00
assemblyai_small.png set_local_icons 2025-03-19 14:37:57 +00:00
aws.svg set_local_icons 2025-03-19 14:37:57 +00:00
azure_ai_foundry.png [Feat] A2A Gateway - allow adding Azure Foundry Agents on UI (#17909) 2025-12-12 16:38:04 -08:00
baseten.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
bedrock.svg set_local_icons 2025-03-19 14:37:57 +00:00
bing.png feat(search): add Grounding with Bing Search (bing_grounding) as a search provider 2026-08-24 11:08:24 -07:00
braintrust.png Add logos to callback list (#12244) 2025-07-02 09:55:55 -07:00
cato_networks.svg Litellm OSS Staging (#29161) 2026-06-01 21:22:35 -07:00
cerebras.svg set_local_icons 2025-03-19 14:37:57 +00:00
cisco.png feat(guardrails): add Cisco AI Defense integration (#28249) (#30338) 2026-06-12 23:21:23 -07:00
cloudflare.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
cohere.svg set_local_icons 2025-03-19 14:37:57 +00:00
cometapi.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
cursor.svg Development environment setup (#22432) 2026-02-28 14:50:06 -08:00
databricks.svg set_local_icons 2025-03-19 14:37:57 +00:00
datadog.png Add logos to callback list (#12244) 2025-07-02 09:55:55 -07:00
dataforseo.png [Feat] UI - Add logos for search providers (#15872) 2025-10-23 18:00:40 -07:00
deepgram.png [UI] Add Deepgram provider to supported providers list and mappings (#11634) 2025-06-11 12:12:12 -07:00
deepinfra.png Added Voyage, Jinai, Deepinfra and VolcEngine providers on the UI (#13131) 2025-07-30 10:01:07 -07:00
deepkeep.svg feat: add deepkeep as custom guardrail (#33844) 2026-07-20 19:27:40 -07:00
deepseek.svg set_local_icons 2025-03-19 14:37:57 +00:00
elevenlabs.png [Feat] Add Eleven Labs - Speech To Text Support on LiteLLM (#12119) 2025-06-27 17:50:49 -07:00
enkrypt_ai.avif updates guardrail provider logos 2025-10-10 11:39:14 -07:00
exa_ai.png [Feat] UI - Add logos for search providers (#15872) 2025-10-23 18:00:40 -07:00
fal_ai.jpg [Feat] Add FAL AI Image Generations on LiteLLM (#16067) 2025-10-29 13:10:51 -07:00
featherless.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
figma.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
fireworks.svg set_local_icons 2025-03-19 14:37:57 +00:00
friendli.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
galileo.ico fix(galileo): use ingest traces API and standard logging payload (#29651) 2026-06-05 09:03:17 -07:00
gigachat.svg feature(gigachat): add gigachat passthrough endpoint 2026-04-16 15:28:27 +00:00
github.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
github_copilot.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
gitlab.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
gmail.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
google.svg set_local_icons 2025-03-19 14:37:57 +00:00
google_drive.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
google_pse.png [Feat] UI - Add logos for search providers (#15872) 2025-10-23 18:00:40 -07:00
groq.svg set_local_icons 2025-03-19 14:37:57 +00:00
guardrails_ai.jpeg updates guardrail provider logos 2025-10-10 11:39:14 -07:00
hubspot.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
huggingface.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
hyperbolic.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
infinity.png added Infinity as a provider in the UI 2025-10-07 10:21:18 -07:00
javelin.png updates guardrail provider logos 2025-10-10 11:39:14 -07:00
jina.png Added Voyage, Jinai, Deepinfra and VolcEngine providers on the UI (#13131) 2025-07-30 10:01:07 -07:00
jira.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
lago.svg Add logos to callback list (#12244) 2025-07-02 09:55:55 -07:00
lakeraai.jpeg [UI] Allow adding Bedrock, Presidio, Lakera, AIM guardrails on UI (#10874) 2025-05-15 21:22:56 -07:00
lambda.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
langflow.svg feat(agents): add LangFlow agent provider with A2A session bridging (#28963) 2026-06-02 14:45:56 -07:00
langfuse.png Add logos to callback list (#12244) 2025-07-02 09:55:55 -07:00
langfuse.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
langgraph.png [Feat] Agent Gateway - allow adding langgraph, bedrock agent core agents (#17802) 2025-12-10 19:13:50 -08:00
langsmith.png Add logos to callback list (#12244) 2025-07-02 09:55:55 -07:00
lasso.png updates guardrail provider logos 2025-10-10 11:39:14 -07:00
linear.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
litellm.jpg [UI] Allow adding Bedrock, Presidio, Lakera, AIM guardrails on UI (#10874) 2025-05-15 21:22:56 -07:00
litellm_logo.jpg add litellm logo jpg 2025-11-07 15:36:49 -08:00
llm_guard.png [UI] Allow adding Bedrock, Presidio, Lakera, AIM guardrails on UI (#10874) 2025-05-15 21:22:56 -07:00
lmstudio.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
mcp_logo.png [UI] Polish New MCP Server Add Form (#11604) 2025-06-10 17:20:17 -07:00
meta_llama.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
microsoft_azure.svg set_local_icons 2025-03-19 14:37:57 +00:00
milvus.svg Adding svg 2025-12-15 18:34:34 -08:00
minimax.svg feat: Add MiniMax official logo to UI 2025-12-29 00:21:14 -03:00
mistral.svg set_local_icons 2025-03-19 14:37:57 +00:00
moonshot.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
morph.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
nebius.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
newrelic.png feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
nimble.png feat(search): add Nimble as a search provider (#36347) 2026-08-14 17:09:58 -07:00
noma_security.png updates guardrail provider logos 2025-10-10 11:39:14 -07:00
notion.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
novita.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
nvidia_nim.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
nvidia_triton.png ui - add nvidia triton models (#10456) 2025-04-30 21:42:15 -07:00
ollama.svg set_local_icons 2025-03-19 14:37:57 +00:00
openai_small.svg set_local_icons 2025-03-19 14:37:57 +00:00
openmeter.png Add logos to callback list (#12244) 2025-07-02 09:55:55 -07:00
openrouter.svg set_local_icons 2025-03-19 14:37:57 +00:00
oracle.svg fix: added oracle to provider's list (#14835) 2025-09-23 17:21:19 -07:00
otel.png Add logos to callback list (#12244) 2025-07-02 09:55:55 -07:00
palo_alto_networks.jpeg updates guardrail provider logos 2025-10-10 11:39:14 -07:00
pangea.png updates guardrail provider logos 2025-10-10 11:39:14 -07:00
parallel_ai.png [Feat] UI - Add logos for search providers (#15872) 2025-10-23 18:00:40 -07:00
perplexity-ai.svg set_local_icons 2025-03-19 14:37:57 +00:00
perplexity.png [Feat] UI - Add logos for search providers (#15872) 2025-10-23 18:00:40 -07:00
pillar.jpeg updates guardrail provider logos 2025-10-10 11:39:14 -07:00
postgresql.svg [Feat] New Vector Store - PG Vector (#12667) 2025-07-16 18:17:05 -07:00
presidio.png [Feat] Add endpoints for adding, deleting, editing guardrails in DB (#10833) 2025-05-14 14:19:51 -07:00
prompt_security.png Prompt security litellm (#16365) 2025-11-24 11:44:20 -08:00
promptguard.svg refactor(ui): migrate MCP, callback, guardrail, SSO, and search tool logos to the shared Logo component (#34169) 2026-07-21 22:22:54 +00:00
pydantic.svg [Feat] New provider - Agent Gateway, add pydantic ai agents (#18013) 2025-12-15 17:40:58 -08:00
qohash.jpg feat: add Qohash Nexus guardrail hook (#24927) 2026-05-01 17:26:32 +05:30
qwen.png [Fixes] Using Qwen API Tiered Pricing (#14479) 2025-09-11 20:07:41 -07:00
recraft.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
repelloai.png chore: litellm oss staging (#30745) 2026-06-18 13:55:35 -07:00
replicate.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
runway.png [UI] Add RunwayML on Admin UI supported models/providers (#16606) 2025-11-13 21:46:35 -08:00
s3_vector.png [Feat] RAG API - Add s3_vectors as provider on /vector_store/search API + UI for creating + PDF support for /rag/ingest (#19895) 2026-01-27 16:30:59 -08:00
salesforce.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
sambanova.svg style: update sambanova logos (#12431) 2025-07-08 13:56:50 -07:00
sap.png fix(sap): add sap as provider for list in add credentials component in proxy ui, add sap logo (#18375) 2025-12-23 22:29:51 +05:30
scx_ai.svg feat(ui): add SCX.ai to the dashboard provider list with logo 2026-07-27 17:05:06 +10:00
search1api.png [Feat] UI - Add logos for search providers (#15872) 2025-10-23 18:00:40 -07:00
secret_detect.png [UI] Allow adding Bedrock, Presidio, Lakera, AIM guardrails on UI (#10874) 2025-05-15 21:22:56 -07:00
sentry.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
shopify.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
slack.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
snowflake.svg [Feat] UI - add snowflake on UI (#15083) 2025-09-30 13:16:04 -07:00
soniox.svg fix(ui): bundle provider logos as static imports and unify fallback in Logo component (#34125) 2026-07-21 14:27:36 -07:00
straiker.svg feat: add Straiker guardrail integration (#33781) 2026-07-18 03:31:29 +00:00
stripe.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
tavily.png [Feat] UI - Add logos for search providers (#15872) 2025-10-23 18:00:40 -07:00
togetherai.svg set_local_icons 2025-03-19 14:37:57 +00:00
topaz.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
twilio.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
v0.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
valkey.svg feat(vector_stores): add Valkey as a managed vector store provider (#37002) 2026-08-18 21:45:22 +00:00
vercel.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
vllm.png [ui/dashboard] add support for host_vllm (#13885) 2025-08-22 09:39:40 -07:00
volcengine.png Added Voyage, Jinai, Deepinfra and VolcEngine providers on the UI (#13131) 2025-07-30 10:01:07 -07:00
voyage.webp Added Voyage, Jinai, Deepinfra and VolcEngine providers on the UI (#13131) 2025-07-30 10:01:07 -07:00
watsonx.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
xai.svg set_local_icons 2025-03-19 14:37:57 +00:00
xecguard.svg Adding Cycraft XecGuard integration (#26011) 2026-04-27 08:58:38 +05:30
xinference.svg [UI QA] - Add all provider models + providers on ui (#22461) 2026-02-28 17:35:08 -08:00
zapier.svg [Feat] UI - Show logos on MCP Apps page (#23320) 2026-03-10 20:27:13 -07:00
zscaler.svg feat(ui): added UI for Zscaler AI Guard (#21077) 2026-02-12 20:27:44 -08:00