How agents see and use a machine
An AI agent sees a machine through screenshots and window controls, and acts on it through OSMates' MCP tools.
The MCP reference defines every tool. To connect an agent, see Connect an agent.
Screenshots and input
An agent takes a screenshot, then acts on coordinates in it, with the screenshot's frameId as frame_id. After the display changes size or the machine starts again, the frameId is stale, and the agent takes a new screenshot.
input_actions takes the computer-use actions of Anthropic, OpenAI, and Gemini. Each result is one of these:
| Result | Meaning |
|---|---|
verified |
The screen changed |
unverified |
The input arrived, but the screen didn't change within a second |
failed |
The action failed, and the ones after it didn't run |
Pressed keys and buttons go up when the agent's session ends, even if its program is killed.
Window controls
On Windows, macOS, and a Linux desktop, the agent reads window controls with screen_elements, then acts on a returned reference with element_action.
| Argument | Returns |
|---|---|
mode: "interactive" |
The controls that take actions |
mode: "skeleton" |
The first levels, with a count of their children |
since with a readId |
Only what changed since that read |
A full read of a large window stops at 32 KiB and has no readId. Wayland gives controls no position boxes. On macOS, allow OSMates Agent once first.
Text and keys
Text types on the guest's keyboard layout. type_text pastes what the layout can't type, and types for at most 30 seconds a call. On Linux it types only on the US layout and pastes otherwise. On macOS, Command and Control shortcuts follow the layout, so Command-V pastes on Dvorak and French layouts too.
vm_sign_in signs in with the password in your Keychain, which never appears in a tool result. To give an agent an API token it can use but not read, grant a credential.
Long calls and errors
A long call waits wait_seconds, 20 by default and 30 at most, then returns a job. The agent follows the job with job_output.
vm_start and vm_run wait while no machine can start, and the job's progress names the running ones. With queue: false, the call refuses instead.
A failure explains itself in error.message. Its actions list calls that recover, with the arguments to supply under needs. A destructive action discards something, such as saved memory, so an agent runs it only when you asked for that change.
Machines, networks, and devices
vm_createtakes an arm64 Linux disk image as an HTTPS URL with achecksum, or as a local file.user_datatakes cloud-init user-data.- For a Linux desktop, an agent uses
debian-13-desktoporomarchy, which sign in by themselves and never lock. Machines an agent creates use the US keyboard. vm_importbrings in another app's machine. It needs the Full profile, and you approve the path each time. Withcheck, it creates nothing.vm_egresscan only narrow network access, and only you can widen it or add a rule. A clone keeps the original's access, or narrower withegress_mode.- Only you can give OSMates a USB device.
vm_usb_deviceslists those devices, andvm_usb_attachandvm_usb_detachneed the Full profile and theusbpermission.
Run an accessibility tool inside a machine
An agent can run a command-line accessibility tool inside a machine. The tool works on the machine's apps, never on your Mac.
- Take a snapshot with
vm_snapshot, or work in a clone, sovm_revertremoves the tool again. - Download the tool with
vm_execanddesktop, then check it against the checksum its release publishes. - On macOS, allow OSMates Agent before the tool starts.
- Run the tool with
vm_execanddesktop, which reaches the windowsscreen_elementsreads. Addbackgroundfor a tool that keeps running, such as a server. - Stop it with
job_cancel.
On Windows, a UI Automation tool needs no permission, but can't use a program that runs as administrator. On a Linux desktop, an AT-SPI tool gets the desktop's display and session bus. On macOS, a tool that opens an app of its own needs the same permission for that app.
Text from the guest
Text from a machine can hold instructions aimed at your agent, in files, clipboard data, logs, screen text, control names, and host names. Agents must treat it as data.
Guest text is wrapped in <guest-data> and </guest-data>, and in structured results it's under guestData. Control and invisible characters are spelled out, such as \u{1b}, so guest text can't close the wrapper. The marks grant nothing: profiles and your permissions decide what the agent can do.
A result holds at most 32 KiB of guest text, and a program returns 16 KiB for each output stream. For the rest, the agent calls job_output or vm_read_file, or copies the whole file with vm_pull.