DEV Community

Composio Production Review: User Isolation and Token Custody

Why We Reviewed Composio

We care less about how quickly an agent connects GitHub than whether its next request can accidentally run against another customer's account.

Managed authentication is not product authorization. Sessions scope private accounts by user ID, but direct proxy owner checks depend on project settings; the backend must enforce account ownership.

Composio addresses a real infrastructure burden: provider authentication, connected-account storage, token refresh, and authenticated tool execution. Our backend supplies an identity or connected-account identifier and an operation. Composio resolves credentials, authenticates the provider request server-side, and returns its result.

We do not need to put OAuth tokens in model context - or even retrieve them into our application. That is useful delegation. It is not delegated product authorization.

Our central finding from reviewing the token-custody and isolation contract is that session account selection and direct Proxy Execute have materially different authorization boundaries. Within a session, Composio resolves a private connection using the user identity. A direct proxy request requires additional care: owner validation for a private account depends on the project's 2FA setting. We would enforce ownership in our backend regardless.

We also need to set the evidence boundary plainly. This review is a source-verified architecture assessment with a reproducible worked example, not a completed live-service benchmark. We did not connect real accounts, observe an OAuth refresh, induce provider throttling, or measure concurrent isolation.

The commands and acceptance tests below are the deployment procedure we would use; illustrative output is labeled accordingly. Our verdict is therefore conditional: Composio is a credible way to buy managed authentication and execution, but we would not approve production deployment from a successful Connect Link alone.

This distinction complements our Docker MCP Gateway security review. Keeping secrets outside an agent is one control. Binding each operation to the correct customer is another.

Hands-On Walkthrough: Setup, Execution & Output

Resolve the package mismatch first

The setup requirement we started with used these commands:

# Legacy setup sequence; not verified for the current session API.
pip install composio-core
composio login

We would not present that sequence as a verified installation for the code below. For our managed-authentication worked example, we use pip install composio, not composio-core. We have not verified either package installation or the CLI login command's current availability or behavior.

For this worked example, we follow the current package path and use an explicit server-side project key:

python -m venv .venv
. .venv/bin/activate
python -m pip install composio
export COMPOSIO_API_KEY="replace-with-your-development-project-key"
python -m pip show composio

We would record and lock the resolved version after validation. We would not install both package names into one environment and assume that import compatibility proves API compatibility.

Our configuration checklist is short:

  • Use a disposable development Composio project.
  • Keep its API key out of browsers, prompts, and repositories.
  • Enable session-management write, connected-account read, and proxy-execution permissions. For scoped keys, use the exact Proxy execute (Legacy) permission label exposed by the managed-auth guide. The label does not require a legacy SDK.
  • Restrict the test to GitHub and a read-only GET /user.
  • Use a throwaway GitHub account. A custom OAuth app is optional for this basic managed-auth test; use one when validating your own consent screen, scopes, and quota configuration.

Connect one owner, then test our application boundary

We use org_lab:member_a and org_lab:member_b as two immutable application identities. Only A connects an account. We do not relabel A's private connection as B's to simulate legitimate sharing.

The following script is runnable after installation and key configuration. Its ownership dictionary stands in for a verified database mapping. It demonstrates our application guard, not Composio's server-side isolation.

# review_auth.py
import json
from composio import Composio

client = Composio()

owner_a = "org_lab:member_a"
owner_b = "org_lab:member_b"

session_a = client.create(user_id=owner_a, toolkits=["github"])
attempt = session_a.authorize("github")

print(f"Open this Connect Link: {attempt.redirect_url}", flush=True)
account = attempt.wait_for_connection(60)

# For this local example, retain the account returned by A's attempt.
# A deployed callback must verify attempt, account owner, and current status.
ownership = {account.id: owner_a}

def read_profile(authenticated_owner: str, account_id: str):
    # In production, derive authenticated_owner from the server session
    # and load this mapping from the application's database.
    if ownership.get(account_id) != authenticated_owner:
        raise PermissionError("Connected account does not belong to caller")
    return client.tools.proxy(
        user_id=authenticated_owner,
        connected_account_id=account_id,
        endpoint="/user",
        method="GET",
    )

response = read_profile(owner_a, account.id)
if response.status != 200:
    raise RuntimeError(f"Provider request failed: status={response.status}")

print(json.dumps({
    "case": "owner_read",
    "status": response.status,
    "login": response.data.get("login"),
}))

try:
    read_profile(owner_b, account.id)
except PermissionError as exc:
    print(json.dumps({
        "case": "cross_owner_read",
        "blocked_by": "application",
        "error": str(exc),
    }))
else:
    raise AssertionError("Application ownership guard failed")

session_b = client.create(user_id=owner_b, toolkits=["github"])
print("Created B's separate session; provider isolation remains a live test.")

Run it with:

python review_auth.py

Illustrative output - not captured from a live execution:

Open this Connect Link: https://connect.composio.dev/link/ln_example
{"case": "owner_read", "status": 200, "login": "throwaway-review-account"}
{"case": "cross_owner_read", "blocked_by": "application", "error": "Connected account does not belong to caller"}
Created B's separate session; provider isolation remains a live test.

Our provider request contains a Composio key, owner ID, account ID, path, and method. It contains no GitHub token. The proxy response exposes provider status, headers, and data.

We would next exercise B through the session execution path and verify that A's private account cannot be resolved or used. Creating B's session alone does not prove that property.

Separately, in the disposable project, we would test direct proxy owner mismatches with project 2FA enabled and disabled, recording responses without printing credentials.

For deployed onboarding, we would persist the connection attempt and return the Connect Link immediately rather than hold an HTTP request open for consent. On callback, we would verify the attempt, signed-in owner, returned account, and current connection status. Callback query parameters are not authorization evidence.

Deployment Risks and Evidence Gaps

Our review exposed several deployment blockers. These are contract and evidence gaps, not invented incident reports.

Email-derived userIDs can map distinct users to one identity

We reject email as the connection owner key. Emails change, aliases normalize differently, and addresses can be reassigned. Two distinct application principals mapped to the same string become the same Composio identity within a project.

For example, if a former employee and a replacement employee both map to o**@example.com, the integration has lost the distinction between them. That is an application identity collision, not proof that Composio leaked between two distinct user IDs.

Our owner format is an immutable tenant/member tuple, such as org_42:user_7. We derive it after authenticating the request and checking workspace membership. We never accept it from model output or a browser parameter.

We found no supplied live trace demonstrating email-derived leakage. We treat this as a concrete failure mechanism to test, not an observed vendor defect.

Direct Proxy Execute is not equivalent to a scoped session

This is our largest security concern. For private accounts, we cannot rely on merely passing user_id to direct Proxy Execute: the reviewed contract ties its owner check to project 2FA. Our backend must authorize the selected account before calling the proxy.

We also treat a project key as broad execution authority within its permitted operations. It can act for different user IDs in that project; those IDs are not independently authenticated customer identities.

Shared connections require a separate design. Their access lists are checked independently of project 2FA, sharing is explicit, and session use requires pinning. We would not use experimental sharing as a shortcut around our tenant ownership model.

Refresh is managed; reconnect remains product work

We distinguish an expiring access token from an unusable refresh grant. Our integration can delegate supported access-token refresh to Composio. If the refresh token expires or is revoked, the authentication lifecycle moves the connection to EXPIRED and requires reconnecting.

We would subscribe to composio.connected_account.expired, mark the account unavailable, and offer a new Connect Link to its verified owner. We would also handle failures synchronously. An expiration webhook cannot be the only protection against a request racing with revocation.

GitHub profile access does not establish Google refresh behavior. We would run refresh and revocation acceptance tests against each provider and grant type we intend to ship.

A 429 does not imply an automatic execution retry

We separate SDK metadata reads from provider executions. We would design our production recovery logic around the SDK's retry boundary: reads are retried on timeouts and HTTP 408, 409, 429, and 5xx responses, while tool execution and proxy calls are not automatically retried.

Composio's backend does not deduplicate executions. We have not independently tested these retry paths. We interpret β€œsent once” narrowly. It is not an exactly-once side-effect guarantee.

For proxy calls, we would inspect the returned provider status and headers and also handle SDK or transport exceptions. We do not assume every native tool surfaces provider throttling in an identical envelope.

Our backoff policy would:

  • Distinguish Composio throttling from provider throttling.
  • Track budgets by provider, OAuth app, account, and operation where applicable.
  • Honor usable provider retry headers.
  • Apply bounded exponential backoff with jitter only where repetition is safe.
  • Reconcile ambiguous writes before retrying.

We have no verified per-tool thresholds or captured 429 responses. Shared managed OAuth quotas are a capacity risk, not a measured concurrency ceiling.

Trigger delivery guarantees remain unverified

We could verify the instruction to test a deployed HTTPS webhook, parse events with the SDK, and map them to the correct environment and owner. We could not establish delivery retry schedules, ordering guarantees, deduplication behavior, or replay windows from the supplied material.

Our receiver would verify authenticity, durably enqueue accepted events, and make downstream processing idempotent. We would test duplicate delivery, delayed delivery, receiver downtime, and replay before enabling consequential actions. We would not promise at-least-once delivery without a verified contract.

This is the same side-effect discipline we apply in our Restate recovery review.

Token redaction does not prevent Composio from accessing credentials

In Composio Cloud, Composio holds encrypted credentials and its execution service decrypts them to authenticate provider requests. AES-256-GCM at rest and API-response redaction do not mean the service cannot access usable credentials.

Our application does not receive raw tokens through supported connected-account reads. Owning the OAuth app does not change that custody boundary or create a supported token-export path.

We cannot establish individual employee access rights, approval procedures, or privileged-access auditing from encryption details alone. Those require security-review evidence.

We also account for business data: tool arguments and results are stored in execution logs by default. Zero Data Retention has coverage limits and does not change credential custody. BYOC changes deployment location; customer-managed keys introduce a different decryption boundary. We would review operator permissions, backups, and outbound access for either arrangement.

Scale, Latency & Cost vs. Alternatives

We have no measured latency percentiles, throughput ceiling, or memory profile for this integration. We expect an additional hosted execution path compared with direct provider calls, but we cannot quantify the added latency without measurement. We would measure connection setup separately from steady-state reads, refresh activity, throttling, and reconnects.

Approach What we delegate What we still own Main trade-off Composio Cloud, managed OAuth OAuth app setup, credential storage, supported refresh, execution Identity, ownership, retries, reconnect UX, event processing Fast integration; shared app quotas and vendor custody Composio Cloud, custom OAuth app Credential storage, supported refresh, execution OAuth registration and approval, scopes, product authorization More branding and quota control; same Cloud token custody Direct provider SDKs with our vault Provider HTTP implementation to SDKs OAuth flows, token lifecycle, storage, isolation, operations Maximum control; larger engineering burden Self-hosted integration platform Varies by platform and connector Hosting, upgrades, key access, connector validation,

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.