openid / openid/authzen

[Feature Request] Add 'delegation_chain' to Subject for AI Agent and Multi-Actor Scenarios

Open
#416 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
160
Forks
41
Avg merge
2d 3h
Merged PRs (30d)
23

Description

Problem Statement

With the rise of AI agents and multi-actor systems, authorization decisions increasingly need to consider delegation chains — where one entity acts on behalf of another. Current AuthZen Subject structure cannot adequately express:

  1. AI Agent scenarios: An AI agent (e.g., MCP server, browser automation tool) performs actions on behalf of a human user
  2. Service-to-service delegation: Service A calls Service B on behalf of User X
  3. Multi-agent orchestration: Agent A delegates to Agent B, which delegates to Agent C, all ultimately acting for a human user
Real-World Examples
Scenario Chain Current AuthZen Limitation
MCP Server User → Claude → MCP Tool Only one subject can be expressed
Browser Use User → AI Agent → Browser Cannot trace back to original user
Agentic Workflow User → Orchestrator → Worker Agent No way to enforce "human-in-the-loop" policies

Proposed Solution

Add an optional delegation_chain field to the Subject object:

{
  "subject": {
    "type": "agent",
    "id": "mcp-filesystem-server",
    "properties": {
      "agent_type": "mcp_tool"
    },
    "delegation_chain": [
      {
        "type": "user",
        "id": "alice@example.com",
        "properties": {
          "auth_time": "2024-12-29T10:00:00Z",
          "auth_method": "webauthn"
        }
      },
      {
        "type": "agent", 
        "id": "claude-assistant",
        "properties": {
          "model": "claude-3-opus",
          "session_id": "sess_abc123"
        }
      }
    ]
  }
}
Key Design Points
  1. Optional field — Backward compatible, existing implementations unaffected
  2. Ordered array — First element is the original actor (usually human), subsequent elements are delegates
  3. Reuses existing Subject structure — Each chain element has the same type, id, properties structure
  4. Aligns with RFC 8693 — Similar to OAuth Token Exchange act claim for delegation

Use Cases Enabled

1. Human-in-the-Loop Policy Enforcement
POLICY: "AI agents can only delete files if delegation_chain includes a human with role=admin"
2. Audit Trail
ACTION: File deleted
ACTOR: mcp-filesystem-server  
DELEGATION: alice@example.com → claude-assistant → mcp-filesystem-server
3. Scope Attenuation
POLICY: "Each delegation step can only have equal or lesser permissions than the previous"
4. Chain Depth Limits
POLICY: "Deny requests with delegation_chain.length > 3"

Relationship to Existing Standards

Standard Concept AuthZen Alignment
RFC 8693 (Token Exchange) act claim for actor chain delegation_chain serves similar purpose
XACML Subject attributes Extends Subject with delegation context
SPIFFE/SPIRE Workload identity Can be used as id in chain elements
OAuth 2.0 on_behalf_of flow Delegation chain captures this relationship

Questions for the Working Group

  1. Should delegation_chain be a top-level field in Subject or nested under properties?
  2. Should there be a standardized type vocabulary (e.g., "user", "agent", "service", "device")?
  3. How should PDPs handle missing delegation_chain — treat as single-actor or require explicit opt-in?
  4. Should we define standard properties for chain elements (e.g., delegation_time, delegation_scope)?

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files or tests are named. Start by reviewing the proposed Subject structure and the RFC 8693, XACML, SPIFFE/SPIRE, and OAuth references, then work through the listed design questions. Done means the working group has agreed on the field location, chain semantics, type vocabulary, and handling of missing chains.

Written by the indexing model from the issue text.

Assessment

Domain
backend-api-design, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.