Repository navigation
feat(env): give each computer in a multi env a control token of its own - #825
Open
andrewpark-scaleai wants to merge 1 commit into
Open
andrewpark-scaleai wants to merge 1 commit into
andrewpark-scaleai wants to merge 1 commit into
Conversation
andrewpark-scaleai
force-pushed
the
andrewpark/per-computer-control-tokens
branch
from
November 19, 2026 20:22
e3c6e38 to
07363ec
Compare
andrewpark-scaleai
marked this pull request as ready for review
November 20, 2026 17:06
Comment on lines
+106
to
+108
| # The SQL consoles take the env's control token, as an Authorization: Bearer header. | ||
| if deployed_env.db_web_gateway_url: | ||
| click.echo("Env DB Web Url: " + click.style(deployed_env.db_web_gateway_url, fg="yellow")) |
There was a problem hiding this comment.
Printed database link needs authentication. The CLI now prints the guarded
db_web_gateway_url instead of the direct database URL. Opening this link in a browser returns 401 because the browser sends no control token. The CLI gives users neither an authenticated entry point nor instructions for supplying that header.
Provide a browser-friendly authenticated entry point, or print instructions for opening the UI through an authenticated local proxy. Keep the console protected.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/cli/env/deploy.py
Line: 106-108
Comment:
**Printed database link needs authentication.** The CLI now prints the guarded `db_web_gateway_url` instead of the direct database URL. Opening this link in a browser returns 401 because the browser sends no control token. The CLI gives users neither an authenticated entry point nor instructions for supplying that header.
Provide a browser-friendly authenticated entry point, or print instructions for opening the UI through an authenticated local proxy. Keep the console protected.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
andrewpark-scaleai
force-pushed
the
andrewpark/per-computer-control-tokens
branch
from
November 20, 2026 17:41
07363ec to
3238617
Compare
Each computer mints its own control token at deploy. The gateway receives them in CHILD_CONTROL_TOKENS and sends each computer's token on that computer's /svc routes. A driver whose card advertises control_token "sha256" boots with only the token's digest (AGENTENV_CONTROL_TOKEN_SHA256). granted_headers picks the longest matching grant. CONTROL_TOKEN_CHILDREN stays for computers an older agent-env booted.
andrewpark-scaleai
force-pushed
the
andrewpark/per-computer-control-tokens
branch
from
November 20, 2026 23:15
3238617 to
2dac273
Compare
This branch has not been 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.
Merge order for this group:
Why
A multi env's computers shared the gateway's control token. This PR gives each computer a token of its own, so each credential opens only what it is for, and keeps the token out of the computer session's process environment.
What changed
CHILD_CONTROL_TOKENSand sends each computer's token on that computer's/svcroutes.AGENTENV_CONTROL_TOKEN_SHA256, and the driver card advertisescontrol_token: "sha256".granted_headerspicks the longest matching grant prefix.Scope
CONTROL_TOKEN_CHILDRENstays in the gateway for computers an older agent-env booted. Delete it once no deploy sets it.Blast Radius
CONTROL_TOKEN_CHILDREN.child_envs[<name>].control_tokenof the multi env's record. A hub that strips the top-level token from reads should strip these too.Verification
tst/unit/env,tst/unit/providers,tst/unit/task,tst/unit/task_step,tst/unit/driversand the protocol's tests pass, except environment-specific failures that also fail on the base branch.multi_env_computers_test.pyasserts each computer holds its own token.

Confidence Score: 5/5
The PR appears safe to merge; the earlier CLI database-link issue remains non-blocking.Fix with agent prompt
Summary
Each computer now gets its own control token instead of sharing the gateway's.
Diagram
sequenceDiagram participant F as Framework participant G as Gateway participant C as Computer F->>C: Boot with token digest F->>G: Configure each computer token F->>G: Call computer route with matching token G->>C: Forward computer token C->>C: Compare token hash with stored digest C-->>F: Return result through gatewayReviews (6) · Last reviewed commit: "feat(env): give each computer in a multi..." · Reviewed by Greptile