Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(cli): enforce the consumer permission gate on `composio proxy` (#5093)
## Summary `composio proxy` sends side-effecting toolkit calls through a consumer Tool Router session, but it never ran the permission gate that `composio execute` runs. On an enhanced-controls project, the org's `ask_every_call` / `ask_once` / `always_deny` policy did not apply to proxied calls. Refs [PRDE-1702](https://linear.app/composio/issue/PRDE-1702/investigate-cli-get-session-api-credential-exposure). ## What changed - `composio proxy` runs `gateToolExecution` after the session resolves and before `proxy_execute` is sent. - The gate is keyed on the connected account the session uses, read from the resolved session (`connectedAccounts[toolkit]`) the same way the execute path does. That is the `--account` pin when given, otherwise the default account the session selects. - Denials and approval prompts are the same as `composio execute`: `ToolPermissionDeniedError` for `always_deny` (or when prompts are disabled), the localhost approval page for `ask_*`. Policy keys that apply to a proxied call: the project default, `*:<account>`, and `<toolkit>:<account>`. Per-tool overrides (`GMAIL_SEND_EMAIL:<account>`) name catalog tools, and a raw HTTP call through the proxy is not one, so they don't apply here. Use an account-wide override or the default to restrict proxy access. ## Test `proxy.cmd.test.ts`: default `allow_all`, override `*:con_gmail_work → always_deny`, no `--account`. The session pins `con_gmail_work` by default, the command fails with `ToolPermissionDeniedError`, and `proxy_execute` is never called. The test fails if the gate is keyed on the `--account` selection instead of the session's account. ## Checks - `pnpm typecheck` (repo root) - `pnpm --filter @composio/cli run lint:effect`: 0 diagnostics - `pnpm --filter @composio/cli test`: 209 files, 2374 tests passing