Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
mdx 35 lines 2.99 KB
Raw
1 ---
2 title: 'Python SDK 0.24.0 and TypeScript SDK 0.21.0 add Session policies and fixes'
3 description: 'Control premium usage in both SDKs, use saved Session configs in TypeScript, and get fixes for Session updates and file downloads.'
4 date: '2026-09-24'
5 ---
6
7 Both SDKs add experimental premium usage policies and fix default Session updates. TypeScript also adds saved Session configs and hosted-account details in search results.
8
9 ### Release versions
10
11 | SDK | Version |
12 | --------------------------- | -------- |
13 | Python `composio` | `0.24.0` |
14 | TypeScript `@composio/core` | `0.21.0` |
15 | TypeScript `@composio/slim` | `0.21.0` |
16
17 ### Premium usage policies
18
19 Set `premiumUsage` in TypeScript or `premium_usage` in Python when creating or updating a Session to control billed tool execution. Pass `false` (`False` in Python) to disable it, or a policy object to restrict eligible toolkits and tools. Your project must allow premium usage. Passing a policy object re-enables premium usage on a Session where it was disabled.
20
21 In Python, set `premium_usage.return_premium_charge` to receive charge details when available. `session.execute()` exposes them through the typed `premium_charge` field on `ToolRouterSessionExecuteResponse`. Provider integrations and mixed local/remote multi-tool execution preserve these details. The exported `PremiumCharge` type includes `amount`, `currency`, and `charged_by`.
22
23 ### Saved Session configs in TypeScript
24
25 - Read saved configs with `composio.sessionConfigs.list()` and `composio.sessionConfigs.get()`.
26 - Apply a saved config through `experimental.sessionConfigId` when creating or updating a Session. Read its source metadata through `session.experimental.sourceSessionConfig`.
27 - Config IDs cannot be combined with inline access fields: `toolkits`, `tools`, or `tags`, plus `experimental.customTools` and `experimental.customToolkits` on create. Invalid combinations fail before a request is sent.
28 - Search results expose `hostedAccount.allowedToolSlugs` on toolkit connection statuses for Composio hosted accounts.
29
30 ### Fixes
31
32 - **Session updates in both SDKs:** `session.update()` no longer sends `expected_config_version` by default, fixing the API's rejection of ordinary updates. Updates use last writer wins. To request a conditional update where the API supports it, pass `expectedConfigVersion` in TypeScript or `expected_config_version` in Python explicitly.
33 - **File saves in both SDKs:** unsafe server-supplied mount paths now raise validation errors before creating directories or writing files. This includes paths that resolve to a directory or its parent and filenames with trailing dots exposed by stripping Unicode whitespace.
34 - **TypeScript downloads:** `RemoteFile.save()` validates its default destination before downloading content, so an invalid mount path fails without a network request.
35 - **Python auth configs:** update, delete, enable, and disable methods now declare the client's concrete response types, including their `success` and `message` fields.