feat(policy): extend provider attachment proposals#1431
Conversation
|
This is interesting but I would find it likely that by requesting a provider, the workload is also requesting access to credentials needed to use that provider. When a provider is attached to an already running sandbox, the env placeholders cannot be updated in the current running userland process. I also would worry that attaching a provider may bring in too many allowances that aren't fully needed vs the policy advisor requesting the minimal needed access. Is there a specific use case around this? |
|
That's a good point although provider access is still useful because the credential values are represented as placeholders. The running agent does not need the raw secret, and in some flows it does not need its own process env mutated either: after approval, it can inspect the attached provider metadata, see the credential key, and use the corresponding placeholder in requests that pass through the sandbox proxy. For example, suppose an agent needs to comment on a GitHub PR. A narrow network rule can allow After approval, the agent can inspect attached providers, see that sequenceDiagram
participant Agent as Running agent
participant PolicyLocal as policy.local
participant Gateway as Gateway
participant Proxy as Sandbox proxy
participant GitHub as api.github.com
Agent->>PolicyLocal: POST /v1/proposals requestProvider(github)
PolicyLocal->>Gateway: Submit provider proposal
Gateway-->>PolicyLocal: Pending draft chunk
Note over Gateway: Operator approves provider attachment
Agent->>PolicyLocal: GET /v1/providers
PolicyLocal->>Gateway: ListSandboxProviders
Gateway-->>PolicyLocal: github exposes GITHUB_TOKEN
PolicyLocal-->>Agent: credential key: GITHUB_TOKEN
Agent->>Proxy: POST /repos/.../comments<br/>Authorization: Bearer openshell:resolve:env:GITHUB_TOKEN
Proxy->>Proxy: Resolve placeholder from refreshed provider credentials
Proxy->>GitHub: POST /repos/.../comments<br/>Authorization: Bearer real token
GitHub-->>Proxy: 201 Created
Proxy-->>Agent: Response
|
Summary
Extends support for provider attachment requests in the draft policy proposal workflow. In-sandbox agents can now inspect attached providers through
policy.local, submit arequestProviderproposalfor an existing host-managed provider, and let an operator approve that attachment through the same draft review path used for network policy changes.
Changes
enforcement.
ListSandboxProviderssopolicy.localcan show attached provider metadata without exposing secrets.GET /v1/providersandrequestProvidersupport to the sandbox-local policy API.providers_v2_enabled, while keeping an explicit opt-out.curlandnode.Checklist
mise run pre-commit