litellm/tests/unit/enterprise
zoveki fb00770538
fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805)
* fix(decisions): accept OpenAI input_json content parts on /v1/decisions

User messages on the OpenAI-format /v1/decisions route can now carry
input_json parts whose data is an object or an array of objects. OpenAI
and Azure deployments forward them unchanged. Providers without JSON input
answer 400 naming input_json, or drop the part under drop_params. An
input_json part takes no prompt_cache_breakpoint, matching OpenAI.

* fix(router): send Decisions input_json to deployments that take JSON in a mixed group

* test(decisions): match input_json test answers to the asked question

* fix(decisions): catch tuple input_json in the router filter and mark it in latest-turn spend logs

* fix(router): keep JSON-only Decisions calls off deployments that would drop all input under drop_params

* fix(router): skip Decisions deployments whose drop would leave no input under drop_params

* fix(decisions): run text guardrails on input_json data and count only kept image types

* fix(decisions): redact input_json keys, scan it in LLM Shield and Cisco, count only surely kept images

hide_secrets now checks each input_json value with its key in front and rewrites secrets found in keys too. LLM Shield scans the strings in input_json data, and Cisco AI Defense scans the data as JSON text and falls back to on_flagged_action in redact mode, since it cannot write redacted text back into JSON

The drop_params check that skips a deployment the drop would leave with no input now counts an image as kept only when it is well formed and its media type is known to be one the deployment takes

* fix(guardrails): keep colliding input_json keys apart and let LLM Shield mask keys and numbers

hide-secrets now gives a key that redacts to an existing name a numbered
suffix, so two secret keys in one object no longer collapse into one
value. LLM Shield now sends input_json keys and numbers to the shield
too, writes a number back only when the shield changed it, and renames
keys after every value write so no value lands under an old key

* fix(guardrails): block Cisco redact verdicts on input_json in every mode and resume colliding key suffixes

* fix(guardrails): refuse Cisco redaction of input_json even when the request carries a messages field

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-20 13:33:36 -08:00
..
enterprise_callbacks fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805) 2026-11-20 13:33:36 -08:00
integrations refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
proxy test(projects): assert both project cache eviction keys (#53129) 2026-11-20 09:50:18 -08:00
__init__.py test: add __init__.py to migrated tests/unit packages 2026-09-20 11:53:49 +00:00
conftest.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00