Skip to content

docs: document non-root container user for cloud agents - #464

Open
hongyi-chen wants to merge 3 commits into
mainfrom
docs/cloud-agents-non-root-user
Open

docs: document non-root container user for cloud agents#464
hongyi-chen wants to merge 3 commits into
mainfrom
docs/cloud-agents-non-root-user

Conversation

@hongyi-chen

Copy link
Copy Markdown
Collaborator

What

Documents the upcoming breaking change where cloud agents run as a dedicated non-root agent user (UID/GID 1000 where available) with passwordless sudo, instead of running as root. This is the durable docs page the customer email can link out to, per the rollout thread.

  • platform/environments.mdx — New Container user and permissions section covering:
    • How the user is determined (USER directive respected; agent user when the image starts as root; root fallback with a warning when the image can't support a non-root user)
    • Migration guidance: sudo prefix for root-only commands (PATH preserved, LD_*/BASH_ENV stripped), /home/agent home directory vs /root, UID/GID 1000 file ownership/writability
    • A note on the temporary WARP_AGENT_NONROOT=0 opt-out during the deprecation window
    • Also: a pointer from the Setup commands bullet, and a Permission denied entry under Common issues
  • platform/faqs.mdx — New Q&A: "Do cloud agents run as root inside the container?" under Architecture and execution

Notes for reviewers

  • ⚠️ Timing: merge when the non-root flag is flipped (or just before, alongside the admin email). The page is written in post-change present tense.
  • The transition note (the WARP_AGENT_NONROOT=0 opt-out) intentionally omits hard dates since the deprecation window end date is still TBD in the email copy; remove that note entirely once the window closes.
  • Scope question: the section says "inside the container" and doesn't enumerate hosts. Please confirm whether the change also applies to self-hosted managed workers (Docker/Kubernetes backends) and whether any self-hosting pages need a matching note.
  • Style lint: 0 new violations (11 pre-existing warnings in untouched lines of these files). npm run build passes (355 pages).

Conversation: https://staging.warp.dev/conversation/109b7dd3-0781-4a4e-846d-9b3bddd3e72c
Run: https://oz.staging.warp.dev/runs/019fc8c4-ef02-755f-9e12-fe157118faf5

This PR was generated with Oz.

Cloud agents now run as a dedicated non-root 'agent' user (UID/GID 1000)
with passwordless sudo when the environment image doesn't set a USER.
Adds a 'Container user and permissions' section to the environments page,
a permission-denied entry under common issues, and a cloud agent FAQ.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Aug 3, 2026
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 3, 2026 10:57pm

Request Review

@hongyi-chen
hongyi-chen marked this pull request as ready for review August 3, 2026 22:43
@oz-for-oss

oz-for-oss Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@hongyi-chen

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

* **Keep directories writable by UID/GID 1000** – Files the agent creates are owned by UID 1000, and any directories baked into your image that the agent writes to must be writable by UID/GID 1000.

:::note
Cloud agents previously ran as root. To temporarily restore that behavior while you update your image or setup commands, set the environment variable `WARP_AGENT_NONROOT=0` in your image (for example, with an `ENV` directive in your Dockerfile). This opt-out is available for a limited deprecation window after the change ships.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure if we want to have this callout, but might be worth if we had a lot of users that may be affected by this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's worth keeping. we can probably keep the opt-out around, we don't need to say we're going to deprecate it

@hongyi-chen
hongyi-chen requested a review from danielpeng2 August 3, 2026 22:44

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR documents the upcoming change for cloud agents to run as a non-root container user and adds related migration guidance in the environments page and FAQ. The structure and links fit the existing docs, and I found no security-specific findings or spec drift because no approved spec context was provided.

Concerns

  • The sudo guidance is broad enough to imply every non-root container user gets working passwordless sudo, but the new docs also say images that set a non-root USER run as that user unchanged. Scope the sudo advice to the default agent user path, or explicitly state that custom non-root images must provide their own sudo behavior.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

* **Docker image (required)** – The task/workspace image with the toolchain and dependencies your code needs. For self-hosted Kubernetes workers, a [`default_image`](/platform/self-hosting/managed-kubernetes/) on the worker lets you skip creating an environment entirely.
* **Repository/workspace** – One or more repos the agent can clone and operate on.
* **Setup commands** – Commands to prepare the workspace (e.g., dependency install, builds, bootstrapping).
* **Setup commands** – Commands to prepare the workspace (e.g., dependency install, builds, bootstrapping). Setup commands run as the [container user](#container-user-and-permissions), so prefix commands that need root access with `sudo`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This broadly tells users to use sudo, but custom images that set a non-root USER are later described as running unchanged; those users may not have passwordless sudo unless their image provides it. Scope this guidance to the default agent user path.

Suggested change
* **Setup commands** – Commands to prepare the workspace (e.g., dependency install, builds, bootstrapping). Setup commands run as the [container user](#container-user-and-permissions), so prefix commands that need root access with `sudo`.
* **Setup commands** – Commands to prepare the workspace (e.g., dependency install, builds, bootstrapping). Setup commands run as the [container user](#container-user-and-permissions). When Warp creates the default `agent` user for an image that starts as root, prefix commands that need root access with `sudo`.


### Do cloud agents run as root inside the container?

No. By default, cloud agents run as a dedicated non-root `agent` user (UID/GID 1000 where available) with passwordless sudo. If your environment's image sets a non-root `USER`, Warp runs the agent as that user instead. Commands that need root access, like `apt-get install`, work with a `sudo` prefix. See [Container user and permissions](/platform/environments/#container-user-and-permissions) for details on home directory location, file ownership, and fallback behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This sentence follows the custom USER case, so readers can interpret it as saying sudo always works even when Warp runs their image-defined non-root user unchanged. Limit the sudo guarantee to images where Warp creates the default agent user.

Suggested change
No. By default, cloud agents run as a dedicated non-root `agent` user (UID/GID 1000 where available) with passwordless sudo. If your environment's image sets a non-root `USER`, Warp runs the agent as that user instead. Commands that need root access, like `apt-get install`, work with a `sudo` prefix. See [Container user and permissions](/platform/environments/#container-user-and-permissions) for details on home directory location, file ownership, and fallback behavior.
No. By default, cloud agents run as a dedicated non-root `agent` user (UID/GID 1000 where available) with passwordless sudo. If your environment's image sets a non-root `USER`, Warp runs the agent as that user instead, unchanged. For images that start as root, commands that need root access, like `apt-get install`, work with a `sudo` prefix. See [Container user and permissions](/platform/environments/#container-user-and-permissions) for details on home directory location, file ownership, and fallback behavior.

@danielpeng2 danielpeng2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you planning on merging this now or when the changes actually roll out to prod?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants