Skip to content

Decision: should a coding agent be able to ask to add its own AI subscription over MCP, and what must be settled first? #4931

Open

Description

@yannickmonney

Summary

The owner decided on 2026-10-08 that a coding agent connected to Tale over MCP can ask to add a member's own AI subscription (Claude, ChatGPT, Gemini, Nous Portal) to the organization: org-wide, pending until the member confirms in Tale with a fresh sign-in, admins notified, the row tagged with who contributed it and disabled when they leave, and a vendor-terms notice in the confirm dialog. None of it is built. This issue collects what has to be settled before it is, because two items are for the owner and for legal to answer and a few change how serving works.

Anchors are at main da3b98b730 (2026-10-13). Statements about vendors come from the design pass of 2026-10-08 and were not checked again for this issue.

What is on main

  • Four harnesses declare a subscription: block: claude-code, codex, gemini, hermes (configs/platform/system/harnesses/<slug>/harness.yml).
  • A person can add a pasted Claude OAuth token as a subscription key in Settings › AI providers (feat(platform): add a pasted Claude OAuth token as a subscription key #4369). The AI gateway service pools Claude and ChatGPT subscriptions (feat(ai-gateway): pool Claude and ChatGPT subscriptions #3452).
  • Nothing lets an agent ask for one: there is no pending-link table and no add_subscription tool (git grep finds the names only in a test that guards the server instructions, services/platform/lib/mcp/instructions.test.ts).
  • The MCP inventory is at 39 tools and a guard allows at most 40 (services/platform/lib/mcp/tools.test.ts:548-558).

What the design pass proposed

  • A coding agent can only ask; a person adds. Every call creates a pending link, never a credential; nothing serves until the person confirms in Tale with a sign-in younger than 10 minutes; a link expires after 15 minutes.
  • Four lanes, human lanes preferred: the person pastes on Tale's confirm page; the person drops a file on it (Gemini, maybe Hermes); for Codex, Tale runs OpenAI's device sign-in itself and shows the one-time code on the confirm page; or the agent passes the credential in the call (allowed for static cases, stored encrypted in the pending link only, flagged "sent through your agent's conversation", refused for Codex).
  • Codex gets a platform-owned path: Tale holds the ChatGPT access and refresh tokens, refreshes under a row lock and hands Codex the access token only. Importing a Codex auth.json was rejected (OpenAI asks for one file per runner; refresh rotation would sign the person's own CLI out).
  • Claude is paste-only (claude setup-token): Tale never runs Anthropic's OAuth.
  • Serving: a confirmed subscription is pooled for agent turns of its harness (chat, model steps, vision and speech never read the pool); an organization with no pooled row behaves exactly as today.
  • Offboarding: when the contributor is removed or disabled, the row is disabled and its ciphertext erased.
  • Everything audited with who asked and through which door; admins notified on request, confirmation and every system disable.

What is open

  1. Legal (the owner's call). The consumer terms of the subscription vendors restrict how a login or credential may be shared, and using one person's subscription for the whole organization is the case they were not written for. The owner chose org-wide use with a notice in the confirm dialog; the design pass recommended a legal review of that notice and of the feature itself before release, and, later, an optional "only my runs" switch on a row. Nothing here has been reviewed by a lawyer.
  2. The vendor-terms notice copy for every provider needs owner or legal sign-off before the confirm dialog ships.
  3. Precedence. A pooled subscription serves an agent turn before the provider's API-key default for its harness, or only when nothing else serves.
  4. Hermes. If no stable credential exists for Nous Portal: drop its subscription delivery, or build a Tale-owned sign-in profile (Nous documents only a loopback sign-in).
  5. Who contributes. Owner, admin or developer (the credential-admin rule today), or plain members too.
  6. Agent-supplied credentials. Whether an admin may confirm a link whose credential the agent supplied, or only the requester.

Options for how to proceed

  • Wait for the legal answer, then build everything.
  • Build the lanes where a person supplies the credential (paste, file, device sign-in) and leave "the agent passes the credential" out until it has been reviewed.
  • Build everything behind a switch that is off, and decide the copy and the legal question before turning it on.

Constraints

Related

#4930, #4369, #3452

Activity

  1. added
    priority: medium
    needs discussion
    improvement
    service: platform
    on Oct 13, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Build it behind two switches that are off by default, with only the lanes where a person supplies the credential. The lane where the agent passes the credential is never built, and no sandbox ever receives a refresh token.

    The rule

    • A coding agent only asks. It sends apply_settings a subscription provider credential, and when both switches are on, the call returns a pending agent request (the Improvement: let a coding agent change the other 22 pages of Settings, with a person finishing what needs a secret #4930 concept) with a confirmUrl. The agent polls get_agent_request, which takes the 40th and last tool slot. There is no add_subscription tool.
    • Switches: the deployment variable TALE_SUBSCRIPTION_REQUESTS (unset = off) and an organization policy "Owners, admins and developers may contribute their own AI subscriptions" (default off). If either is off, the call is refused with USE_SUBSCRIPTION_FLOW, as today. The same switches gate a new "this is my own subscription" option in Settings › AI providers. Company credentials are entered as today.
    • A request holds no credential and expires after 15 minutes. Each person can have one open request per provider, with a rate limit. Only the requester can confirm, after a sign-in in the last 10 minutes (/reauthenticate renews it). Admins are notified on request, on confirmation, and on every disable. Every step is audited.
    • Lanes: Claude by paste of claude setup-token; Nous Portal by paste of a static key; Codex by a device sign-in that Tale runs; Gemini by dropping oauth_creds.json. For Codex and Gemini, Tale keeps the refresh token and hands the harness only a short-lived access token.
    • A confirmed subscription is a credential row tagged with its contributor and used org-wide. The contributor can withdraw it at any time. It is disabled and its ciphertext erased on withdrawal, or when the contributor is removed, disabled or drops below developer.

    Answers

    1. Legal: this is the owner's and legal's call, including Tale running the vendors' sign-in and refresh under their CLI clients. The switches stay off in deployments Tale operates until the owner signs off.
    2. Notice copy: one string per provider in en/de/fr, drafted and marked as pending sign-off. A provider without a notice cannot be confirmed.
    3. Precedence: no change. API-key and env credentials come first, and a subscription is preferred only when an admin makes it the default.
    4. Hermes: paste of a static key only. A plan without one is refused with a hint.
    5. Who contributes: owners, admins and developers.
    6. Agent-supplied credentials: dropped. Only the requester confirms.

    Why
    No secret passes through an agent's conversation. A row serves the whole organization, so anything in the sandbox can be read by any member's prompt-injected turn. Keeping refresh tokens on the platform keeps that exposure to a short-lived access token, never the contributor's whole Google or OpenAI account. A contributed row is defined by its tag, not by the door that created it, so the Settings door cannot sidestep the switches, the notice or offboarding. Today's precedence stays, so no billing route or data path changes silently. One agent-request lifecycle with one polling tool stays within the 40-tool budget.

    Implementation units (all on main)

    1. Agent-request foundation, shared with Improvement: let a coding agent change the other 22 pages of Settings, with a person finishing what needs a secret #4930 (whichever lands first builds it), with the cap on open requests and the rate limit (L).
    2. Contributor-tagged rows, withdrawal and offboarding (M).
    3. Deployment switch and organization policy (S).
    4. Subscription request kind: Claude and Nous paste lanes, the Settings "my own subscription" option, the notice component, and MCP-R36 rewritten (L; needs 1-3).
    5. Codex device sign-in with refresh held by the platform (L; needs 4).
    6. Gemini file drop with refresh held by the platform and access-token-only staging (M; needs 5).

    Before release: owner and legal sign-off on org-wide use, on each provider's notice copy, and on Tale running the vendors' sign-in and refresh flows.

    Cross-issue amendments (decisions taken together with #4930):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementneeds discussionpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions