{"record":{"id":"e229624bc52e34b5","repo":"BerriAI/litellm","slug":"cannot-update-config-prompts","errorCode":null,"errorMessage":"Cannot update config prompts.","messagePattern":"Cannot update config prompts\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/prompts/prompt_endpoints.py","lineNumber":883,"sourceCode":"        environment: Final = (\n            request.prompt_info.environment\n            if request.prompt_info and request.prompt_info.environment\n            else \"development\"\n        )\n\n        # Check if any version of this prompt exists (in any environment)\n        existing_prompts = await _prompt_table(prisma_client).find_many(where={\"prompt_id\": base_prompt_id})\n\n        if not existing_prompts:\n            raise HTTPException(\n                status_code=404,\n                detail=f\"Prompt with ID {base_prompt_id} not found\",\n            )\n\n        # Check if it's a config prompt\n        existing_in_memory: Final = IN_MEMORY_PROMPT_REGISTRY.get_prompt_by_id(prompt_id)\n        if existing_in_memory and existing_in_memory.prompt_info.prompt_type == \"config\":\n            raise HTTPException(\n                status_code=400,\n                detail=\"Cannot update config prompts.\",\n            )\n\n        # Get next version number (UPDATE creates a new version)\n        new_version: Final = await get_next_version_for_prompt(\n            prisma_client=prisma_client,\n            prompt_id=base_prompt_id,\n            environment=environment,\n        )\n\n        # Store new version in db\n        prompt_db_entry: Final = await _prompt_table(prisma_client).create(\n            data={\n                \"prompt_id\": base_prompt_id,\n                \"version\": new_version,\n                \"environment\": environment,\n                \"created_by\": user_api_key_dict.user_id,","sourceCodeStart":865,"sourceCodeEnd":901,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/prompts/prompt_endpoints.py#L865-L901","documentation":"Mutation guard on prompt update: the target prompt exists, but it originates from the proxy config file (prompt_type 'config') rather than the database. Config-defined prompts are read-only via the API because the config file is the source of truth.","triggerScenarios":"Thrown at litellm/proxy/prompts/prompt_endpoints.py:883 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Config-defined prompts are immutable at runtime; edit the prompt in config.yaml and restart, or create a DB prompt instead."],"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-14T05:17:10.506Z"}