{"record":{"id":"fe5673ed487e1375","repo":"BerriAI/litellm","slug":"mock-testing-request-params-are-disabled-on-this-p","errorCode":null,"errorMessage":"Mock testing request params are disabled on this proxy: {', '.join(params)}. An admin can enable them by setting `general_settings.dangerously_allow_mock_testing_request_params: true` in config.yaml. This setting cannot be changed from the Admin UI or the API.","messagePattern":"Mock testing request params are disabled on this proxy: (.+?)\\. An admin can enable them by setting `general_settings\\.dangerously_allow_mock_testing_request_params: true` in config\\.yaml\\. This setting cannot be changed from the Admin UI or the API\\.","errorType":"http","errorClass":"MockTestingParamsDisabledError","httpStatus":400,"severity":"error","filePath":"litellm/proxy/route_llm_request.py","lineNumber":211,"sourceCode":"                    f\"An admin can enable them by setting `general_settings.{MOCK_TESTING_CONFIG_KEY}: true` \"\n                    \"in config.yaml. This setting cannot be changed from the Admin UI or the API.\"\n                )\n            },\n        )\n\n\ndef raise_if_mock_testing_params_disallowed(data: Mapping[str, object], *, allowed: bool) -> None:\n    \"\"\"Reject client-supplied mock testing params unless an admin opted in.\n\n    Rejecting (rather than silently dropping) keeps a request that asked for a\n    synthetic failure from returning a normal success, which reads as a passing\n    fallback test that never ran.\n    \"\"\"\n    if allowed:\n        return\n    present: Final = tuple(name for name in GATED_MOCK_PARAM_NAMES if name in data)\n    if present:\n        raise MockTestingParamsDisabledError(params=present)\n\n\ndef mock_testing_params_allowed() -> bool:\n    \"\"\"Read the opt-in from the running proxy's ``general_settings``.\"\"\"\n    from litellm.proxy import proxy_server\n\n    return proxy_server.general_settings.get(MOCK_TESTING_CONFIG_KEY, False) is True\n\n\ndef get_team_id_from_data(data: dict) -> str | None:\n    \"\"\"\n    Get the team id from the data's metadata or litellm_metadata params.\n    \"\"\"\n    if \"metadata\" in data and data[\"metadata\"] is not None and \"user_api_key_team_id\" in data[\"metadata\"]:\n        return data[\"metadata\"].get(\"user_api_key_team_id\")\n    elif (\n        \"litellm_metadata\" in data\n        and data[\"litellm_metadata\"] is not None","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/route_llm_request.py#L193-L229","documentation":"Error \"Mock testing request params are disabled on this proxy: {', '.join(params)}. An admin can enable them by setting `general_settings.dangerously_allow_mock_testing_request_params: true` in config.yaml. This setting cannot be changed from the Admin UI or the API.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/route_llm_request.py:211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove mock-testing-only parameters from the request, or have an admin set general_settings.dangerously_allow_mock_testing_request_params: true in config.yaml."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}