Skip to content

Turn on coding-agent sign-in and narrow Codex's scopes - #4926

Merged
yannickmonney merged 5 commits into
mainfrom
feat/agent-signin-docs
Oct 13, 2026
Merged

yannickmonney merged 5 commits into
mainfrom
feat/agent-signin-docs

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What

The operator side of coding-agent sign-in (O‑S6): a person can connect Claude Code, Codex, Cursor and the like by signing in from the agent, with nothing to configure — and what the real Codex CLI asks for is no longer refused.

  • Codex was refused. Codex registers and signs in asking for openid profile email tale:organization … beside the agent scopes, and the endpoint answered invalid_scope (an agent connection never holds an identity scope). It now narrows instead of refusing: at registration (RFC 7591 §3.2.1 lets a server register a client for a subset; with nothing left the provider's own agent scope set applies) and at authorization, the scopes the endpoint does not grant are dropped, never granted, and the consent page offers the agent scopes alone. An agent that asks for identity scopes alone asks for nothing the endpoint grants and is still refused (invalid_scope). Rule AGCONN‑R25.
  • On by default. TALE_MCP_CLIENT_METADATA_DOCUMENTS and TALE_MCP_DYNAMIC_CLIENT_REGISTRATION are on unless set to false (a malformed value is still refused at boot). Both false returns to API keys alone: the discovery documents go quiet and the access tokens of agents already connected are refused.
  • API contract 3.44.0. The OpenAPI document gains the agentOAuth security scheme (authorization code with PKCE, the seven scopes) beside the API key, on the MCP operation alone. Its scope descriptions are keyed by the shared scope list, so a scope the endpoint starts to grant cannot be left out; a spec test pins the scopes, the sign-in server's authorize/token paths, the resource document it names, the refresh lifetime and "the MCP operation alone".
  • Operator docs (EN/DE/FR). Environment reference (both rows, default true); Authentication (new Coding-agent sign-in section); TLS and domains (the .well-known documents live at the host root, with a path table for a reverse proxy); Hardening (what to check before leaving it on: hosted agents' reachability with Anthropic's published range linked, outbound HTTPS to an agent's metadata host, who may connect, the limits on self-registration).
  • The manual layer (AUTH-F34, SET-B38, reference/automation.md) says "on by default"; the French strings say "agent de code" (the glossary term) instead of "agent de programmation".

Proof

  • Gate on the committed tree (pinned bun 1.4.2): format, conflict markers, links, manual (1787 boxes), knip, oxlint type-aware, tsc (platform + shared); @tale/shared 958; platform server+pii 88,962 (19 skipped); platform UI 7,898; docs 713.
  • Real Postgres: the five agent lanes (checkAgentOAuth, checkAgentConsent, checkAgentDoor, checkAgentConnections, checkAgentLifecycle) 125/125 at the new defaults, including an agent that registers with identity scopes, one that asks for every listed scope (consent for the agent scopes alone) and one that asks for identity scopes alone (refused).
  • Real clients on a live local stack (own database, defaults untouched):
    • Codex CLI (codex mcp add, then codex mcp login --no-browser): fetched its client metadata document from chatgpt.com, was sent to consent, got its token, and its stored credential listed 39 tools over MCP. This run is what found the refusal above.
    • A stand-in agent walked discovery → registration → consent → a call its access does not cover (refused) → refresh → disconnect.
    • Claude Code reaches "Needs authentication" from the endpoint's 401 challenge. Finishing its sign-in needs its interactive /mcp, which I could not script here, so it is not verified end to end.
  • Mutation round: 20 mutants of the narrowing, the on-unless-false switch, agentSignInOn and the OpenAPI scheme. 19 were killed at once; the survivor (the sign-in step rewriting the scope of an agent that asks for identity scopes alone) is now held by a unit test, a flow test against the real provider and a lane check, and dies.

Not here / owed

  • The user docs (the MCP endpoint page, Use Tale from your editor, the Connected agents admin page with its screenshots) are the next PR; until it lands those pages still describe API keys only.
  • Release notes, for the release manager: Upgrade note — coding-agent sign-in is now on by default. Set both variables to false to keep agents on API keys. Check that the .well-known paths reach Tale and that the backend can fetch an agent's metadata document (outbound HTTPS) before leaving it on.
  • Not verified with other clients (Cursor, VS Code, Gemini CLI, claude.ai): manual boxes in tests/manual/suites/auth.md.

…more

Codex asks for every scope the sign-in server lists, identity scopes
included, and was refused with invalid_scope, so it could not sign in.
An agent's authorization request, and a self-registration, now keep the
scopes the MCP endpoint grants (the agent scopes and offline_access) and
leave the rest out, as RFC 6749 and RFC 7591 allow. The consent page
offers exactly those, the connection holds only those, and an agent is
never granted an identity scope.

AGCONN-R25 states the rule. Found by signing the real Codex CLI in
against a local stack.
The glossary and the rest of the product call a coding agent "agent de
code"; the consent page, the connected agents page and their notices said
"agent de programmation".
… off

TALE_MCP_CLIENT_METADATA_DOCUMENTS and TALE_MCP_DYNAMIC_CLIENT_REGISTRATION
now default to on. A person can connect Claude Code, Codex, Cursor and the
like by signing in from the agent; the discovery documents answer, the
consent page and the Connected agents page are live, and an API key keeps
working. Setting both to false returns to keys alone and refuses the access
tokens of agents already connected.

API contract 3.44.0 names the change, and the OpenAPI document gains the
agentOAuth security scheme (authorization code with PKCE, the seven
scopes) beside the API key on the MCP endpoint. The self-hosted pages say
what a deployment must provide: the well-known documents at the host root,
outbound HTTPS to the agent's metadata host, the limits on
self-registration, and what to check before leaving it on (hosted Claude
reachability, egress, who may connect), in English, German and French.

Verified by signing the real Codex CLI in against a local stack (client
metadata document from chatgpt.com, consent, token, tools/list) and a
stand-in agent through discovery, registration, consent, a refused tool,
refresh and disconnect.
An agent that asks for identity scopes alone asks for nothing the endpoint
grants. A mutation round showed nothing held the sign-in step in front of
the provider to leaving that request as it came: it could rewrite the
scope to an empty one, and the provider would never see what the agent
sent. The unit test now holds the scope as sent; the flow test against the
real provider and a lane check hold the answer to `invalid_scope`; the rule
card says so. The flow test also holds Codex's ask-for-everything request
to a consent for the agent scopes alone.
The agentOAuth scope descriptions are keyed by the shared scope list, so a
scope the endpoint starts to grant cannot be left out of the document. A
spec test pins the scopes, the sign-in server's authorize and token paths,
the resource document it names, the refresh lifetime it issues and that the
MCP operation alone takes the scheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant