{"record":{"id":"df36398c817612ff","repo":"ComposioHQ/composio","slug":"refusing-to-auto-upload-attempted-resolved-pa","errorCode":null,"errorMessage":"Refusing to auto-upload \"{attempted}\": resolved path is not inside any directory in the configured `file_upload_dirs` allowlist.","messagePattern":"Refusing to auto-upload \"(.+?)\": resolved path is not inside any directory in the configured `file_upload_dirs` allowlist\\.","errorType":"exception","errorClass":"FileUploadPathNotAllowedError","httpStatus":null,"severity":"error","filePath":"python/composio/utils/upload_dir_allowlist.py","lineNumber":203,"sourceCode":"                [\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\n\n    raise FileUploadPathNotAllowedError(\n        \"\\n\".join(\n            [\n                f'Refusing to auto-upload \"{attempted}\": resolved path is not inside any',\n                \"directory in the configured `file_upload_dirs` allowlist.\",\n                \"\",\n                f\"Path attempted:   {attempted}\",\n                f\"Resolved to:      {real_path}\",\n                _build_help_footer(allowlist),\n            ]\n        )\n    )\n","sourceCodeStart":185,"sourceCodeEnd":215,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/utils/upload_dir_allowlist.py#L185-L215","documentation":"The resolved (symlink-followed, absolute) path of the file to auto-upload is not inside any directory listed in file_upload_dirs, so FileUploadPathNotAllowedError is raised — including the attempted, resolved, and allowlist paths for debugging. Component-boundary checks also apply (paths must stay within the allowed roots).","triggerScenarios":"Uploading a file outside every configured dir (e.g. allowlist has /home/me/project but the file is /home/me/Desktop/f.pdf); symlinks resolving outside the allowlist; path traversal via ../ escaping the root; allowlist entries that don't match how the path resolves (relative-vs-absolute mismatch).","commonSituations":"Allowlist configured with relative paths but uploads resolve elsewhere; project dir moved/renamed after client construction; symlinked uploads directory pointing to shared storage; CI checking out code to a different path than configured.","solutions":["Add the file's actual resolved directory to file_upload_dirs (print abs_path.resolve() from the error to see the truth)","Move/copy the file inside an already-allowed directory before uploading","Configure allowlist entries as absolute paths, or rooted at the same base the uploads use","Beware symlinks: the check uses realpath, so link targets must also be inside the allowlist"],"exampleFix":"# before\nComposio(api_key=KEY, file_upload_dirs=[\"/home/me/project\"])\nupload.from_path(\"/home/me/Desktop/report.pdf\")\n# after\nComposio(api_key=KEY, file_upload_dirs=[\"/home/me/project\", \"/home/me/Desktop\"])\n# or: copy report.pdf into /home/me/project first","handlingStrategy":"validation","validationCode":"from pathlib import Path\ndef inside_allowlist(p, dirs):\n    rp = Path(p).resolve()\n    return any(rp.is_relative_to(Path(d).resolve()) for d in dirs)","typeGuard":null,"tryCatchPattern":"from composio.exceptions import FileUploadPathNotAllowedError\ntry:\n    upload.from_path(p)\nexcept FileUploadPathNotAllowedError as e:\n    if \"not inside any directory\" in str(e):\n        p = copy_into_allowed_dir(p)\n        upload.from_path(p)","preventionTips":["Use absolute allowlist entries matching real upload roots","Remember symlinks resolve to their target — include targets in the allowlist","Copy out-of-bounds files into an allowed staging directory"],"tags":["file-upload","allowlist","path-security","path-traversal"],"backgroundTag":"file-upload-path-not-allowed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}