Skip to content

Add class claim for grouping agent instances #22

Open
0 of 1 issue completed
Open

Description

@dickhardt

Background

AAuth's per-instance agent identity (aauth:local@domain) gives each runtime its own identifier and signing key — great for per-instance authorization, revocation, and audit. But there's no first-class way to group instances of the same product.

A user installing Planner today has to consent to each Planner instance separately. A new install or container restart triggers re-consent. There's no way to say "I trust any Planner instance from vendor.example."

Proposal

Add an OPTIONAL class claim to the agent token.

{
  "iss":   "https://vendor.example",
  "sub":   "aauth:[email protected]",
  "cnf":   { "jwk": ... },
  "class": "planner"
}

Semantics:

  • class is an opaque string defined by the AP.
  • A class is identified by the tuple (iss, class). Verifiers MUST scope all class comparisons to that tuple.
  • Comparison is exact string equality.

Where it lives:

  • Only in the agent token. NOT copied to auth tokens.

Who enforces it:

  • The PS only. PS uses class for grant matching. When a user consents at class granularity, the PS records (user, iss, class) → {scopes, ...}. Future instances of the same class match the existing grant without re-consent.

Storage is implementation choice. PSes can synthesize an internal key like https://vendor.example/planner for indexing, or use any other scheme. The wire format stays minimal.

No hierarchy. Class strings are flat. APs may use any internal naming convention but the protocol does exact equality only.

Rationale

Why class at all

Per-instance identity without a category concept means per-instance consent — too fine-grained for users in practice. Every major AI agent identity system has converged on having a class-like concept:

  • Microsoft Foundry / Entra Agent ID: agent identity blueprints "establish the category of agent through type classification" (e.g., "Contoso Sales Agent"). Each agent identity is an instance of a blueprint. InheritDelegatedPermissions lets instances inherit permissions from the blueprint to "reduce consent complexity for multi-instance scenarios."
  • Google OAuth (cross-client identity): project-wide consent — "when a user has granted access to a particular scope to any client ID in a project, the grant indicates the user's trust in the whole application."
  • Karl McGuinness's client_instance_assertion draft: separates client_id (logical class) from sub (instance).
  • Auth0, Okta, Ping: all building agent identity products with class-like categorization.

AAuth's class claim is the same pattern in our terminology: AP labels what kind of agent an instance is.

Why flat (no hierarchy)

Three reasons:

  1. No production system uses hierarchical class. Microsoft blueprints are flat. Google projects are flat. Karl's client_id is flat. A hierarchical AAuth class would put us in a club of one.

  2. Hierarchy use cases are covered by other primitives. "User consents to /planner; should cover sub-agents" — sub-agents get authorization via parent delegation, not class match. "Reject sub-agents for sensitive scope" — handled by the act != ∅ check, not class depth. "Resource policy by class subtree" — class is PS-only; resources don't see it.

  3. Implementation cost vs. benefit is poor. Hierarchy requires prefix-matching DB queries, normalization rules, depth concept, "most specific match wins" semantics. Flat equality is one query.

Why PS-only

The PS is the consent/grant authority. Class exists for consent grouping. Pushing class into auth tokens is propagating an input that's already been consumed by the only party that uses it.

Open questions

  1. Does anyone have a real cross-deployment use case for hierarchical class that the flat model can't express?
  2. When class is omitted, the PS treats the agent purely by agent identifier (today's behavior). Good?

References

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. christian-posta commented on May 7, 2026

    @christian-posta

    I went back and forth a few times in my head..... and i've landed at: I think I like it, but there are some things to check:

    Right now, an Agent Provider (AP -- formerly Agent Server) is the issuing authority for an agent instance. On its own, it can model the idea of a "class". That is, any agent issued from an AP already has a natural grouping for consent. For example the https://ap.cursor.com issues cursor agent instance tokens from this AP. They are for Cursor wherever cursor may run (web/desktop/mobile). Cursor is the "class". And claude agents could have their own AP. And OpenClaw etc.

    But using an AP to issue multiple agent classes is a very real usecase. For example, a personal AP. I run my own AP, but i want it to issue identity for multiple "types" of agents. This is where the "class" proposal comes in, I believe. Again, giving a way to group consent.

    But I think one of the scenarios we discussed is when aauth:[email protected] on behalf of ceposta hands off to aauth:[email protected] on behalf of ceposta to work on the same session. I think the class claim may not be helpful here?

    Maybe we leave it to convention where aauth:supply-chain-agent becomes the agent identity, anything after the '.' is a classifier that describes agent surface (web, desktop, mobile, mainframe, others??). consent grouped by agent identity, and just leave the classifier to influence policy decisions at runtime?

    Or with the "class" claim, i guess we'd have

    {
      "iss":   "https://vendor.example",
      "sub":   "aauth:[email protected]",
      "cnf":   { "jwk": ... },
      "class": "supply-chain-agent"
    }

    ?

  2. dasiths commented on May 8, 2026

    @dasiths
    Contributor

    Should we strive to infer the class based on the sub and introduce a convention like namespacing which allows for both this use case and also potentially sub-agents like in #23 ?

  3. dickhardt commented on May 8, 2026

    @dickhardt
    OwnerAuthor

    @christian-posta Agree that that the AP was a "class" -- what may not be clear in the text above is that we are introducing a new name space for grants. We have the agent identifier:aauth:[email protected] now, and we are adding that AP+class https://vendor.example + planning (which could be stored as https://vendor.example/planning)

    I currently have in the protocol that the agent can declare the surface (platform) of web, desktop, mobile, self-hosted, workload when it calls the PS, and include a device description -- these would mainly be to help to identify an agent in logs, summaries, grant lists.

    If the sub value is aauth:[email protected], then I think that is the agent identifier, not aauth:[email protected] -- the identifier should be relatively opaque to a verifier.

    wrt the agent with no class wanting to get a grant for any agent from a given AP when calling a PS -- the AP could always include a class, perhaps "default" -- or we could have the agent present "*" as the class when calling the PS -- the latter is slightly more flexible as the AP as parent class is always available.

    I'm going to create a new issue to discuss different surfaces accessing the same session.

  4. dickhardt commented on May 8, 2026

    @dickhardt
    OwnerAuthor

    @dasiths I think inferring the class from the sub would likely be problematic -- I prefer relatively opaque identifiers -- I'm thinking the class is only used by the PS or AS to enable granting access to agents of the same shape / class so the person does not have to grant access to each one agent individually.

    I see class and sub agents as being orthogonal concepts and serving different purposes. A class grant allows any agent from the same AP and class to have access. Sub agent allows a parent to get attenuated access for a sub agent.

    Is there a different use of class that you are thinking of?

  5. self-assigned this
    on May 8, 2026
  6. dickhardt commented on May 8, 2026

    @dickhardt
    OwnerAuthor

    @mcguinness thoughts?

  7. dickhardt commented on May 8, 2026

    @dickhardt
    OwnerAuthor

    There is an issue with mulit-tenant APs -- an agent with a class can act for any tenant with the scope -- which is not what a tenant of the AP wants.

    Multi-tenant APs: add tenant to scope class grants

    Class as defined here works cleanly when the AP is per-user or per-tenant (alice.vendor.example, customer.vendor.example) — iss is enough to scope the grant. It does not work for genuinely multi-tenant APs (vendor.example serving everyone): Alice's aauth:[email protected] and Bob's aauth:[email protected] both match (iss=vendor.example, class=planner), and the PS has no way to tell them apart without per-instance enrollment — which is the friction class is meant to remove.

    The fix is to add an OPTIONAL tenant claim to the agent token. This doesn't break the AP-knows-nothing-about-users property: tenant is something the AP already manages publicly (orgs, customer accounts, billing scopes).

    Shape

    {
      "iss":    "https://vendor.example",
      "sub":    "aauth:[email protected]",
      "cnf":    { "jwk": ... },
      "classes": [ "planner", "research"],
      "tenant": "acme"
    }

    Grant types

    The PS already scopes everything to the person, so grants within a person's PS state come in three shapes:

    • agent_id — per-instance grant (today's behavior)
    • (AP, class) — class grant for per-user / per-tenant APs
    • (AP, class, tenant) — class grant for multi-tenant APs

    Net delta to the proposal

    • Add OPTIONAL tenant claim to the agent token, semantics by reference to the existing auth-token claim and OIDC.Enterprise.
    • Define class grant key as (AP, class) or (AP, class, tenant) depending on AP topology, alongside the existing per-agent_id grant.
  8. dickhardt commented on May 8, 2026

    @dickhardt
    OwnerAuthor

    Class token: separate AP-signed artifact, presented only to the PS

    With earlier proposals, we were leaking the tenant and classes to the resource ...

    Reworking the proposal to keep class and tenant out of the agent token entirely. The agent token stays exactly as it is today — no class, no tenant, no leakage of routing metadata to resources.

    Class becomes a separate AP-issued artifact: the class token.

    Shape

    A class token is an AP-signed JWT carrying:

    • iss: the AP's URL
    • agent: the agent identifier (aauth:local@domain) this class token is bound to
    • class: a single class string (opaque, AP-defined)
    • tenant: OPTIONAL, scopes the class to a tenant for multi-tenant APs (semantics per existing auth-token tenant claim and OIDC.Enterprise)
    • standard iat / exp
    {
      "iss":    "https://vendor.example",
      "agent":  "aauth:[email protected]",
      "class":  "planner",
      "tenant": "acme"
    }

    The AP issues one class token per class the agent is permitted to activate. An agent that belongs to multiple classes gets multiple class tokens.

    Presentation

    The agent OPTIONALLY presents a class token when calling the PS token endpoint. Agents that don't use class don't present one — today's per-agent_id flow is unchanged.

    When presenting, the agent picks the class token for whichever class it is operating as. The PS:

    1. Verifies the class token signature against the AP's JWKS.
    2. Verifies class_token.agent matches the agent identifier of the presenter.
    3. Looks for a matching grant: (AP, class) or (AP, class, tenant).

    The PS never sees classes the agent didn't choose to activate — privacy beats the array-in-agent-token approach.

    Grant types

    The PS already scopes everything to the user, so grants within a user's PS state come in three shapes:

    • agent_id — per-instance grant (today's behavior)
    • (AP, class) — class grant for per-user / per-tenant APs
    • (AP, class, tenant) — class grant for multi-tenant APs

    What this avoids

    • Agent token unchanged → no class/tenant exposure to resources in any access mode (two-, three-, four-party).
    • No classes array → the PS only learns about the class the agent activates, not the agent's full taxonomy.
    • No new claim semantics inside the agent token → fewer cross-token-type considerations.

    Net delta

    • New artifact: AP-issued class token.
    • New OPTIONAL parameter on the PS token endpoint to carry the class token.
    • Class grant key at the PS is (AP, class) or (AP, class, tenant), alongside the existing per-agent_id grant.
    • Agent token: no change.
  9. dickhardt commented on May 18, 2026

    @dickhardt
    OwnerAuthor

    Working through this some more as I look to implement.

    I had been modeling consent to be keyed off of user+ap+class+tenant -- but:

    1. when a new agent with a class calls the token endpoint, we don't know the user given the current token and API shapes -- so we need to have to have the agent start a flow so we know which user is in context -- which defeats having a preapproved class of agents. This indicates that a class should only apply to a tenant, not a user.

    2. it is not clear there is value to an individual to have a class of agents -- would love to see use cases

    So this indicates that perhaps class best fits in a tenant concept only, where a grant is keyed off of ap+class+tenant and tenant is required.

  10. markmhendrickson commented on May 26, 2026

    @markmhendrickson

    Field report from a personal AP serving multiple agent classes.

    Picking up on your May-18 open question — "it is not clear there is value to an individual to have a class of agents — would love to see use cases" — here's one.

    I run a personal AP (ap.markmhendrickson.com, conceptually) serving ~12 daemons under a single user (me). They split into a few natural classes:

    • read-only summarizers (cotinga, morning-brief, anthus): pull from Neotoma + external feeds, write only summary entities back. Identical permission profile, identical risk surface.
    • write-back daemons (turdus, tyto, neotoma-agent): write structured entities into Neotoma based on parsed inputs. Wider scope, higher consequence.
    • action daemons (apus, formica, piculet, strix, monedula): take outbound actions (notifications, scheduled jobs, gmail triage, github harness). Each touches a different external resource.

    Today, every daemon has its own agent_grant. When I add a new summarizer, I re-consent for the same shape I already approved three times. That's the friction class is designed to remove, and it absolutely shows up at n=12 personal agents under one user.

    Where I think the May-18 tenant-only stance breaks for personal APs:

    "when a new agent with a class calls the token endpoint, we don't know the user given the current token and API shapes — so we need to have to have the agent start a flow so we know which user is in context — which defeats having a preapproved class of agents. This indicates that a class should only apply to a tenant, not a user."

    The "we don't know which user is in context" problem is real for a multi-tenant AP. For a personal AP it's not — there's only one user. The AP knows. The PS knows. The bootstrap is already user-scoped.

    One way to thread this:

    • Define class grants as keyed on (AP, class, scope_owner) where scope_owner is either a tenant or a user.
    • For multi-tenant APs, scope_owner = tenant (the protocol already has a tenant concept).
    • For personal/single-user APs, scope_owner = user_id. This is fine because the AP-PS-user relationship is already established at bootstrap time — there's no "discover the user at token endpoint" step needed.
    • Single-tenant APs (a SaaS that has only one customer) naturally map to either; pick one in deployment.

    This avoids special-casing personal APs while not requiring the multi-tenant AP to know users.

    On the class-token-presented-only-to-PS reshape (your May-08 comment):

    I like this much more than the inline class claim. Three reasons specific to my topology:

    1. Many of my daemons hit external resources (gmail, github, calendar) where the resource has no business knowing the daemon's class taxonomy. Class is genuinely PS-only routing metadata.
    2. I want to be able to add a new class membership to an existing daemon without rotating its agent identity. The separate AP-issued class token makes this cheap (issue another class token, same agent identity) — much cleaner than re-minting an agent token with a different classes array.
    3. Multi-class daemons are a real case for me: neotoma-agent is both a write-back daemon (for interaction_type=feedback_shared) and a summarizer (for derived entities). Per-class-token-per-class lets the daemon present the right class for the right operation rather than blanket-leaking its full taxonomy on every PS call.

    Cross-link to #23: If sub-agents land as proposed there, sub-agents would NOT carry their own class tokens — they inherit authorization via parent's grant via act.agent. Class applies to top-level agents only. Worth calling out explicitly in either spec that class + sub-agent are orthogonal: top-level agents have classes, sub-agents have act chains, you don't combine them.

    Happy to be a reference implementation for class + personal AP if helpful.

  11. dickhardt commented on Jun 8, 2026

    @dickhardt
    OwnerAuthor

    Would supporting classes in single tenant, personal AP work then? Would providing a consistent tenant from the AP be acceptable for a personal AP? @markmhendrickson

  12. added
    question
    on Jun 8, 2026
  13. dickhardt commented on Jun 8, 2026

    @dickhardt
    OwnerAuthor

    Open question — leaving this open for now.

    Sub-agents (#23) shipped separately. They cover the delegation/hierarchy use cases via parent-mediated authorization (not class), so class is now purely about consent-grouping of independent instances.

    Two things to resolve before adding the claim:

    1. Singular class vs list classes (classes vs class #26): a list lets one agent belong to multiple classes and select which at grant time; a single string is simpler wire format. Unresolved.
    2. Breadth (Platform, surface, session, mission, class #25): for a large AP, a class like planner spans thousands of instances across many users — class-granularity consent may be too broad, better suited to org-scoped APs, or needing PS/user control over whether it's offered.

    Deciding #22/#26/#25 together.

  14. markmhendrickson commented on Jun 10, 2026

    @markmhendrickson

    With #23 closed, the scope here is clean: parent_agent + act chains own delegation/hierarchy, so class is purely consent-grouping of independent top-level instances. Agreed on deciding #22/#26/#25 together — they're the same question seen three ways: a class grant is only as broad as its scope key.

    Grounding this in what I actually run: a single-operator swarm, one issuer (https://markmhendrickson.com), and ~25 agents each with their own subject (<name>@ateles-swarm) and its own agent_grant entity declaring capabilities. Agents fall into a few natural shapes — issue-triage daemons, payment daemons, code/PR workers, mirror/webhook receivers — that share a permission profile within each shape. Today adding a new agent of an existing shape means authoring another near-identical grant. That per-shape repetition is exactly the friction class targets, and it shows up at one operator with tens of agents, not just at org scale.

    On #25 (breadth): the "thousands of planner instances across users" worry and my single-operator case are the same axis. Key the class grant on (AP, class, scope_owner) and breadth falls out at both ends — scope_owner = tenant for a multi-tenant AP bounds it to one org; for a single-operator deployment there's one owner, so the grant covers exactly my agents and nothing wider. So I'd resist confining class to org-scoped APs — the single-operator-many-agents case is where the friction is sharpest, and it's well-behaved as long as the scope key is present.

    Answering your June-8 question directly: yes, a single-tenant/personal AP supplying a consistent tenant works, and reusing the (AP, class, tenant) machinery is simpler than a separate scope_owner claim. The one hard requirement: the tenant value must be durable across restarts and key rotation. If it's re-derived per process, class grants silently break and the per-shape re-consent returns — the exact thing class removes.

    On #26 (singular vs list): I'd lean list classes, but I want to flag a real adjacency from my side. I've been building per-agent capability grants — agent_grant entities whose capabilities gate not just entity writes but specific MCP tool calls with parameter constraints. Class (coarse consent-grouping) and capability scope (fine per-agent containment) are orthogonal, and I think they should stay orthogonal in the spec: class decides "consent once to this shape," the grant still decides "and here's exactly what that shape may touch." A classes list composes cleanly with that — an agent can belong to multiple consent-shapes while its grant remains the precise boundary — whereas overloading a single class to also imply capability scope would blur the two. Keep them separate; let classes be the consent axis only.

    Net: keep class (#22), make it a list (#26), key grants on (AP, class, tenant) with a single-tenant AP supplying a stable tenant (#25 + your June-8 question). Happy to be a reference implementation for class consent-grouping layered over per-agent capability grants whenever it lands.

  15. hegu-1 commented on Jul 14, 2026

    @hegu-1

    The split between instance identity and class-level consent seems necessary if agents are going to be usable in practice.

    I would keep three concepts separate:

    • instance identity: this specific runtime with its own key, revocation, and audit trail
    • class identity: same issuer + same declared agent shape, used for consent reuse
    • delegated/subagent identity: attenuated authority derived from a parent or workflow

    The class claim should help the PS match grants without erasing per-instance audit. A user can consent to the Planner class, but logs and revocation still need to show which concrete Planner instance acted.

    This distinction matters in enterprise agent systems because “same product class” does not necessarily mean same runtime posture, same environment, or same data boundary.

    I have been mapping this as part of an enterprise AI OS governance layer: authority should be reusable where it reduces consent fatigue, but still attributable at execution time.

    Reference: https://github.com/hegu-1/enterprise-ai-os-architecture

    I agree with not inferring class from sub. Keeping it explicit avoids creating authorization semantics from naming conventions.

  16. added
    protocol
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

protocolquestion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions