{"record":{"id":"fc282e887f758ea6","repo":"BerriAI/litellm","slug":"sensitive-data-route-to-model-must-be-set-when-on","errorCode":null,"errorMessage":"sensitive_data_route_to_model must be set when on_sensitive_data='route'","messagePattern":"sensitive_data_route_to_model must be set when on_sensitive_data='route'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/guardrails.py","lineNumber":962,"sourceCode":"        \"on_disallowed_action\",\n        \"unreachable_fallback\",\n        \"on_sensitive_data\",\n        mode=\"before\",\n        check_fields=False,\n    )\n    @classmethod\n    def normalize_lowercase(cls, v):\n        \"\"\"Normalize string and list fields to lowercase for ALL guardrail types.\"\"\"\n        if isinstance(v, str):\n            return v.lower()\n        if isinstance(v, list):\n            return [x.lower() if isinstance(x, str) else x for x in v]\n        return v\n\n    @model_validator(mode=\"after\")\n    def validate_sensitive_data_routing(self) -> \"BaseLitellmParams\":\n        if self.on_sensitive_data == \"route\" and not self.sensitive_data_route_to_model:\n            raise ValueError(\"sensitive_data_route_to_model must be set when on_sensitive_data='route'\")\n        return self\n\n    model_config = ConfigDict(extra=\"allow\", protected_namespaces=())\n\n\nclass Mode(BaseModel):\n    tags: dict[str, str | list[str]] = Field(description=\"Tags for the guardrail mode\")\n    default: str | list[str] | None = Field(default=None, description=\"Default mode when no tags match\")\n\n\nclass LitellmParams(\n    CiscoAIDefenseGuardrailConfigModel,\n    PresidioConfigModel,\n    BedrockGuardrailConfigModel,\n    LakeraV2GuardrailConfigModel,\n    HeadroomGuardrailConfigModel,\n    CompresrGuardrailConfigModel,\n    RepelloAIGuardrailConfigModel,","sourceCodeStart":944,"sourceCodeEnd":980,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/guardrails.py#L944-L980","documentation":"Pydantic model_validator on guardrail params: on_sensitive_data was set to 'route' but sensitive_data_route_to_model was left unset, so the router has no destination model to send flagged requests to.","triggerScenarios":"Thrown at litellm/types/guardrails.py:962 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set sensitive_data_route_to_model to the target model when on_sensitive_data='route'.","Or change on_sensitive_data to 'block'/'mask' if routing is not needed."],"exampleFix":null,"handlingStrategy":"validation","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"}