Skip to content

Agent-Scoped Cookies #257

Description

@Idan-Levin

Today, a website can recognize a returning browser or user, but it cannot recognize a returning agent. If an agent comes back two or three months later, the site has no standard way to know it is the same agent and recover its preferences, memory, or agent-specific permissions.

A normal cookie is not enough because it is scoped to the browser profile and origin. If several agents use the same browser, they share the same cookie. What we need is the same idea, but scoped to the agent.

Historical context

  • #44 - Managing action-specific permissions identifies agent identity as necessary for persisting decisions such as “always allow this agent.” The discussion notes that cookies can store the state, but the site still needs a unique identifier to separate the state of different agents.

  • #54 - Challenging assumptions of identity within WebMCP asks whether agents should have their own identity instead of only inheriting the user’s identity. The discussion distinguishes between a verified agent identity and an opaque identifier that allows a site to recognize the same agent. The group deferred the broader identity question for the initial browser-agent scope.

  • #87 - Session and authentication context for tools focuses on carrying the user’s authentication and session state across tool calls. This solves “which user is logged in,” but not “which agent is acting for that user.”

  • #96 - Agent-to-tool trust connects these discussions and proposes that ModelContextClient expose browser-attested agent identity, permissions, and invocation context.

Agent-Scoped Cookies are a narrower proposal. They do not attempt to verify that an agent is genuinely Claude, Gemini, or ChatGPT. They only allow a site to recognize the same agent profile when it returns.

Proposed flow

  1. The site asks for permission to recognize the agent on future visits.
  2. The site creates an opaque Agent-Scoped Cookie.
  3. The agent client stores it for that specific origin and agent profile.
  4. The client provides it with every WebMCP interaction on that origin.
  5. The site uses it to recover that agent’s preferences, permissions, or history.
  6. The user can inspect, revoke, or reset it at any time.

Difference in scope

  • Browser cookie: origin + browser profile
  • Agent-Scoped Cookie: origin + agent profile
  • User account: origin + user
  • Session ID: one conversation or task

The identifier should never be shared across origins. Amazon and Booking should receive different identifiers for the same agent.

This provides continuity, not verified identity. For sensitive permissions or transactions, the Agent-Scoped Cookie could later be bound to a cryptographic key.

Activity

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

    beyond-scope: agents-on-the-webPertaining more to wider notions of agent identity, permissions, and harness requirements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions