Opt the agent-dev image into the non-root agent user - #14684
Merged
Conversation
Bake `ENV WARP_AGENT_NONROOT=1` into docker/agent-dev/Dockerfile so internal dev/staging Oz environments built from this image run the agent as the non-root `agent` user instead of root. The agent entrypoint (entrypoint.bash in warpdotdev/warp-agent-docker) gates the root -> non-root downgrade behind WARP_AGENT_NONROOT via nonroot_downgrade_enabled(), and still defaults off. Oz environments have no env-var setting and their setup commands run after the entrypoint has already picked the user, so a Docker ENV baked into the image is the only mechanism that reaches the entrypoint in time. Co-Authored-By: Warp Agent <agent@warp.dev>
danielpeng2
approved these changes
Aug 4, 2026
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.
Description
Adds
ENV WARP_AGENT_NONROOT=1todocker/agent-dev/Dockerfile, immediately afterFROM ubuntu:24.04, so containers built from this image run the agent as the non-rootagentuser.The agent entrypoint (
entrypoint.bashinwarpdotdev/warp-agent-docker) gates the root → non-root downgrade behindWARP_AGENT_NONROOTvianonroot_downgrade_enabled(), and that gate still defaults off (WARP_NONROOT_DEFAULT=0) while workflows migrate to sudo. It is documented under "Non-root rollout gate" in that repo's README.A Docker
ENVis the right mechanism here rather than environment configuration: Oz environments have no env-var setting, and environment setup commands run after the entrypoint has already chosen the user.ENVpersists into the runtime environment, so the entrypoint reads it before making that decision.The goal is that internal dev/staging Oz environments — specifically Wob the Wuilder (
elWVZSQ9zfX77iblr2p2W4), which runswarpdotdev/warp-internal-dev:latest-devbuilt from this Dockerfile — stop running as root.Scope is exactly this one file. The existing
ENVblock (RUSTUP_HOME/CARGO_HOME/TFENV_ROOT/PATH) is untouched, and nothing else in the repo changes. Net diff: three added lines.Linked Issue
Tracked in Linear as REMOTE-2488, not as a GitHub issue, so the
ready-to-spec/ready-to-implementcheckbox below does not apply — the equivalent gating happened on the Linear ticket.ready-to-specorready-to-implement. (N/A — tracked in Linear)Testing
Testing-exempt category: constant-or-flag-default (config-only). The change is a single Docker
ENVassignment with no logic. A test could only assert the literal value back rather than detect a defect, so no automated test was added.What was actually run:
hadolint docker/agent-dev/Dockerfile— parses cleanly and produces the same set of rule codes as theorigin/masterbaseline (DL3008,DL3009,DL4006,SC2086,DL3016,DL3045,DL3003— all pre-existing and unrelated), differing only by the line-number shift from the added lines. No new findings../script/format --check— passes (exit 0).git diff --check— clean.cargo clippy— deliberately not run. I checked rather than assumed:script/formatis a thincargo fmtwrapper and clippy is likewise Rust-only, while this diff touches zero.rsfiles (git diff --name-onlyreturns onlydocker/agent-dev/Dockerfile). A full-workspace clippy run cannot be influenced by this change.docker build— not run. Docker is unavailable in the environment this change was prepared in (docker: command not found), and no CI job in this repo builds this image (see below). The Dockerfile's syntactic validity is covered by the hadolint parse above.Runtime confirmation after the image is republished:
docker run --rm <image> printenv WARP_AGENT_NONROOTshould print1, and the entrypoint should log a non-root phase instead ofphase=root-transitional../script/run(N/A — this changes a build image, not the app;./script/rundoes not exercise it)Required follow-up after merge
I re-verified this against this repo rather than carrying over the claim from the earlier PR:
grep -rl "warp-internal-dev\|agent-dev"acrosswarpdotdev/warpmatches only a spec document, no workflow under.github/workflows/referencesdocker/, and nothing here builds or pusheswarp-internal-dev:latest-dev.So merging this alone changes nothing at runtime. Someone must manually rebuild and push
warpdotdev/warp-internal-dev:latest-devas a multi-arch buildx push. Environments on that tag — including Wob the Wuilder (elWVZSQ9zfX77iblr2p2W4) — pick up the non-root user on their next container start.Originating thread: https://linear.app/warpdotdev/issue/REMOTE-2488/enable-non-root-agent-user-in-warp-internal-dev-image
ticket_source:
adhoc· ticket_id:ff5e3f11-774c-4ae0-9413-70b9024bba36Agent Mode
CHANGELOG-NONE
Co-Authored-By: Warp Agent agent@warp.dev