Repository navigation
feat(den): deploy environment variables to desktop agents - #6403
Open
OmarMcAdam wants to merge 12 commits into
Open
OmarMcAdam wants to merge 12 commits into
OmarMcAdam wants to merge 12 commits into
Conversation
Admins deploy environment variables to everyone, teams or people, each assignment with its own value, or let each person set their own. Desktops add them to the agent's environment: live on OpenCode v2 through the session bridge, through a standby engine on v1. Agents can write values after explicit confirmation but never read them. Every change is audited without values. Behind environmentVariables (cloud and self-hosted, off).
AutoAccessWallNotice typed workspaceId but never destructured it, so the desktop typecheck failed and Sign in lost the workspace.
…picker The menu was pinned to the trigger's width, cutting off "Everyone in …" assignment names. It now fits its labels, capped to the window.
Settings showed the last background sync, so a variable an admin had just deployed (or the flag just turned on) appeared only up to five minutes later.
…le settings refreshes
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
OmarMcAdam
had a problem deploying
to
pr-internal-specs
October 23, 2026 00:56 — with
GitHub Actions
Error
Contributor
OpenWork evidence
Run details · Open the preview to inspect evidence and sandbox options. |
Member
Author
Contributor
Warden: not approvedSecurity review found 2 high severity findings. Fix them and push; Warden reviews again automatically. If they are false positives, a maintainer can approve by hand. Security findings (2 findings) high: Cloud-managed secrets are exposed to model-controlled shell tools in `apps/server/src/engine-v2-preview.ts:600`Resolved organization values are added to the v2 engine process environment and copied into new shell environments. When shell use is allowed or approved, model-controlled commands can print those values into tool output returned to the model, or send them over the network. This bypasses Den’s restriction that agents cannot read resolved values. Keep the secrets out of general-purpose model-invoked processes. Clear when: model-invoked shells and other tool processes cannot read deployed secret values. high: MCP callers can self-confirm environment deployments in `ee/apps/den-api/src/routes/org/environment-variables.ts:666`Replace the caller-supplied `confirmed` flag with a user-side approval bound to the planned assignments; an MCP agent can set this flag itself and deploy values without the person's approval. Reviewed |
Address review findings and CI: - Refuse keys that make tools run other commands (GIT_*, LD_*, DYLD_*, shell startup, interpreter and package-manager config) in Den, and drop them again on the desktop. - Key the desktop's cached values by Den identity and clear the server's values whenever the session changes, so another account's values never render. - Build @openwork/types/den/environment-variables to JavaScript: the packaged server can't load TypeScript from node_modules. - Declare the Environment Variables OpenAPI tag and mark timestamps as date-time.
Member
Author
|
Warden findings, addressed in c5afbc4:
|
…n account switch - Refuse TAR_OPTIONS and other option variables tools read as flags (make, rsync, less, prompts) and more editors and pagers. - On a Den session change, start an engine without the previous person's values before fetching the new account's, so a failed fetch can't leave them running. - Use role-only names for test users.
Member
Author
|
Second Warden round, addressed in 2413105:
|
# Conflicts: # ee/packages/den-db/drizzle/meta/0156_snapshot.json # ee/packages/den-db/drizzle/meta/_journal.json # ee/packages/utils/src/typeid.ts # packages/docs/openapi.json # packages/features/src/registry.ts # packages/sdk/src/gen/sdk.gen.ts # packages/sdk/src/gen/types.gen.ts # packages/types/package.json # packages/types/tsup.config.ts # packaging/helm/openwork-ee/values.schema.json # packaging/helm/openwork-ee/values.yaml
…o the Den account - Refuse VIMINIT, EXINIT, GVIMINIT, MYVIMRC, NVIM_* and other editor startup variables. - Key the agent's list of variable names by the signed-in organization and account, so names from one organization are never reused after a switch.
Member
Author
|
Third Warden round, addressed in 04280fa:
|
…akening keys - Creating or updating a variable with values from an agent or API key now needs confirmed: true, like members' own values. - Refuse NODE_TLS_*, SSL_*, SSLKEYLOGFILE and CA bundle overrides.
OmarMcAdam
had a problem deploying
to
pr-internal-specs
October 23, 2026 17:47 — with
GitHub Actions
Error
Member
Author
|
Fourth Warden round, addressed in e0758e7:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.







What is this about?
Admins deploy environment variables from OpenWork Cloud (Manage › Environment Variables) to people's desktop agents.
What problem does it solve?
There was no way to give a team's agents a shared key, URL or setting, or to change or revoke it centrally.
What was the situation before?
Settings › Environment only held variables saved on that device.
How is this implemented?
routes/org/environment-variables.ts): each assignment (everyone, team, person) holds its own encrypted value, or each person sets their own; people choose between assignments. Agents write values only after confirming, never read them; only the desktop receives values. Newenvironment_variables.view/.managepermissions (admins by default). All changes audited without values.cloud-environment-sync.ts): v1 starts a standby engine with the values; v2 applies them live via the session bridge and a shell hook (opencode-plugin/src/desktop-environment.ts). Settings shows them with Managed in Den badges.environmentVariables(cloud and self-hosted, off); turning it off removes values from agents on the next sync.What else changed?
AutoAccessWallNoticedroppingworkspaceId(desktop typecheck failed ondev).Release note
Admins can deploy environment variables to their team's agents from OpenWork Cloud, per team or person, or let each person set their own.
Evidence
No E2E spec.
ee/apps/den-api/test/api/environment-variables.api.test.tsandapps/server/test/cloud-environment-native.test.ts(real OpenCode 2.0.26: a running engine's shells get a changed value and lose a removed one). Driven end to end on Daytona; screenshots in a comment.Design: P1, P4, P9, P11, S2, S7, C5