litellm/tests/unit/proxy/agent_endpoints
mrinal-berri 0ab513bea0
feat(guardrails): reject requests that name an unregistered guardrail when reject_unregistered_guardrails is on (#53214)
* feat(guardrails): reject requests that name an unregistered guardrail when reject_unregistered_guardrails is on

A request whose merged guardrails (request body, key, team, project, policy and model level) name a guardrail that is not registered on the proxy is served today with no guardrail and no error. With general_settings.reject_unregistered_guardrails: true, pre_call_hook now returns 400 naming the unregistered guardrails, including when no guardrails are registered at all. Off by default; skip_guardrails callers are not checked.

Resolves LIT-4787

* fix(guardrails): read every requested guardrail shape and a string "true" setting in the unregistered-guardrail check

The check skipped a metadata.guardrails value that was not a clean list of names, so an unregistered name in a {name: true} toggle map, a bare string, or a list with a non-name entry was still served unguarded, while the runtime does run registered names from those shapes. It now reads names from all of them. reject_unregistered_guardrails is parsed as a boolean the way fail_closed_rate_limit_enforcement is, so "true" turns it on and a non-boolean value logs a warning instead of being dropped silently.

* fix(guardrails): validate legacy toggles, policy steps, and A2A guardrails

* fix(a2a): validate agent guardrails before reserving rate limits

* test(guardrails): use raw strings for regex assertions

* fix(guardrails): validate selected fallback deployments before dispatch

* fix(router): keep guardrail validation imports proxy-scoped
2026-11-20 18:39:29 -08:00
..
auth feat(auth): read projects, tags, access groups and object permissions through rust repositories (#52178) 2026-11-18 22:32:06 +00:00
__init__.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_a2a_endpoints.py feat(guardrails): reject requests that name an unregistered guardrail when reject_unregistered_guardrails is on (#53214) 2026-11-20 18:39:29 -08:00
test_a2a_version_e2e.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_agent_header_isolation.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_agent_headers.py feat(agents): support Databricks Agent Platform agents in the agent gateway (#45681) 2026-10-15 12:42:06 -07:00
test_agent_rbac.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_agent_registry.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_agent_search.py fix(proxy): treat empty agent and skill search embedding model as not configured (#49485) 2026-10-31 15:32:26 -07:00
test_databricks_oauth.py feat(agents): support Databricks Agent Platform agents in the agent gateway (#45681) 2026-10-15 12:42:06 -07:00
test_endpoints.py feat(auth): decide key and JWT authentication in a Rust core (#51374) 2026-11-17 14:07:47 +09:00
test_identity.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_identity_store.py feat(db): route jwt provisioning writes through rust repositories (#52756) 2026-11-20 14:53:01 +09:00
test_kill_switch.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_managed_identity.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_model_list_helpers.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00