Skip to content

verify_agent_authorization: origin-only authorized_agents entries match any path under AdCP 3.3 #1908

Open

Description

@bokelley

Problem

AdCP 3.3 changes how an authorized_agents[].url entry in adagents.json matches an agent (DR-0023, documented by adcontextprotocol/adcp#8939):

  • Origin-only entry: an entry whose canonical form has the root path and no query (https://agent.example.com or https://agent.example.com/) authorizes the agent at that origin, whatever its path. For example, it authorizes https://agent.example.com/mcp.
  • Entry with a path: it still matches that canonical URL only.

verify_agent_authorization (src/adcp/adagents.py) still uses exact matching. Under 3.3 it will refuse agents that the server and the TypeScript SDK accept.

Counterparts

Ask

Match those two PRs:

  • Scope: apply origin-only matching only when 3.3 or later is negotiated or targeted. 3.2 and earlier keep exact matching.
  • Canonicalization: use the shared AdCP rules on both sides: lowercase the scheme and host, drop default ports, remove dot segments and fragments, and decode unreserved percent-encoding.
  • Not origin-only: an entry with a query, even an empty ?.
  • Userinfo: a URL carrying user:pass@ matches nothing.
  • Trailing root dot: remove one trailing dot from a DNS host. A host with two or more trailing dots matches nothing.
  • Supply-path verification: stays exact until 4.0.

One open point is being settled on adcontextprotocol/adcp#9011: what happens when an exact entry and an origin-only entry both match one agent. Follow whatever that PR settles on.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions