Tracking: generalize brokered credential delivery beyond inference.local and Microsoft S2S

未关闭
#1,755 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
28/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃

调研方向

将其视为跟踪和设计 issue,而不是实现任务。先从 architecture、Providers v2 和 policy-schema 文档开始,然后审查 PR #1424 和 Entra OBO 子 issue #1754。完成的要求是制定出符合所列验收标准的具体 broker architecture,并将实现工作拆分到已链接的子 issue 中。

由索引模型根据 Issue 内容生成。

描述

state:stale
Problem Statement

OpenShell has a strong broker pattern for LLM provider credentials through inference.local, and PR #1424 adds a concrete Microsoft S2S step. The same pattern should become a general credential-delivery architecture for IdP-issued dynamic tokens, downstream API tokens, refresh token custody, and consent-driven flows.

Proposed Design
  1. Expose a stable internal broker surface such as credentials.local, with provider aliases only where they improve compatibility.
  2. Acquire downstream credentials through the appropriate flow: client credentials, OBO, RFC 8693 token exchange, refresh, or async consent where the IdP supports it.
  3. Cache, rotate, and revoke credentials gateway-side; never return downstream tokens to the sandbox.
  4. Inject credentials on egress only for policy-approved hosts and tools.
  5. Reject or strip sandbox-supplied Authorization headers for hosts configured as brokered, so a local shell or attacker-supplied credential cannot bypass broker policy.
  6. Key broker decisions on attested workload identity where available. Treat DPoP or mTLS proof-of-possession as provider-scoped enhancements, not universal acceptance criteria.

Acceptance criteria:

  • At least one non-LLM downstream API can be called without token material readable from inside the sandbox.
  • Credential rotation completes without sandbox restart.
  • Gateway-side revocation blocks subsequent use within one policy reload or documented revocation interval.
  • Sandbox-supplied Authorization on brokered hosts is rejected or stripped, with a structured policy error.
  • Broker decisions log agent_id, session_id, user_principal where applicable, tool/binary identity, requested scope/resource, granted scope/resource, decision, and correlation ID.

Sub-issues:

  • #1754 Entra OBO token acquisition
  • #1756 Scope attenuation for broker-issued downstream tokens
  • #1757 Async user-consent broker for always-on agents
  • #1758 OpenTelemetry trace correlation across gateway activity
Alternatives Considered
  • Continue adding one provider-specific shim at a time: fastest locally, but risks uneven semantics and audit gaps.
  • Rely only on network allowlists: controls destination, but not token scope, issuer, custody, or attribution.
  • Let every tool manage its own credential cache: compatible, but puts credential material back into the sandbox trust boundary.
Agent Investigation

Problem. OpenShell has a strong broker pattern for LLM provider credentials through inference.local, and PR #1424 adds a concrete Microsoft S2S step. The same pattern should become a general credential-delivery architecture for IdP-issued dynamic tokens, downstream API tokens, refresh token custody, and consent-driven flows. This is a tracking/design issue. The most concrete sub-issue (Entra OBO) should be filed first and linked here.

Investigation:

  • The inference.local model already proves credential brokering works at the gateway: sandbox-supplied credentials are stripped, backend credentials are injected at the proxy, and the agent never sees the upstream secret. This issue asks for that pattern to become a general delivery architecture.
  • PR #1424 (microsoft-agent-s2s) is the second concrete instance of the pattern — confirming the broker extends from LLM keys to dynamic IdP-issued app tokens.
  • Providers v2 supports oauth2_client_credentials, oauth2_refresh_token, google_service_account_jwt, static, and external refresh strategies today. All are machine-credential or pre-acquired-token shaped; none initiate user-context exchange (OBO) or async user consent (CIBA).
  • The Providers v2 Roadmap explicitly lists "Automatic credential scope extraction" and "Refresh telemetry as OCSF events" as future work, directly motivating the scope-attenuation and OTel-correlation sub-issues.
  • Current Providers v2 credential delivery still uses environment-variable placeholders resolved at the proxy. Acceptable for app S2S; insufficient for user-context tokens, which must not be readable from inside the sandbox under any path. A non-env-var delivery contract is part of the ask.

Current Documented Capability Map:

Credential capability Current documented state Requested change
LLM provider keys Brokered through inference.local; sandbox credentials are stripped and backend credentials are injected at the gateway. Use this as the reference broker pattern.
Providers v2 service-account / client-credential profiles Profile and policy composition with credential placeholders and runtime/provider integration. Clarify and extend into a general broker model where tokens do not enter the sandbox.
Microsoft S2S Draft PR #1424 adds Microsoft Agent S2S support. Keep S2S as the first Microsoft provider step.
Entra OBO / user principal Not covered by PR #1424 and not documented as brokered downstream access. Add through the Entra OBO sub-issue (#1754 ).
Downstream API tokens: Graph, GitHub, Slack, Jira, Telegram Tools can require credentials or app-specific tokens outside the inference.local path. Broker and inject tokens for configured hosts/tools; reject sandbox-supplied Authorization for brokered hosts.
Refresh token custody Not documented as a gateway custody feature for downstream user/API tokens. Keep refresh material gateway-side with rotation and revocation.
Async user consent No documented user-scoped async consent broker. Add through the async consent sub-issue (#1757 ).
OTel trace correlation OCSF JSON export exists; OTel trace export is not documented. Add through the OTel tracing sub-issue (#1758 ).

References:

Checklist
  • I've reviewed existing issues and the architecture docs
  • This is a design proposal, not a "please build this" request
主要语言
Rust
星标
8.7k
派生
1.3k
平均合并
2 天 7 小时
30 天内合并 PR
243

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。