Skip to content

Automatic-mode grants get a 403 on the approval page for person-only (human()) tool approvals #121

Done

Description

@shuv1337

Problem

A tool with human() approval cannot be approved from a grant whose approval mode is automatic. The person opens the approval link while signed in as the grant's owner and gets "Cannot open this request: Your account cannot review this request" (HTTP 403).

Bare /mcp URLs now preselect Automatic on the sign-in page, so this affects most new connections that call person-only tools.

Cause (v2 at b51071a)

  1. preselectedApprovalMode turns the URL's implied model into automatic (packages/ui/src/implementation/dashboard/mcp-consent.tsx:321-322), so the grant is stored with target.mode: "automatic".
  2. An automatic-mode run is stored under callerIdentity(product, "automatic") (packages/mcp/src/implementation/server.ts:190).
  3. When a person-only approval pauses the run, personLink (server.ts:222-227, applied for every toolkit at 341/350/381) builds the approval link with mode: "model".
  4. The approval page allows mode=model only for grants whose mode is "model" (apps/hosted/server/src/implementation/mcp-approvals.ts:99-103). The check fails and returns 403 without logging anything.
  5. Even if that check passed, the page looks up the request under callerIdentity(product, "model") (server.ts:460-462), which doesn't match the automatic identity, so it would show the request as unavailable.

No test covers automatic mode together with a human() approval.

Fix

  • Give automatic grants a person link the page accepts, and look the request up by the grant's actual mode. For example, resolve the page identity from access.grant.target.mode, or widen BrowserApprovalAddress.mode to include automatic.
  • Add tests for an automatic grant calling a human() tool, covering both GET and POST on the approval page, plus the 403 for a grant owned by someone else.
  • Consider logging a reason code when the approval page returns 403. Today a refusal there leaves no trace in the logs.

Workaround

Reconnect the client and choose "Through your agent" (model mode) on the sign-in page.

Found through an app on the hosted instance (approve_inbox_item in an apps-repo app).

Activity

  1. shuv1337 commented on Nov 23, 2026

    @shuv1337
    OwnerAuthor

    Live check passed on production 23ced752 (PR #122, deployed 14:28 PST Nov 23). A real human() approval raised on an Automatic-mode OAuth connection opened on the approval page for its owner and was approved there; it no longer returns 403. The user confirmed the working link.

    CI: #124's run 45279095903, the first fork-ci run since GitHub disabled workflows on the fork, passed on v2 with this fix (check, native, and security-e2e including both person-approval scenarios).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions