Some tools need to upload files — attaching a PDF to an email, pushing a diff to a GitHub PR — or download them — exporting a Google Sheet, retrieving a document from Notion. Composio provides secure file handling that integrates transparently with tool execution, with automatic path validation and opt-in auto-upload. By default, automatic file handling is disabled so that no file leaves your machine without an explicit decision from you.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ComposioHQ/composio/llms.txt
Use this file to discover all available pages before exploring further.
Enabling auto file handling
Automatic file upload and download during tool execution is disabled by default. Enable it by passingdangerouslyAllowAutoUploadDownloadFiles: true when initializing the Composio client:
- Tab Title
- Tab Title
File upload allowlist
By default, only~/.composio/temp is an allowed source directory for automatic uploads. Configure the allowlist using fileUploadDirs (TypeScript) or file_upload_dirs (Python):
- Tab Title
- Tab Title
/tmp/myapp allows /tmp/myapp/report.pdf but not /tmp/myapp-other/file.pdf. Providing a non-empty list replaces the default ~/.composio/temp entry — include it explicitly if you still want the default staging directory to work.
fileUploadDirs value | Behavior |
|---|---|
undefined (default) | Only ~/.composio/temp is allowed |
["/tmp/myapp", ...] | Only listed directories are allowed |
false or [] | All local path uploads are rejected (URLs and in-memory bytes still work) |
Sensitive file protection
sensitiveFileUploadProtection is enabled by default and blocks uploads from paths that contain sensitive segments such as .ssh, .aws, .env, .gnupg, and private key file extensions. This prevents a malicious tool from exfiltrating your credentials.
- Tab Title
- Tab Title
.ssh, .aws, .env, .gnupg, .netrc, .git-credentials, .npmrc, .pypirc, and common private key file extensions (.pem, .key, .p12, .pfx).
Manual file upload
Usecomposio.files.upload() for explicit, programmatic uploads that are independent of tool execution. Manual uploads intentionally skip the fileUploadDirs allowlist — they are always under your control:
- Tab Title
- Tab Title
File download directory
Configure where downloaded files are saved withfileDownloadDir (TypeScript) or file_download_dir (Python). If not set, files are saved to a system temp directory:
- Tab Title
- Tab Title
Configuration summary
| Option | Type | Default | Description |
|---|---|---|---|
dangerouslyAllowAutoUploadDownloadFiles | boolean | false | Opt-in for automatic file handling during tool execution |
fileUploadDirs | string[] | false | ~/.composio/temp | Allowlist of directories for automatic uploads |
sensitiveFileUploadProtection | boolean | true | Block sensitive paths (.ssh, .aws, .env, etc.) |
fileUploadPathDenySegments | string[] | [] | Extra path segments to add to the built-in denylist |
fileDownloadDir | string | system temp | Directory where downloaded files are saved |
Tools and Toolkits
Discover which tools support file upload and download
Sessions
Configure sessions for tool execution with file support
Observability
Debug file-related tool execution failures
TypeScript SDK Reference
Full ComposioConfig option reference