{"record":{"id":"a24b9a983ff28e28","repo":"invoke-ai/InvokeAI","slug":"the-selected-system-prompt-system-prompt-id-is","errorCode":null,"errorMessage":"The selected system prompt '{system_prompt_id}' is not accessible to this user.","messagePattern":"The selected system prompt '(.+?)' is not accessible to this user\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/text_llm.py","lineNumber":165,"sourceCode":"        un-privatizable here while the REST layer still 403s on it. The seeded defaults are\n        `is_public=TRUE`, so `record.is_public` already covers them.\n        (`call_saved_workflow` can keep its default-category clause: workflow `category=default`\n        is a real column value, not an overloaded owner id.)\n        \"\"\"\n        system_prompt_id = self.system_prompt.system_prompt_id\n        try:\n            record = context._services.system_prompt_records.get(system_prompt_id)\n        except SystemPromptNotFoundError as e:\n            raise ValueError(f\"The selected system prompt '{system_prompt_id}' could not be found.\") from e\n\n        config = context._services.configuration\n        if config.multiuser:\n            queue_user_id = context._data.queue_item.user_id\n            user = context._services.users.get(queue_user_id)\n            is_admin = bool(user and user.is_admin)\n            is_owner = record.user_id == queue_user_id\n            if not (is_owner or record.is_public or is_admin):\n                raise ValueError(f\"The selected system prompt '{system_prompt_id}' is not accessible to this user.\")\n\n        return record\n\n    @torch.no_grad()\n    def invoke(self, context: InvocationContext) -> StringOutput:\n        record = self._resolve_system_prompt(context)\n        output = _run_text_llm(\n            context=context,\n            text_llm_model=self.text_llm_model,\n            prompt=self.prompt,\n            system_prompt=record.content,\n            max_tokens=self.max_tokens,\n            seed=self.seed,\n        )\n        return StringOutput(value=output)\n","sourceCodeStart":147,"sourceCodeEnd":181,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/text_llm.py#L147-L181","documentation":"In multiuser mode, after resolving the record, the code enforces access control: the queue item's user must own the system prompt, the prompt must be public, or the user must be an admin. Otherwise a ValueError is raised to prevent using another user's private prompt.","triggerScenarios":"A non-admin user's queue item references a private system prompt owned by someone else (record.user_id != queue_user_id, record.is_public False, user.is_admin False) while config.multiuser is enabled.","commonSituations":"Sharing workflow JSON between users of a shared multiuser instance; an admin building workflows for regular users using admin-owned private prompts; changing ownership of prompts after user cleanup.","solutions":["Have the prompt owner set it to public so other users' queue items can use it.","Log in / enqueue as the owning user or an admin account.","Duplicate the prompt into your own account and point the workflow at your copy.","Disable multiuser mode if this is a single-user install and access control is unnecessary."],"exampleFix":"// before\nrecord.is_public = False; record.user_id = \"admin\"\n// after\nrecord.is_public = True  # or pick a prompt owned by the queue user","handlingStrategy":"validation","validationCode":"record = services.system_prompt_records.get(node.system_prompt.system_prompt_id)\nuser = services.users.get(queue_user_id)\nif not (record.is_public or record.user_id == queue_user_id or (user and user.is_admin)):\n    raise PermissionError(\"Queue user cannot access this system prompt\")","typeGuard":"def can_access(record, user_id: str, is_admin: bool) -> bool:\n    return record.is_public or record.user_id == user_id or is_admin","tryCatchPattern":"try:\n    result = invoke(context)\nexcept ValueError as e:\n    if \"not accessible to this user\" in str(e):\n        duplicate_prompt_for_user(graph, queue_user_id)\n        retry(context)\n    else:\n        raise","preventionTips":["Make prompts public when building workflows for other users","Duplicate prompts into the enqueuing user's account","Audit workflow prompt ids when moving between single-user and multiuser modes"],"tags":["permissions","multiuser","llm"],"backgroundTag":"permission-denied","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}