{"record":{"id":"acf327ad66b7aed2","repo":"BerriAI/litellm","slug":"bedrockguardrail-checks-block-contained-only-un","errorCode":null,"errorMessage":"BedrockGuardrail: 'checks' block contained only unrecognized or empty keys {sorted(raw.keys())}. Known keys: {sorted(_BEDROCK_CHECKS_KNOWN_KEYS)}. Fix the guardrail config or remove the 'checks' block to use ApplyGuardrail mode.","messagePattern":"BedrockGuardrail: 'checks' block contained only unrecognized or empty keys (.+?)\\. Known keys: (.+?)\\. Fix the guardrail config or remove the 'checks' block to use ApplyGuardrail mode\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py","lineNumber":311,"sourceCode":"\n        Accepts a pydantic ``BedrockChecksConfigModel`` or a raw dict; drops None /\n        unknown keys. Returns None when no usable check is configured (=> ApplyGuardrail).\n        \"\"\"\n        if checks is None:\n            return None\n        raw = checks.model_dump(exclude_none=True) if isinstance(checks, BedrockChecksConfigModel) else dict(checks)\n        unknown_keys: Final = set(raw.keys()) - _BEDROCK_CHECKS_KNOWN_KEYS\n        if unknown_keys:\n            verbose_proxy_logger.warning(\n                \"BedrockGuardrail: unrecognized check key(s) %s will be ignored; \"\n                \"recognized keys will still be used for InvokeGuardrailChecks. \"\n                \"Known keys: %s.\",\n                sorted(unknown_keys),\n                sorted(_BEDROCK_CHECKS_KNOWN_KEYS),\n            )\n        cleaned = {key: value for key, value in raw.items() if key in _BEDROCK_CHECKS_KNOWN_KEYS and value is not None}\n        if not cleaned and raw:\n            raise ValueError(\n                f\"BedrockGuardrail: 'checks' block contained only unrecognized or empty keys {sorted(raw.keys())}. \"\n                f\"Known keys: {sorted(_BEDROCK_CHECKS_KNOWN_KEYS)}. \"\n                \"Fix the guardrail config or remove the 'checks' block to use ApplyGuardrail mode.\"\n            )\n        return cleaned or None\n\n    def _create_bedrock_input_content_request(self, messages: list[AllMessageValues] | None) -> BedrockRequest:\n        \"\"\"\n        Create a bedrock request for the input content - the LLM request.\n        \"\"\"\n        bedrock_request: Final[BedrockRequest] = BedrockRequest(source=\"INPUT\")\n        bedrock_request_content: Final[list[BedrockContentItem]] = []\n        if messages is None:\n            return bedrock_request\n        for message in messages:\n            blocks = self.get_content_items_for_message(message=message)\n            if blocks is None:\n                continue","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py#L293-L329","documentation":"Error \"BedrockGuardrail: 'checks' block contained only unrecognized or empty keys {sorted(raw.keys())}. Known keys: {sorted(_BEDROCK_CHECKS_KNOWN_KEYS)}. Fix the guardrail config or remove the 'checks' block to use ApplyGuardrail mode.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py:311 when the library encounters an invalid state.","commonSituations":"The Bedrock checks block contains only unrecognized or empty keys.","solutions":["Fix the checks block to use the known check keys listed in the error, or remove the checks block."],"exampleFix":"checks:\n  content_filters: [...]  # use only keys from _BEDROCK_CHECKS_KNOWN_KEYS","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-14T05:17:10.506Z"}