litellm/litellm/proxy/common_utils
devin-ai-integration[bot] ef3a3c16ae
feat(guardrails): map each guardrail scan id to its guardrail, stage and provider (#40327)
* feat(guardrails): map each guardrail scan id to its guardrail, stage and provider

Adds the x-litellm-guardrail-scan-metadata response header, a JSON list of
{guardrail, stage, provider, scan_id} entries, next to the existing
comma-separated x-litellm-guardrail-scan-id header. Prisma AIRS records the
execution stage for every scan and OpenAI Moderation now records its
moderation id too. The new metadata key is internal: client-supplied values
are stripped and it is exposed through the UI CORS allow list.

Resolves LIT-6018

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(guardrails): cap the scan metadata response header at a configurable length

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(guardrails): hardcode the scan metadata header cap

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-08 23:32:31 -07:00
..
html_forms feat(proxy): native CLI login with OAuth authorization code + PKCE 2026-08-20 04:10:10 -07:00
admin_ui_utils.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
auth_cache_invalidation_pubsub.py fix(proxy): reset a stuck team member's budget (#37971) 2026-08-25 09:50:09 -07:00
banner.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
cache_coordinator.py refactor(typing): replace Any with proven types in 65 backend files 2026-09-02 09:11:36 +00:00
cache_pydantic_utils.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
callback_config_validation.py feat(team): let a team admin manage their own team's logging callbacks (#37667) 2026-09-08 15:58:58 -07:00
callback_utils.py feat(guardrails): map each guardrail scan id to its guardrail, stage and provider (#40327) 2026-09-08 23:32:31 -07:00
config_sync_pubsub.py refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +00:00
custom_openapi_spec.py refactor(types): replace Any with real types across 54 more backend files 2026-08-29 19:00:43 +00:00
debug_utils.py refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
encrypt_decrypt_utils.py fix(mcp): encrypt stored static headers and stdio environment (#40164) 2026-09-07 16:03:06 -07:00
expired_ui_session_key_cleanup_manager.py refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +00:00
get_routes.py refactor(types): replace Any with real types across 178 backend files 2026-08-27 10:14:58 +00:00
healthy_model_filter.py feat(proxy): hide unhealthy models from model listings, opt-in 2026-08-26 00:13:52 -07:00
http_parsing_utils.py chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
json_merge_patch.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
key_rotation_manager.py refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +00:00
load_config_utils.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
model_deprecation.py fix(proxy): escape slack markup in model deprecation alert fields 2026-08-13 02:39:34 +00:00
model_listing_utils.py feat(proxy): honor model_info.display_name in the Anthropic-shaped /v1/models listing 2026-09-01 17:10:52 -07:00
openai_endpoint_utils.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
openai_error_payload.py fix(proxy): label a 408 invalid_request_error again and pin the in-route status on the files and realtime tails 2026-09-08 13:11:24 -07:00
openapi_schema_compat.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
path_utils.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
performance_utils.md build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
performance_utils.py refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
periodic_reload_schedule.py fix(proxy): persist periodic reload schedule state so status survives restarts and fires without store_model_in_db (#35165) 2026-08-04 15:42:57 -07:00
proxy_rate_limit_error.py chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
proxy_state.py (feat) UI - Disable Usage Tab once SpendLogs is 1M+ Rows (#7208) 2024-12-12 18:43:17 -08:00
rbac_utils.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
realtime_utils.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
registry_read_through.py fix(proxy): load db credentials in the model reconcile so a worker never serves a model before its credential (#39876) 2026-09-08 10:08:24 -07:00
reset_budget_job.py style(proxy): format reset_budget_job with ruff 2026-09-04 16:37:58 +05:30
resource_ownership.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
scheduled_job_stagger.py perf(proxy): stagger scheduled background jobs across jobs and pods (#36589) 2026-08-12 09:17:31 -07:00
semantic_text_index.py feat(skills): semantic search over the LiteLLM-hosted skill registry (#39401) 2026-09-07 12:28:38 -07:00
sse_keepalive.py fix(passthrough): recognize CR-only SSE frame delimiters when minting streamed managed ids 2026-08-26 01:36:18 -07:00
static_asset_utils.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
swagger_utils.py chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
timezone_utils.py feat(budgets): add configurable budget_reset_time of day (#31007) 2026-07-21 13:35:01 -07:00
user_api_key_cache.py Merge branch 'litellm_internal_staging' into litellm_decrease_anys_opus5_r2 2026-08-30 12:16:13 -07:00