AUDIO

Listen to this page

0:00
Chapters

    composio — actions inside online SaaS apps

    A pre-built plugin that gives the assistant hands inside 1000+ online apps (gmail, google_calendar, slack, github, notion, todoist, spotify, linkedin, …) through the Composio platform. The agent picks a toolkit, finds the exact tool for the task and runs it — the OAuth handshakes and token storage live on Composio's side, the home only keeps API keys.

    Identities — one project per person

    A Composio API key belongs to one project, and everyone who holds it can reach every connected account inside that project. The plugin therefore routes each caller to their own identity:

    • Members (user/admin/kid) may store their personal API key (their own Composio project) on the plugin page — tool calls then use their key and their own connected accounts under the composio user id holai-<userId>, so nobody's gmail/drive is reachable through somebody else.
    • House key (env COMPOSIO_API_KEY) is the fallback for members without a personal key. It is optional, and the admin can turn the fallback off (policy deny) so a member with no key of their own gets no Composio tool access at all.
    • Guests never touch member or house identities. They run only what the separate guest identity allows: its own API key (own project), accounts curated by the admin under the composio user id composio-guest, and an allowlist of tool slugs guests may run. Typical setup: a dedicated least-privileged Google account that has exactly ONE document shared (the feedback doc) — Google's sharing is what restricts it to that doc; Composio connects whole accounts, not single documents — and an allowlist holding only the docs-append tool.

    Per-caller identity is possible because the core passes the invoking user into the tool ctx (ctx.user, see plugins-api).

    How it works

    • The plugin is a thin shell around the official @composio/core SDK (dependency of the npm package; declared in the plugin's package.json, installed on plugin install).
    • The SDK is ESM-only and needs node ≥ 22 — the core image ships node 22 accordingly. It is loaded lazily (import()), warmed up once at startup (warmup()), so the first voice request does not pay for the import.
    • COMPOSIO_BASE_URL (env store / process env) points the SDK at another backend — used by the offline test and by self-hosted setups.
    • Keys live in the central db (ctx.sqlStore) — one masked-view key suffix, never another member's; every connected-account operation is caller-owned (a member can only remove accounts visible in their own identity).

    Setup

    1. Install the plugin (marketplace or Plugins screen; the local folder server/plugins/composio/ is the source of truth).
    2. House key (optional): create a Composio account → copy the API key (composio.dev → Settings → API Keys) → dashboard → Settings → Env variables → COMPOSIO_API_KEY = <key>. This is only the fallback for members; guests never use it.
    3. Members: each person creates their own (free) Composio project, copies the API key and saves it in the plugin page's Your Composio key panel, then connects their toolkits for holai-<userId>.
    4. Guest feedback: create a second project for the guest identity → save its key + allowlist in the admin Identities panel; in Google share the one feedback doc with a dedicated Google account and connect that account for the guest identity.
    5. Without a key for the caller everything degrades to actionable hints instead of failing.

    Admin page (#/pui/composio)

    • Your Composio key — the signed-in member's own key (save/remove) plus an "acting as" line showing which identity tool calls resolve to (own key / house key / guest identity) with the masked key.
    • Identities (admin) — house key state + fallback policy (allow/deny), member identities added as user id + key pairs, and the guest identity (key kept when the field is left empty, allowlist as comma-separated slugs).
    • Connected toolkits — accounts of the VIEWER's identity with their Composio status (ACTIVE connections are the ones tools execute).
    • Available toolkits — Composio's most-used toolkits (usage-sorted) as clickable chips with a filter box; the same list powers the connect field's autocomplete. Other slugs still work.
    • Connect a toolkit — creates a Composio auth link for the viewer's identity (admin for the house/guest view; a member connects their own) and polls until the account appears. Guests cannot connect by themselves — the admin curates the guest accounts.

    The composio tool

    POST /api/v1/tools/composio — every action first resolves the CALLER's identity (ctx.user); the calls run against that identity's key and composio user id:

    action args what
    kits — connected toolkits of the caller's identity with their status — call first when unsure what is available
    find search, optional toolkit, limit (1–20, default 6) search the connected toolkits' tools and return slug, name, description and the parameter schema (required/optional keys); guests only see allowlisted slugs
    run tool (slug from find), args (matching the schema) execute the tool through the SDK's direct execution path (session-style latest versioning); for guests the slug must be in the guest allowlist

    Typical agent flow: find {search:"send email"} → pick GMAIL_SEND_EMAIL → run {tool:"GMAIL_SEND_EMAIL", args:{...}}. The run result is quoted from Composio's own data payload; failures surface Composio's error text (truncated to 400 chars).

    Routes (plugin page backend)

    Method/Path Role What
    GET /api/v1/plugins/composio/status user the caller's resolved identity (source, masked key, policy, allowlist)
    GET /api/v1/plugins/composio/my-key user own member identity state
    PUT /api/v1/plugins/composio/my-key user store/delete own API key ({apiKey})
    DELETE /api/v1/plugins/composio/my-key user remove own key
    GET /api/v1/plugins/composio/identities admin house state, policy, member rows, guest row (all keys masked)
    PUT /api/v1/plugins/composio/identities admin {userId, apiKey} member row, {guest:true, apiKey, allow} guest row, or {policy} switch
    DELETE /api/v1/plugins/composio/identities admin remove a member row (userId=) or the guest identity (guest=1)
    GET /api/v1/plugins/composio/accounts guest connected accounts of the VIEWER's identity (toolkit, status, created)
    GET /api/v1/plugins/composio/kits guest available toolkits — Composio usage-sorted, with the "already connected" flag
    POST /api/v1/plugins/composio/connect user {toolkit} → Composio auth link for the viewer's identity (guests refused)
    DELETE /api/v1/plugins/composio/accounts?id=… user remove a connected account — only when it belongs to the caller's identity

    Testing

    server/tests/composio.js runs fully offline against a fake Composio backend (node tests/composio.js) — it asserts which API key and which composio user id each caller's actions use, the fallback policy, the guest allowlist (refusal makes no cloud call) and route-level req.user behavior.

    Troubleshooting

    • "This Composio API key is not valid" — the key in use failed Composio's 401; check whose key it is (the plugin page shows the masked active key).
    • "No Composio identity of yours is set … (the house fallback is disabled)" — the admin set policy deny; add a personal key or ask the admin to re-enable the fallback.
    • Guests: "Composio guest access is not configured" — no guest identity exists yet; an admin adds it in the Identities panel.
    • "Guests may only run allowlisted tools" — the slug is not in the allowlist; the admin appends it (slugs uppercase, comma separated).
    • Auth links that never complete: check that the account came through in the Composio dashboard; remove the stale account here and connect again.
    • find returns nothing: the toolkit is not connected — kits shows what exists; custom auth schemes (non-OAuth toolkits) need their auth config created in the Composio dashboard first.
    • First-run 10 s tool timeouts: the SDK is huge — the plugin warms the import up at startup; a timeout right after an image build/restart meant the warmup had not finished yet, the next call is fast.

    Last updated: November 2026