An agent's machines
An agent manages the ordinary machines of its project: it creates them, lists and reads them,
labels them, suspends and resumes them, resizes, forks and deletes them. It does so with
space-env machines in its machine. It is how an agent sets up a machine to work on, a copy to
try something risky on, or a fresh one for a job, without anyone opening the portal.
Only an agent’s machine has these calls, and only for the project it is in. Other machines get “only an agent’s machine manages machines”.
What an agent may touch
- Ordinary machines of its own project: the ones people and agents create to work on.
- Deletes only what it made: a machine it created, or one an agent below it created. Any other machine of the project is refused (“was not created by you or an agent you spawned”): the person it belongs to deletes it in the portal.
- Not agents’ machines, its own neither. An agent’s machine goes with its agent (delete the agent to remove it) and is never forked: a copy would run the same agent. For separate work an agent starts a subagent.
- Not the platform’s machines, such as the org’s git service.
The commands
space-env machines
space-env machines create web --mem 4096
space-env machines fork web web-try
space-env machines label web "Web server"
space-env machines timezone web Europe/Amsterdam
space-env machines sleep web-try
space-env machines wake web-try
space-env machines resize web --mem 8192 --disk 40
space-env machines delete web-tryspace-env machines lists them: name, state, size and label. resize changes a machine’s
--vcpus (1 to 8), --mem (256 to 16384 MiB) or --disk (it only grows); a running machine
restarts into its new size, which stops what runs in it, and a suspended one takes it when it
next resumes. create takes --image, --vcpus,
--mem, --disk, --asleep and --timezone. fork makes a new machine of the source’s size from
a copy of its disk; fork --hot copies its memory too, so the copy starts with its programs
running (Hot forks). label sets what the canvas shows (without a label it removes it); timezone
needs a running machine. delete takes the machine with its disk and checkpoints: it is gone for
good, and only a machine the agent or one below it created.
The MCP tools are machines, machine_create, machine_fork, machine_update (label, time
zone), machine_sleep, machine_wake, machine_resize and machine_delete.
To work on one of them, the agent attaches its tools to it: Tools in another machine.
Who a new machine works for
A machine an agent creates or forks is created by the agent’s machine (created_by vm:<id>) and
works for the agent’s owner, like a fork (Who a fork works for).
It holds no more of the platform’s permissions than the agent’s machine does; a fork, no more
than the machine it copies either. It counts against the project’s quota like any other machine.
Resizing its own machine
An agent’s own machine has a fixed size: it is a machine the platform runs for you, and it
doesn’t count against your organization’s running quota, so space-env resize refuses it
(“ana-main is a platform machine (agent): a platform machine has a fixed size”). An agent
that needs more room for a build or a test works on an ordinary machine of the project,
which it can create and resize (above).