NVIDIA / NVIDIA/OpenShell

Add scope attenuation for broker-issued downstream tokens

Open
#1,756 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

state:triage-needed
Dominant language
Rust
Stars
8.7k
Forks
1.3k
Avg merge
2d 11h
Merged PRs (30d)
253

Description

Problem Statement

A credential broker should mint or exchange downstream tokens with the minimum scope required by the calling agent/tool/binary. Without attenuation, a compromised hop can receive broader delegation than it needs, even if token custody remains gateway-side. Attenuation is what makes the broker pattern actually implement least-privilege delegation rather than just credential isolation.

Proposed Design
  1. Add a scope_policy block per brokered host, provider, tool, or binary.
  2. When the broker mints or exchanges a token, request only the declared scope/permission set for the calling identity.
  3. Deny scope escalation with a structured error that includes requested scope, allowed scope, policy rule, and reason.
  4. Support provider-specific permission models, such as Graph scopes and GitHub App installation permissions, rather than forcing all providers into OAuth scope strings.

Acceptance criteria:

  • A Graph token issued for a read-only mail tool cannot be used for write scopes if the policy grants read-only access.
  • A GitHub App token issued for issue listing uses read-level Issues/Metadata permissions rather than broad repository write permissions.
  • scope_policy is declared in policy, supports reload without sandbox recreation, and is included in broker decision logs.
  • Denied escalation attempts return structured errors the agent can report without exposing token material.
Alternatives Considered
  • Use host-only policy: blocks some destinations, but cannot express least-privilege API permissions.
  • Reuse the full incoming user token: simple, but gives each hop too much delegated authority.
  • Create separate static credentials per tool: workable for some services, but hard to rotate and audit consistently.
Agent Investigation
  • OpenShell network policy controls destination and HTTP access shape, but OAuth/API scopes are a separate authorization surface.
  • The L7 access preset vocabulary is method-oriented, while downstream APIs such as Microsoft Graph and GitHub App installations have their own permission/scope models.
  • The Providers v2 Roadmap lists "Automatic credential scope extraction" as future work, indicating no scope-aware logic exists in the current credential path.

References:

Checklist
  • I've reviewed existing issues and the architecture docs
  • This is a design proposal, not a "please build this" request

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

Start with the OpenShell policy schema and the Providers v2 roadmap referenced in the issue, then compare the existing credential path with RFC 6749 and RFC 8693. Done means a provider-aware scope_policy design covers reloads, decision logging, structured denial errors, and the listed Graph and GitHub permission cases; no implementation entry point or test file is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, rust
Domain
api, authentication, authorization, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.