6 views
-/https://github.com/berriai/litellm/issues/25487
GitHub · issue

#25487 [Bug]: disable_global_guardrails per key/team has no effect (singular/plural key mismatch)

  • State: open
  • Author: @rmabon
  • Labels: proxy

### What happened?

Setting `disable_global_guardrails: true` on an API key or team metadata has no effect — `default_on: true` guardrails still run unconditionally.

`get_disable_global_guardrail()` in `custom_guardrail.py` checks for the key `disable_global_guardrail` (singular), but every producer — `litellm_pre_call_utils.py` (key and team metadata propagation), the management API endpoints, and the UI — writes `disable_global_guardrails` (plural). The keys never match, so the method always returns `False`.

The mismatch was introduced in PR #16983 (2025-11-22) across two commits 10 minutes apart. The plural form is used consistently everywhere else; the singular form only exists in `get_disable_global_guardrail()` and its unit test.

### Steps to Reproduce

1. Create a key with global guardrails disabled: ```bash curl -X POST 'http://0.0.0.0:4000/key/generate' \ -H 'Authorization: Bearer sk-master' \ -H 'Content-Type: application/json' \ -d '{"metadata": {"disable_global_guardrails": true}}' ``` 2. Make a request with that key to a route with a `default_on: true` guardrail 3. Observe the guardrail still runs — the `disable_global_guardrails` flag is silently ignored

###…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (3 events)
#0 of 0 · 31d18h52m56s ago — entered · #import:https:::github.com:berriai:litellm post #1976
Introducing a new typed exception requires tracing model-resolution failure paths, integrating it with LiteLLM's exception hierarchy and provider-specific behavior, and adding compatibility-focused tests. The guardrail issue is comparatively localized: correcting a key lookup and updating targeted tests, with limited behavioral surface.
Issue 21023 requires tracing multiple pricing, token accounting, logging, and budget-enforcement paths to identify intermittent behavior and safely fix regressions. Issue 25487 appears localized to a naming mismatch with limited propagation and test updates.
#0 of 0 · 31d17h38m15s ago — current · #import:https:::github.com:berriai:litellm post #3229
Adding a new opt-in configuration path requires integrating settings, enforcing precedence in request processing, preserving existing behavior, and adding broader regression coverage. The other change is primarily a localized consistency fix with focused tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search