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
docs(changelog): mask tokens for Composio-managed auth configs
Anshu Gargba245bd3e51d
diff --git a/docs/content/changelog/04-21-26-composio-managed-credentials-masking.mdx b/docs/content/changelog/04-21-26-composio-managed-credentials-masking.mdxnew file mode 100644index 000000000..a953acdea--- /dev/null+++ b/docs/content/changelog/04-21-26-composio-managed-credentials-masking.mdx@@ -0,0 +1,81 @@+---+title: "Composio-Managed Auth Configs Always Mask Access and Refresh Tokens"+description: "API responses no longer return raw access or refresh tokens for connections on Composio-managed auth configs, regardless of project masking settings. Connections on your own auth config are unchanged."+date: "2026-04-21"+---++Access tokens, refresh tokens, and the `Authorization` header returned by the connected-accounts API are now always masked for connections created through **Composio-managed auth configs**, regardless of the project's `mask_secret_keys_in_connected_account` setting. Connections created through your own auth config are unchanged.++## What is a Composio-managed auth config?++When you use a toolkit's default integration — for example, connecting a user to Gmail or Slack without registering your own OAuth application — the connection runs through an OAuth app that **Composio owns and shares across every customer on that default**. The access and refresh tokens the provider issues against that connection are bound to Composio's shared OAuth client, not to any credentials of yours.++You can tell a connection is Composio-managed by the `auth_config.is_composio_managed: true` field on the connected-account resource.++## Why this change++Because the OAuth application is shared, any enforcement the provider applies to it — rate limits, scope restrictions, or app-level bans — lands on **every** customer using that default integration. A single token used in ways that violate a provider's terms of service can degrade or break the default Gmail, Slack, or any other managed integration for every other customer on it.++Returning the raw tokens to the caller invited that risk. From now on, the connected-accounts API never exposes them. Composio continues to hold and use the tokens server-side to execute tools on your behalf.++## What's changing in the API++| Auth config | `mask_secret_keys_in_connected_account` | Tokens returned |+|---|---|---|+| Composio-managed | on | masked (unchanged) |+| Composio-managed | **off** | **masked (new)** |+| Your own auth config | on | masked (unchanged) |+| Your own auth config | off | raw (unchanged) |++### Example++Before (project masking off, Composio-managed Gmail connection):++```json+{+ "state": {+ "val": {+ "access_token": "ya29.a0ARrdaM9_full_secret_token",+ "refresh_token": "1//04_full_refresh_secret"+ }+ }+}+```++After:++```json+{+ "state": {+ "val": {+ "access_token": "ya29...",+ "refresh_token": "1//0..."+ }+ }+}+```++The same masking is applied wherever the same values appear in the response, including the `data`, `params`, and merged `headers.Authorization` fields.++### Affected endpoints++- [`GET /api/v3/connected_accounts/{id}`](https://docs.composio.dev/rest-api/connected-accounts/get-connected-accounts-by-nanoid)+- [`GET /api/v3/connected_accounts`](https://docs.composio.dev/rest-api/connected-accounts/get-connected-accounts)+- [`POST /api/v3/connected_accounts`](https://docs.composio.dev/rest-api/connected-accounts/post-connected-accounts)++### What's not affected++- **Tool execution** — `POST /api/v3/tools/execute/*`, Tool Router, and MCP continue to work. Composio uses the tokens server-side; your agents do not need to see them.+- **Connections on your own auth config** — token visibility still follows your project's masking setting exactly as before.++## Need raw tokens? Bring your own auth config++Tokens issued against your own OAuth application belong to you, and the connected-accounts API returns them in the clear (subject to your project's masking setting). To move a connection off the shared default:++1. Register an OAuth application with the provider (e.g., in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials) for Gmail).+2. [Create a custom auth config](https://docs.composio.dev/rest-api/auth-configs/post-auth-configs) with your credentials.+3. Initiate new connections against that auth config.++<Callout type="warn">+**Action required only if you read `access_token` or `refresh_token` from the connected-accounts API for Composio-managed connections.** Existing tool-execution flows (the SDK, Tool Router, MCP) do not look at those fields and continue to work without changes. If your code path does depend on raw tokens, migrate those connections to your own auth config.+</Callout>