Skip to main content

Computer Controller

Reference for the computer-controller: deployment, settings, API, isolation and operations for one isolated Computer per Hrida AI Studio user.

The computer-controller runs one isolated Computer container per Hrida AI Studio user.

  • It starts each Computer on the user's first task and stops it when idle.
  • It routes Studio's requests to that user's Computer.
  • It is the only component with access to the Docker socket.
  • Studio is its only client.

For what users see and how to set it up in Studio, see Computer in Hrida AI Studio.

Deploy​

The deployment file is hrida-helm-charts/docker/computer/docker-compose-computer-controller-prod.yaml. It runs two services:

ServiceImageRole
computer-controllerghcr.io/hrida-ai/computer-controllerStarts, stops and routes the per-user Computers.
computer-egressghcr.io/hrida-ai/computer-egressThe Computers' only way to the web (Squid).

The per-user Computers (ghcr.io/hrida-ai/computer) are not in the file: the controller creates them.

Before the first start:

  1. Address pools. Each user's Computer gets its own Docker network, so give Docker enough address space in /etc/docker/daemon.json, then restart Docker. This gives 4096 networks:

    json
    { "default-address-pools": [{ "base": "10.200.0.0/16", "size": 28 }] }
  2. The controller key. Create it, then keep chmod 600 on the file:

    bash
    mkdir -p secrets && openssl rand -hex 32 > secrets/controller_api_key && chmod 600 secrets/controller_api_key
  3. The network Studio uses to reach the controller (COMPUTER_MGMT_NETWORK):

    • Studio as a Docker Swarm stack: the controller joins Studio's overlay, hrida-studio-overlay, which must be attachable. Check with docker network inspect hrida-studio-overlay -f '{{.Attachable}}'. Run the file on the Swarm node where the Computers should run.
    • Studio as plain Docker Compose: run docker network create computer-mgmt, set COMPUTER_MGMT_NETWORK=computer-mgmt, and add the network to the Studio service.
    • Never publish the controller's port on a public address.
  4. Start it:

    bash
    docker compose -f docker-compose-computer-controller-prod.yaml up -d
  5. In Studio, open Admin › Settings › Integrations › Computer and set:

    • Controller URL: http://computer-controller:8080;
    • the key from step 2;
    • the Studio URL Computers use, and the agent's model.

Isolation​

What each user's Computer gets
FilesIts own container and two volumes: the workspace and app data (/data), and the home folder. Nothing is shared between users, and both are kept until the Computer is deleted with its files.
NetworkIts own internal network with no route out. Only the controller and the egress proxy are attached. The controller listens only on its management address, so Computers can't connect to it.
WebOnly through computer-egress. It refuses private, loopback, link-local (including 169.254.169.254), CGNAT and multicast addresses, allows only ports 80 and 443, and logs every request.
ProcessNon-root, a read-only root filesystem, no Linux capabilities, no-new-privileges, and a process limit.
ResourcesCPU and memory limits, a disk quota over both volumes, and a cap on how many Computers run at once.
SecretsTwo files in its own volume, never environment variables: its gateway key (derived, so nothing is stored), and the user's scoped Studio token. That token works on Studio's model API only.

Settings​

The controller reads its settings from the environment.

VariableDefault
CONTROLLER_API_KEY / CONTROLLER_API_KEY_FILErequiredStudio's key for the controller.
CONTROLLER_KEY_SECRET / _FILEthe API keyDerives each Computer's gateway key. Set a separate value to rotate the two independently.
CONTROLLER_BINDthe startup address0.0.0.0 to listen on every network.
COMPUTER_IMAGEghcr.io/hrida-ai/computer:latestPulled when missing, and pre-pulled at start.
COMPUTER_NETWORK_MODEper-usershared puts everyone on one network (COMPUTER_NETWORK); Computers can then reach each other.
COMPUTER_ATTACH_CONTAINERS—The controller's and the proxy's container names, attached to every user's network.
COMPUTER_EGRESS_PROXY—For example http://computer-egress:3128.
COMPUTER_CPUS / COMPUTER_MAX_CPUS1 / 4Studio's per-Computer value is capped at the maximum.
COMPUTER_MEMORY2gNo swap beyond it.
COMPUTER_PIDS_LIMIT512
COMPUTER_DISK_QUOTA_MB5120A Computer over quota gets no new work. Its owner can still open it to delete files.
COMPUTER_IDLE_TIMEOUT_MINUTES30Idle Computers stop; their files stay. Only real use counts: tasks, and in an opened Computer its pages, file actions and terminal typing. A tab left open does not.
COMPUTER_MAX_RUNNING20Starts beyond this answer "busy".
COMPUTER_START_TIMEOUT_SECONDS120
COMPUTER_TZ—Time zone inside the Computers.
COMPUTER_UI_PORT8090The address people open their own Computer at. 0 turns it off.
COMPUTER_UI_PUBLIC_URL—That address as people reach it, for example https://desk.computer.example.com. Studio's Address for users is the same value. With https, its cookies are secure-only.
COMPUTER_UI_SESSION_HOURS12How long an opened Computer stays signed in.
COMPUTER_UI_BIND0.0.0.0Where that address listens. Clients on a Computer network are refused.
EGRESS_ALLOW_INTERNAL_HOSTS (egress)—Host names the Computers may reach although they are private, for example Studio's internal name.

API​

Every route except /health needs Authorization: Bearer <CONTROLLER_API_KEY>.

Route
GET /healthLiveness.
GET /v1/workspaces[?disk=true]Every Computer: owner, status, disk use, idle time, over quota.
GET /v1/workspaces/{user_id}One Computer.
POST /v1/workspaces/{user_id}/ensureCreate or start it, and wait until it is ready.
POST /v1/workspaces/{user_id}/stopStop it; the files stay.
DELETE /v1/workspaces/{user_id}?purge=trueRemove it, and with purge its files.
ANY /w/{user_id}/v1/{path}That user's Computer gateway, streamed. Only /v1/* is proxied.

Open My Computer​

Besides its API for Studio, the controller has a second address, for people: there each person opens their own Computer's file browser and terminal (see Computer in Studio › Open Your Computer).

  • How someone gets in. Studio starts the person's Computer and hands them a link that works once, for a minute. The controller then signs them in to that Computer only, for COMPUTER_UI_SESSION_HOURS. Its sessions can reach no other Computer and not the Computers' API.
  • When a session ends. After COMPUTER_UI_SESSION_HOURS, when the person signs out of their Computer, when Studio stops or deletes that Computer (for example because the person lost access), and when the controller restarts.
  • What Studio decides. Its settings say whether the terminal is available (Terminal in Open my Computer) and whether admins may open users' Computers (Admins may open users' Computers). The controller enforces what the link says.
  • Other sites can't act for a signed-in person. Changes and WebSocket connections from other sites are refused, and other sites can't frame its pages.
  • Every visit is logged. The controller's log records each opening (whose Computer, which admin if any, whether the terminal is on, the client address) and each terminal session.
  • Publish it on the host only. The production compose file publishes it on 127.0.0.1:8090.
  • Serve it on its own host name, for example desk.computer.example.com. The proxy in front (nginx) must:
    • forward to 127.0.0.1:8090, passing the original host name on;
    • pass WebSocket upgrades (the terminal uses them) and allow long-running connections;
    • allow uploads as large as your users need.
  • Use HTTPS, and set COMPUTER_UI_PUBLIC_URL and Studio's Address for users to it.
  • Never share Studio's host name. On a separate host name, a Computer's pages can never read Studio's sign-in.

Operations​

TaskHow
See all ComputersStudio's Show users' Computers, or docker ps --filter label=io.hrida.computer.
Logsdocker logs computer-controller, docker logs computer-egress (every web request), docker logs cptr-u-<hash>.
Upgrade ComputersChange COMPUTER_IMAGE, or pull a new latest. Running Computers switch at their next start, so no task is cut off.
Free a user's diskThe user can open their Computer and delete files, even over the quota. Or delete their Computer in Studio: it is created again, empty, on their next task.
See who opened which ComputerStudio's audit log (Admin › Trust › Audit, action OPEN), and the ui open lines in docker logs computer-controller.
See a user's files without StudioTheir two volumes are labelled with their Studio user id: docker volume ls --filter label=io.hrida.computer.user=<user id> lists cptr-data-<hash> (workspace) and cptr-home-<hash> (home folder). Read them with a throwaway container that mounts them read-only.
A user leavesDeleting them in Studio (admin UI or SCIM) removes their Computer, its files and its token.
Hrida.ai is proprietary software of Zlabs Innovation. See the license for terms. © 2026 Zlabs Innovation.