Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
---
title: 'SDKs remove legacy automatic file handling config'
description: 'SDKs remove deprecated `autoUploadDownloadFiles` / `auto_upload_download_files`. Automatic file handling is off unless you set `dangerouslyAllowAutoUploadDownloadFiles` / `dangerously_allow_auto_upload_download_files`. Minor releases.'
date: '2026-04-24'
---
The Composio SDKs no longer accept the legacy flags that previously controlled automatic file upload and download during tool execution. Automatic handling of `file_uploadable` fields stays **off by default**; you opt in with the explicit `dangerously*` option only.
<Callout type="warn">
**Breaking change**
Those legacy properties are removed from the public constructors and config types. Code that still passes them must migrate. Anyone who **relied on the old default-on behavior** (no file flag in the constructor) must now **explicitly** set the `dangerously*` flag to `true` to keep automatic path/URL file handling.
</Callout>
### SDK versions (minor releases)
| Package | Previous | This release |
| ------- | -------- | ------------ |
| TypeScript `@composio/core` | v0.6.11 | **v0.8.0** |
| Python `composio` | v0.11.6 | **v0.12.0** |
Other `@composio/*` npm packages that depend on core are published as **patch** bumps in the same release train (via the changesets `updateInternalDependencies: "patch"` setting) so they pick up the updated `ComposioConfig` surface — they have no public-API changes of their own.
### Migration
Earlier SDK versions treated automatic file upload/download for `file_uploadable` tool fields as **on by default** (TypeScript: `autoUploadDownloadFiles` defaulted to `true` when unset; Python followed the same idea for `auto_upload_download_files` in prior releases). **That default is now off.** If you still want that behavior, you must **explicitly** set `dangerouslyAllowAutoUploadDownloadFiles: true` (TypeScript) or `dangerously_allow_auto_upload_download_files=True` (Python).
**TypeScript — before (legacy):**
```typescript
// @noErrors
// If you omitted autoUploadDownloadFiles, it used to default to true
new Composio({
apiKey: process.env.COMPOSIO_API_KEY!,
});
// Equivalent when you set it explicitly:
new Composio({
apiKey: process.env.COMPOSIO_API_KEY!,
autoUploadDownloadFiles: true,
});
```
**TypeScript — going forward** (set `true` to match either legacy pattern above):
```typescript
// @noErrors
new Composio({
apiKey: process.env.COMPOSIO_API_KEY!,
dangerouslyAllowAutoUploadDownloadFiles: true,
});
```
To leave automatic file handling **off** (new default), omit `dangerouslyAllowAutoUploadDownloadFiles` or set it to `false`.
**Python — before (legacy):**
```python
# If you omitted auto_upload_download_files, it used to default to True (prior releases)
Composio(api_key="...")
# Equivalent when you set it explicitly:
Composio(api_key="...", auto_upload_download_files=True)
```
**Python — going forward** (set `True` to match either legacy pattern above):
```python
Composio(api_key="...", dangerously_allow_auto_upload_download_files=True)
```
If you construct `ToolRouterSession` directly (unusual), the keyword argument is now `dangerously_allow_auto_upload_download_files` instead of `auto_upload_download_files`.
### Local paths must live inside an allowlisted directory
Even with `dangerouslyAllowAutoUploadDownloadFiles` enabled, the SDK will **only** auto-upload local file paths that resolve inside an allowlisted directory. Paths outside the allowlist are rejected with `ComposioFileUploadPathNotAllowed` (TypeScript) / `FileUploadPathNotAllowed` (Python) before any file is read or sent.
This is a behavior change. Earlier SDK versions had no allowlist: any local path the legacy default-on flag saw was uploaded.
**Default allowlist:**
| `fileUploadDirs` value | Effective allowlist |
| ---------------------- | ------------------- |
| omitted / `undefined` | `[ <home>/.composio/temp ]` (default staging dir) |
| `false` | `[]` — **all** local paths rejected (URLs and `File` objects still work) |
| `[]` | `[]` — same as `false`; explicit "no local paths" |
| `[<dir1>, <dir2>, …]` | exactly those directories (replaces the default; `~` is expanded, paths are `realpath`-resolved, comparison is on a path-component boundary) |
URLs (`http://…` / `https://…`) and JavaScript `File` objects are **not** subject to the allowlist — only local string paths are.
**TypeScript:**
```typescript
// @noErrors
// Match the *broadest* legacy behavior: auto-upload on, allowlist widened to
// the directories your code actually reads from. Set this scope as tightly
// as you can — every path inside these dirs becomes uploadable to Composio.
new Composio({
apiKey: process.env.COMPOSIO_API_KEY!,
dangerouslyAllowAutoUploadDownloadFiles: true,
fileUploadDirs: ['/srv/uploads', '~/data/inbox'],
});
// Disallow local-path uploads entirely; the SDK will only stage URLs and
// File objects, and reject string paths outright.
new Composio({
apiKey: process.env.COMPOSIO_API_KEY!,
dangerouslyAllowAutoUploadDownloadFiles: true,
fileUploadDirs: false,
});
```
**Python:**
```python
# Equivalent of the TypeScript example above.
Composio(
api_key="...",
dangerously_allow_auto_upload_download_files=True,
file_upload_dirs=["/srv/uploads", "~/data/inbox"],
)
# Reject all local paths.
Composio(
api_key="...",
dangerously_allow_auto_upload_download_files=True,
file_upload_dirs=False,
)
```
**Manual staging (TypeScript only):**
If you don't want to widen the allowlist, the TypeScript SDK lets you stage files yourself via `composio.files.upload(...)`. That call **bypasses the allowlist** by design (the caller is expected to control the path), and the returned `{ name, mimetype, s3key }` descriptor can be passed straight into `tools.execute`:
```typescript
// @noErrors
const staged = await composio.files.upload({
file: '/anywhere/on/disk/report.pdf',
toolSlug: 'GOOGLEDRIVE_UPLOAD_FILE',
toolkitSlug: 'googledrive',
});
await composio.tools.execute('GOOGLEDRIVE_UPLOAD_FILE', {
userId: 'user-1',
arguments: { file_to_upload: staged },
});
```
The Python SDK does not currently expose a top-level manual-staging API; opt in with `dangerously_allow_auto_upload_download_files=True` and configure `file_upload_dirs` to cover the directories your code reads from.
### What else changed
- TypeScript: `resolveAutoUploadDownloadFilesEnabled` only considers `dangerouslyAllowAutoUploadDownloadFiles`; the old deprecation warning for the legacy property is removed.
- Python: the small `composio.utils.auto_upload_download` helper that merged legacy + new flags is removed; `Tools` and `ToolRouter` take only the explicit opt-in boolean.
Documentation for [executing tools](/docs/tools-direct/executing-tools) and the TypeScript [Composio reference](/reference/sdk-reference/typescript/composio) is updated to describe defaults and the opt-in flag.