How it works
Host mode runs commands on the machine. Container mode runs them in a container whose only way out is an allowlist proxy.
Why use container mode
- Keep the machine’s secrets out of reach. SSH keys, cloud credentials, and other files outside the folder aren’t in the container.
- Decide where data can go. A command can send data only to the hosts you list.
- No silent fallback. If a machine can’t start the container, the command fails with a message. It never runs on the host instead.
- Change it without restarts. Allowlist edits reach running Workers within a minute.
Prerequisites
- The CloudThinker CLI 0.11.0 or newer on every machine of the Worker. Run
cloudthinker updateto upgrade. See CLI. - Docker installed and running for the account that runs the Worker. Podman isn’t supported yet.
cloudthinker worker doctorprints a Container isolation line that says whether the machine is ready. - For a shared Worker, the workspace Admin role. For a personal Worker, you must be its owner. See Roles.
Turn on container mode
Open the Worker's settings
Choose Container
List the hosts commands may reach
api.github.com or *.github.com. Presets add common sets, such as GitHub, PyPI, npm, and Docker Hub. Leave it empty to block all outbound access from the container.Pick an image, if you need one
ghcr.io/acme/build-tools:1.4. The machine pulls it with its own Docker credentials.Save
How a command reaches the network
In container mode the egress proxy is the only route out of the session container.
- The agent sends a shell command to the Worker over the Worker’s outbound connection.
- The Worker runs it in a session container for the conversation’s folder, never on the host.
- A web request from the command goes to the egress proxy. Host names don’t resolve inside the container, and its network has no address on the machine, so there is no other route.
- The proxy connects a host that is on the allowlist.
- Any other request is refused with status 403 and a message that names the reason.
- The command’s output goes back to the agent, as in host mode.
HTTP_PROXY and HTTPS_PROXY, so tools that honor them work: curl, pip, npm, and git over HTTPS among them. SSH, database ports, and other raw connections don’t leave the container. Use HTTPS remotes for git.
What the allowlist allows
The proxy runs four checks in order. The first one that fails refuses the request.
- Enter host names only, without
https://, a port, or a path. Up to 100 entries. Entries are not case-sensitive, and duplicates are dropped when you save. - IP addresses are always refused, and so is a host that resolves to a private, link-local, or cloud metadata address. Container mode can’t reach services on your private network or on the machine itself.
- Only ports 80 and 443 are allowed.
http:// URL the message is the response body. For an https:// URL it is in the status line: Python tools such as pip print it, while curl and git print only CONNECT tunnel failed, response 403.
Limit where a Worker connects from
In the same Security section, Allowed IP addresses takes one IP address or range per line, such as203.0.113.10 or 203.0.113.0/24, up to 50. Leave it empty to allow any address. Select Save security.
CloudThinker compares the address it sees, which is your network’s public egress address, on every call from every machine of the Worker, including runs in progress. A call from another address is refused with “This Worker called from 198.51.100.7, which is not in its IP allowlist. Ask a workspace admin to add the address in this Worker’s settings.” The Worker stops with exit code 3. The IP allowlist works in both host and container mode.
How Worker credentials work
A machine signs in with its own credential, and each run uses a token that ends with it.
- Each machine enrolled in a Worker has its own credential. It stays valid for 30 days after its last use and rotates on its own while the Worker runs.
- When a machine claims a run, it gets a run token. The run’s calls use that token instead of the machine’s credential, and the token stops working when the run ends.
- CloudThinker checks the machine’s credential on every call, including calls made with a run token. Revoking a machine stops its runs right away, and the other machines keep working. A credential that expired, or a call from outside the IP allowlist, is refused the same way.
- When one credential is used from two addresses within 10 minutes, CloudThinker writes an entry under the Security category of Admin Settings → Audit Logs, at most once an hour per credential.
What happens when you switch modes
Troubleshooting
This Worker requires container isolation
This Worker requires container isolation
docker version works for that account, and run cloudthinker worker doctor. Then start the Worker again.A command fails with Blocked by the Worker egress policy, or with response 403
A command fails with Blocked by the Worker egress policy, or with response 403
curl or git print only CONNECT tunnel failed, response 403, run curl -v on the same URL to see the reason in the status line.A tool fails to connect but shows no Blocked message
A tool fails to connect but shows no Blocked message
HTTP_PROXY and HTTPS_PROXY, or it uses a protocol other than HTTP, such as SSH. Configure the tool’s own proxy setting, switch git remotes to HTTPS, or run this work on a host-mode Worker.The Worker stops with: This Worker called from an address not in its IP allowlist
The Worker stops with: This Worker called from an address not in its IP allowlist
A machine shows Used from two IPs
A machine shows Used from two IPs