Skip to content

[Blocked][Auth] Add Agent Delegation credential exchange #228

Description

@linfangw

背景

Parent: #200

Agent 场景需要把用户凭证交换为短期、最小权限、不可刷新的 delegation token。目前公开 discovery/OpenAPI 尚未提供 token exchange、delegation claims、audience/resource 绑定或稳定错误契约,因此不能实现或公开猜测性接口。

本 issue 先固定客户端安全边界,状态保持 blocked;公开契约满足开始条件后再实现。

开始条件

  • discovery 或公开 OpenAPI 声明 token exchange/delegation endpoint 与 grant/type。
  • scope、resource/audience、run_id、预算及 tool/model 限制的 claims 契约稳定。
  • Resource Server 可验证 issuer、audience、expiry 与收窄约束。
  • public test client 和成功/失败 fixtures 可用。
  • revoke/introspection 或等价的短期失效策略已明确。

实现范围

  • 在 credential provider contract 上实现 delegation provider。
  • 只允许从用户授权收窄 scope、resource、预算、tool/model 与有效期。
  • delegation token 默认只驻留内存且不可刷新。
  • resource/audience 不匹配时立即失败,不静默回退到 API Key。
  • 401 最多进行一次安全的凭证更新重试,业务 4xx 不重试。

验收标准

  • 客户端无法请求比父凭证更宽的能力。
  • token 有短 TTL、明确 audience/resource 且不可刷新。
  • token 不写入磁盘、日志、异常或 telemetry。
  • endpoint/audience/scope 错误有确定性测试。
  • API Key 与未来 Device Flow provider 不受回归影响。

非目标

  • 在本仓库实现授权服务、资源服务、模型路由或计费。
  • 在公开契约就绪前发明 endpoint、claims 或错误码。

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture design, boundary, or system structure workarea: sdkPython SDK and package release workenhancementNew feature or requestpriority: P1High priority roadmap itemstatus: blockedWaiting for an external contract or dependency before implementation can proceed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions