Based on AgentRun release · Synced .
Morph
import { providerFor } from "@parcha/agentrun-computer";
// The key is the caller's to pass (serve's MORPH_API_KEY), and ssh2 is the host's own.
const morph = await providerFor("morph", { apiKey });
const box = await morph.prepareImage(); // the box image as a snapshot in the key's account
const made = await morph.create({ image: box.value, lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
Morph runs on the shared machine-host adapter (PROVIDERS.md): src/morph.ts is Morph's MachineHost.
A Morph computer is kind linux, an instance (a VM) started from a snapshot through Morph's REST API
(https://cloud.morph.so/api, Authorization: Bearer <key>; OpenAPI at https://cloud.morph.so/api/openapi.json).
| MachineHost | Morph |
|---|---|
create |
POST /instance with the snapshot, the labels as metadata, and the lifetime as ttl_seconds with ttl_action: "stop" |
get |
GET /instance/{id}: ready is running, pending and saving starting, paused stopped, error gone |
list |
GET /instance, the account's every instance; the adapter matches the labels (the metadata[...] filter is not used: whether a dotted key survives it is unverified) |
delete |
DELETE /instance/{id}, then this host's SSH connections to it end |
extend |
POST /instance/{id}/ttl, never past the max-deadline label, its read-back end held to the call's now plus the seconds; then POST /instance/{id}/metadata with the deadline label moved |
exec |
SSH through the gateway ssh.cloud.morph.so:22 as <instance id> with the instance's own key (GET /instance/{id}/ssh/key, PKCS#8, converted to a form ssh2 reads; read once and kept until delete or a refused login); one channel per process on the shared connection, and the shared pid wrapper for kill |
check |
an image is a snapshot id (snapshot_...); a size is the snapshot's, so cpus and memoryMb are refused |
Morph's REST exec (POST /instance/{id}/exec) answers when the command ends, with no stdin, so it is not used. Both
Morph SDKs log in as <instance id>:<API key> with any key; this provider does not, since Morph publishes no host key
for its gateway, and a host posing as it would read the account's key out of the username. A public-key login with the
instance's key hands such a host nothing to reuse. Morph has no egress control: network none, open and a list are
init's. No Archil mount and no desktop yet.
The box snapshot. prepareImage() answers the snapshot whose digest is agentrun-box-<recipe hash> in the key's
account, or builds it once: a base snapshot of morphvm-minimal at 2 vCPUs, 4 GiB and 16 GiB of disk (POST /snapshot), an instance from it with a 2 h TTL of its own, box/install.sh run as root over SSH, then POST /instance/{id}/snapshot with the digest, and the instance deleted. The box snapshot and its base have no TTL, so
neither expires. A build that fails before it asks for the box snapshot deletes its base as well, so it leaves nothing.
A cancel does the same: the base's and the instance's creates take no cancel signal, only their own time bound, so
their ids are always read and then deleted. POST /snapshot answers only once the base is made (78 s at 1 vCPU, 2 GiB
and 8 GiB of disk), so its bound is the build's remaining time. The base carries the label agentrun-box-build=<name>,
and a build looks for one by it before it makes one: a ready one is used, a pending one waited for, a failed one
deleted. A base create whose answer is lost (a timeout, a dropped connection, a 5xx) looks again the same way, so the
base Morph made all the same is used, never left. A failed box snapshot, with none other, is refused in words until it
is deleted in the account.
Unverified (the lane's live kit settles them): that the gateway takes the instance's key for the user <instance id>; that SSH lands as root; that morphvm-minimal has apt and dpkg;
that /ttl counts from the call; whether /metadata merges or replaces (the whole map is sent); that a deleted instance
answers 404; the arch (amd64) and the guest's sshd port (22); Morph's longest lifetime (24 h is taken) and whether
activity resets a TTL; whether a snapshot needs its base; and whether instances started from one snapshot share the
guest's RNG state and machine id.
Conformance on Morph
AGENTRUN_COMPUTER_LIVE_MORPH=1 COMPUTER_MORPH_API_KEY=... \
npm run conformance -w @parcha/agentrun-computer -- --provider morph
The conformance module, dist/conformance/morph.js, checks AGENTRUN_COMPUTER_LIVE_MORPH=1 first, then reads
COMPUTER_MORPH_API_KEY (apiKey, required), COMPUTER_MORPH_SNAPSHOT (the run's image, default the box snapshot
prepareImage() finds or builds), COMPUTER_MORPH_API_URL, COMPUTER_MORPH_DAEMON (daemonPath) and
COMPUTER_MORPH_MAX_LIFETIME_MS, never MORPH_API_KEY. Every computer of a run lives at most 30 minutes. The live sweep
is the shared one, dist/conformance/sweep.js --provider morph; its scope is the key's account.
Sources
Morph's OpenAPI (https://cloud.morph.so/api/openapi.json), its docs (https://cloud.morph.so/docs/documentation/instances/ttl),
and its SDKs: morph-python-sdk morphcloud/api.py (ssh_connect) and morph-typescript-sdk src/api.ts (the
gateway and its login), read 2026-11-16. No live run yet.
