{"record":{"id":"07e79aedb740e83c","repo":"ComposioHQ/composio","slug":"refusing-to-auto-upload-attempted-no-upload-d","errorCode":null,"errorMessage":"Refusing to auto-upload \"{attempted}\": no upload directories are configured.","messagePattern":"Refusing to auto-upload \"(.+?)\": no upload directories are configured\\.","errorType":"exception","errorClass":"FileUploadPathNotAllowedError","httpStatus":null,"severity":"error","filePath":"python/composio/utils/upload_dir_allowlist.py","lineNumber":183,"sourceCode":"                    \"\",\n                    \"Common causes:\",\n                    \"  - Typo in the filename passed to the tool.\",\n                    \"  - Relative path resolved against the wrong working directory\",\n                    \"    (relative paths use os.getcwd() at the moment of upload).\",\n                    \"  - File was deleted between the tool being called and the upload starting.\",\n                    \"\",\n                    _build_help_footer(allowlist),\n                ]\n            )\n        )\n\n    try:\n        real_path = abs_path.resolve(strict=True)\n    except OSError:\n        real_path = abs_path\n\n    if not allowlist:\n        raise FileUploadPathNotAllowedError(\n            \"\\n\".join(\n                [\n                    f'Refusing to auto-upload \"{attempted}\": no upload directories are configured.',\n                    \"\",\n                    f\"Path attempted:   {attempted}\",\n                    f\"Resolved to:      {real_path}\",\n                    \"\",\n                    \"Automatic file upload during tool execution is locked down by default\",\n                    \"to prevent a prompt-injected tool from exfiltrating server files\",\n                    \"(source code, .env, SSH keys, etc.).\",\n                    _build_help_footer(allowlist),\n                ]\n            )\n        )\n\n    for dir_entry in allowlist:\n        if is_inside_dir(real_path, resolve_root(dir_entry)):\n            return","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/utils/upload_dir_allowlist.py#L165-L201","documentation":"assert_path_inside_upload_dirs refuses any auto-upload when the file_upload_dirs allowlist is empty — with no configured directories there is no safe boundary, so FileUploadPathNotAllowedError is raised telling you to configure `file_upload_dirs` first.","triggerScenarios":"Using file auto-upload features (from_path and callers) on a Composio client where file_upload_dirs was never set or was set to an empty list — the safety default is deny-all.","commonSituations":"New integrations that didn't opt in to upload dirs; refactor removing the config; environment/config loading silently yielding [] (missing env var parsed as empty); upgrading SDK versions where the allowlist became mandatory for auto-upload.","solutions":["Configure the allowlist explicitly: Composio(api_key=..., file_upload_dirs=[str(project_root)]) covering exactly the directories you want uploadable","If config comes from env/yaml, validate it's non-empty before constructing the client","Scope the dirs narrowly (e.g. only ./uploads) instead of the whole home directory","If you didn't intend auto-upload, switch to an explicit upload API that takes bytes/streams"],"exampleFix":"# before\ncomposio = Composio(api_key=KEY)  # no file_upload_dirs\nupload.from_path(\"./report.pdf\")\n# after\ncomposio = Composio(api_key=KEY, file_upload_dirs=[str(Path.cwd())])\nupload.from_path(\"./report.pdf\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\ncomposio = Composio(api_key=KEY, file_upload_dirs=[str(Path.cwd())])\nassert composio.file_upload_dirs, \"upload dirs must be configured before auto-upload\"","typeGuard":null,"tryCatchPattern":"from composio.exceptions import FileUploadPathNotAllowedError\ntry:\n    upload.from_path(p)\nexcept FileUploadPathNotAllowedError as e:\n    if \"no upload directories\" in str(e):\n        raise ConfigError(\"set file_upload_dirs on Composio\") from e","preventionTips":["Configure file_upload_dirs at client construction, not per-call","Validate config sources (env/yaml) yield a non-empty list","Scope allowlists to dedicated upload directories"],"tags":["file-upload","allowlist","configuration"],"backgroundTag":"missing-upload-allowlist-config","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}