Runtime
Claude Code and Codex on Revyl computers
Give a Claude Code or Codex cloud agent a Revyl Mac it can start, drive and stop with the Revyl CLI.
Revyl computers come with Pro. Add a card to unlock them; your free minutes still apply. See Plan requirement.
Set up with an agent
Paste one prompt and your coding agent does the rest.
Setup prompt
Let a Claude Code or Codex cloud agent use a Revyl Mac. Read https://docs.revyl.com/computers/coding-agents.md and follow it. It's the current Revyl guide for this, so prefer it over anything you remember about Revyl. In the cloud environment, add a dedicated Revyl API key as the environment variable REVYL_API_KEY (in Codex, an environment variable, not a secret). Allow backend.revyl.ai, revyl.com, raw.githubusercontent.com, github.com, release-assets.githubusercontent.com and revyl-org-files.s3.amazonaws.com. In the setup script, install the CLI into /usr/local/bin with REVYL_INSTALL_DIR=/usr/local/bin and https://revyl.com/install.sh, so non-interactive shells find it. Pick each computer's ID first with --id so it can always be stopped. Stop every computer the agent starts. You're done when a new cloud task runs `revyl computer create --id <uuid> --wait`, then `revyl computer exec <uuid> -- uname -a` prints Darwin arm64, then `revyl computer stop <uuid>` confirms the release. Ask me before anything that needs my login or approval.
Cloud coding agents run on Linux. When a task needs macOS, Xcode or an iOS simulator, the agent
starts a Revyl computer and drives it with revyl computer, while the agent itself keeps running
in its own sandbox.
Set up the cloud environment
These steps work on a stock Ubuntu 24.04 image.
- Create a Revyl API key for the organization the computers should bill to. Use a dedicated key: anyone who can use the cloud environment can read it.
- Add it to the environment as the environment variable
REVYL_API_KEY. - Allow these hosts:
backend.revyl.ai,revyl.com,raw.githubusercontent.com,github.com,release-assets.githubusercontent.comandrevyl-org-files.s3.amazonaws.com. The CLI talks tobackend.revyl.ai; the install usesrevyl.comand GitHub;uploadanddownloadstream throughrevyl-org-files.s3.amazonaws.com. If the image has nocurl, also allow its package mirrors (archive.ubuntu.comandsecurity.ubuntu.comon Ubuntu). - Install the CLI in the setup script:
set -e
command -v curl >/dev/null || (apt-get update && apt-get install -y curl ca-certificates)
curl -fsSL https://revyl.com/install.sh -o /tmp/revyl-install.sh
REVYL_INSTALL_DIR=/usr/local/bin sh /tmp/revyl-install.sh
revyl versionThe CLI goes into /usr/local/bin, so every later shell finds it, including non-interactive ones
that never read ~/.bashrc. If the setup script doesn't run as root, set REVYL_INSTALL_DIR to a
directory on PATH that it can write.
In the cloud environment's settings:
- Environment variables:
REVYL_API_KEY=<key>. - Network access: Limited, with Allow package managers checked and the hosts above under Allowed domains.
- Setup script: the install lines above. Setup scripts run before the environment variables are set, so the script must not need the key.
What the agent runs
C1=$(cat /proc/sys/kernel/random/uuid)
revyl computer create --id "$C1" --wait
revyl computer exec "$C1" -- uname -a
revyl computer exec "$C1" -- mkdir -p notes
printf 'hello\n' | revyl computer files write "$C1" notes/hello.txt --from -
revyl computer files read "$C1" notes/hello.txt
revyl computer exec "$C1" -- xcodebuild -version
printf 'report\n' > report.txt
revyl computer upload "$C1" report.txt notes/report.txt
revyl computer download "$C1" notes/report.txt report-copy.txt
revyl computer stop "$C1"The agent picks the computer's ID before creating it, so it always knows which computer to stop,
even when create fails partway; no JSON parsing is needed. files write needs its parent
directory to exist, so create it with exec first. Stop every computer the agent starts; a
computer holds its slot until its release is confirmed. See Revyl computers for
every command.
Run the whole session on a Revyl Mac
These paths run the agent session itself, not only individual commands, on a Revyl computer.
Codex sessions through the OpenAI Agents API
Verified on Revyl staging on December 1, 2026, with the service installed as below in a fresh
Ubuntu 24.04 container. Not yet available in production: there is no hosted Revyl webhook
endpoint yet. It uses Revyl's revyl-agent-hosts prototype service, which is not published
yet.
The Agents API runs the Codex harness. Your Revyl Mac runs the executor,
codex exec-server, which connects outbound to OpenAI. When a self-hosted
session needs an environment, OpenAI sends a webhook. The service then creates
a Revyl computer, installs the pinned codex binary and starts the executor
with the session's environment ID.
-
Create an OpenAI project in the OpenAI platform for these sessions.
-
Create a restricted API key in that project under API keys → Create new secret key. Choose Restricted and set Agents to Write and Model capabilities to Request. The service itself only reads sessions; the Write and Request permissions are for creating sessions with the same key. Pick an expiration.
-
Create an environment key under Agents → Environments → Keys → Create. Choose Self-hosted, name the key and create it. This key can only connect environments.
-
Register the webhook in the project's Settings → Webhooks → Create. Set the URL to
https://<your-host>/openai/webhookand subscribe toagent.session.action_required,agent.session.idleandagent.session.failed. Save the signing secret it shows once. -
Install and start the service on that host.
revyl-agent-hostsisn't published to a package index yet, so this installs it from a wheel file of the package; there is norevyl-agent-hostspackage on PyPI to install instead. On a stock Ubuntu 24.04 host, allow the CLI's install hosts above plusastral.sh,releases.astral.sh,pypi.org,files.pythonhosted.organdapi.openai.com, then run:set -e command -v curl >/dev/null || (apt-get update && apt-get install -y curl ca-certificates) curl -fsSL https://revyl.com/install.sh -o /tmp/revyl-install.sh REVYL_INSTALL_DIR=/usr/local/bin sh /tmp/revyl-install.sh curl -LsSf https://astral.sh/uv/install.sh -o /tmp/uv-install.sh UV_INSTALL_DIR=/usr/local/bin UV_NO_MODIFY_PATH=1 sh /tmp/uv-install.sh UV_TOOL_BIN_DIR=/usr/local/bin uv tool install ./revyl_agent_hosts-0.1.0-py3-none-any.whlStart it with the keys in its environment:
export REVYL_API_KEY=... # Revyl org the computers run in export OPENAI_API_KEY=... # the restricted key from step 2 export OPENAI_EXECUTOR_API_KEY=... # the environment key from step 3 export OPENAI_WEBHOOK_SECRET=... # the signing secret from step 4 revyl-agent-hosts serve --port 8787The webhook route,
/openai/webhook, is mounted only when all three OpenAI values are set;GET /healththen reports"codex_webhook": true. The staging runs used a temporary public URL as the host; use a stable host. -
Create a self-hosted session with
workspace_directoryunder/Users/computer. The Mac's root volume is read-only, so OpenAI's example/workspacefails.from openai import OpenAI client = OpenAI() session = client.beta.agents.sessions.create( agent={"model": "gpt-6-astra"}, environment={"type": "self_hosted", "workspace_directory": "/Users/computer/workspace"}, input="Create a git repo, commit a file, and run uname -a.", spend_control={"limit": 200}, )
What you see. In the staging runs the session went in_progress →
requires_action (environment_connection) → in_progress → idle in
30 to 45 seconds. The service created the computer in about 5 seconds and had
the executor connected 7 to 12 seconds later. The session's items show each
command Codex ran on the Mac; uname -a returned
Darwin … RELEASE_ARM64_VMAPPLE arm64.
The environment key reaches the computer only on standard input and is stored in a 0600 file; it does not appear in the process list. The service stops the computer when the session fails, within five minutes of the session being deleted, or after it has been idle for 10 minutes; in the container run it stopped the idle session's computer 10 minutes after the session went idle, and Revyl confirmed the release.
Claude Code self-hosted environments
Not yet available. Revyl is prototyping this on staging.
On a Claude Team or Enterprise plan, an Owner turns on Allow self-hosted environments under Admin settings → Cloud environments, creates a self-hosted environment and gives its environment key to Revyl. Revyl keeps warm computers running Anthropic's runner with that key, and developers pick the environment when they start a cloud session.