@devries-cameron20 / composio Mirror · read-only / commits / 1db88b00e
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 22:15 UTC

docs(cli): annotate why the schema-bypass cast is safe at degrade points

The `as ConnectedAccountListResponse` cast in the `catchTag` fallback of three commands (`connected-accounts.list.cmd.ts`, `connections.list.cmd.ts`, `connections.remove.cmd.ts`) lies about the schema brand to render a payload that just failed `decodeUnknown`. The existing comment block explained _why we degrade_, but not _why the cast is safe enough_. Add a one-line per-site note recording that downstream renderers / selectors only read whitelisted, non-credential-bearing fields (`id`, `alias`, `word_id`, `toolkit.slug`, `status`, ...) — `state` and `data` are never indexed, so an unvalidated raw payload cannot leak tokens through this path. Surfaced by kieran-typescript review of PR #3344 (P3#3).

jkomyno committed May 7, 2026 at 10:55 UTC 1db88b00e814776cb21360c7909733da9d0bbfd0
3 files changed +12
ts/packages/cli/src/commands/connected-accounts/commands/connected-accounts.list.cmd.ts
+5
@@ -104,6 +104,11 @@ export const connectedAccountsCmd$List = Command.make(
104 `the latest schema. Continuing with raw response.\n\n` +
105 `Decode error: ${error.message}`
106 );
107 + // Cast lies about the schema brand, but the downstream formatters
108 + // (`formatConnectedAccountsTable`, `formatConnectedAccountsJson`)
109 + // only read whitelisted fields — credential-bearing `state` /
110 + // `data` are never indexed, so the unvalidated raw payload is
111 + // safe to render as-is.
112 return rawResult as ConnectedAccountListResponse;
113 })
114 )
ts/packages/cli/src/commands/connections/commands/connections.list.cmd.ts
+3
@@ -85,6 +85,9 @@ export const connectionsCmd$List = Command.make('list', { toolkit }, ({ toolkit
85 `the latest schema. Continuing with raw response.\n\n` +
86 `Decode error: ${error.message}`
87 );
88 + // Cast lies about the schema brand, but `formatConnectionsJson`
89 + // only reads `status`, `alias`, `word_id`, `toolkit.slug` — the
90 + // unvalidated raw payload is safe to render as-is.
91 return rawResult as ConnectedAccountListResponse;
92 })
93 )
ts/packages/cli/src/commands/connections/commands/connections.remove.cmd.ts
+4
@@ -121,6 +121,10 @@ export const connectionsCmd$Remove = Command.make('remove', { account }, ({ acco
121 `the latest schema. Continuing with raw response.\n\n` +
122 `Decode error: ${error.message}`
123 );
124 + // Cast lies about the schema brand, but `resolveAccount` and
125 + // `formatAccountSummary` only read `id`, `alias`, `word_id`,
126 + // `toolkit.slug`, `status` — credential-bearing `state` / `data`
127 + // are never indexed, so the unvalidated raw payload is safe.
128 return rawResult as ConnectedAccountListResponse;
129 })
130 )