Computer Use on the Grid
Computer Use is one shared capability of the Mockarty grid. The same setting
governs a remote runner machine and the local Desktop assistant harness; the
desktop-runner binary is only the executor.
For a standalone Desktop Runner, run mockarty-desktop-runner --version to
check the installed version before connecting it to the grid. On Windows, use
mockarty-desktop-runner.exe --version.
On Linux, run the command from an active X11 session.
How it works
- A machine advertises
runner.task.computer-usein its runner capability
manifest, together with the operations it can execute. - An administrator enables Computer Use on that runner in the fleet view and
sets the allowed applications and approval classes. These are the runner
settings used for both local and remote requests. - A Computer Use request is either executed by the local Desktop helper or
dispatched as a runner task. Both paths use the same request/result contract
(mockarty.computer-use/v1), and the grid policy travels with the task.
Application/window discovery also respects per-application operation limits: both targets and snapshot must be allowed for an application to appear. Its list is bounded and may be incomplete; take a new observation to inspect a different window. Operation names in the fleet and Desktop policy panels use the selected interface language; unfamiliar executor-specific identifiers stay visible as text.
Choose an executor
Send a read-only discovery request to POST /api/v1/computer-use/execute with an
explicit runner from the existing executor catalogue:
{"operation":"targets","executor":{"source":"runner","id":"<runner-id>"}}
Use a returned PID/window pair for a fresh snapshot on that same executor. Keep
its sessionId and explicit executor for subsequent actions; an observation
from another machine cannot be reused. executorRef in the response identifies
where the request ran. To select the current Desktop helper, use
"executor":{"source":"local"}. An unavailable explicit choice is refused;
it does not silently switch to another machine. Existing policy, licence,
application permissions and operator stop still apply.
Operations
| Operation | What it does |
|---|---|
targets |
Lists permitted application windows by application name, bundle ID, PID, window ID and available bounds; no window titles, pixels or contents, and it does not activate a window. |
snapshot |
Reads the accessibility tree of one window (observation only). |
act |
Performs a bounded action on an element from a snapshot. |
type |
Types text into a non-secure field. |
vision |
Locates a control on a canvas or WebView from a screenshot. |
mail_read |
Reads a message through the application’s scripting interface. |
mail_draft |
Creates a draft; sending is not supported. |
Mail permission and approvals
mail_read accepts only mail.operation: "list_unread" or "read_message".
read_message requires mail.messageId as a positive decimal string, for
example "12", without signs, spaces or leading zeros. mail_draft accepts
only mail.operation: "create_draft"; it creates a draft and never sends it.
A read permission cannot be used to create a draft by changing the nested
operation.
The Mail application must be on both the machine’s Computer Use allowlist
and its separate Apple Events/scriptable allowlist. Grid-controlled requests
also require that application’s scriptable permission and the actual
mail_read or mail_draft operation in the runner policy, including any
per-application operation limits. An empty scriptable grant denies access.
If the operator requires approval for the operation’s read or form_edit
class, the Mail bridge currently refuses with approval_required. It does
not have an approval context bound to a window snapshot and element, so it
cannot offer a valid one-time approval for this operation. An approval token
from another action cannot authorize Mail: supplying an unbound token is
refused with approval_context_incomplete. No draft is created by that
refusal; do not treat an approval from another workflow as permission.
Enable it for a runner
- Open the Admin Panel and find the Runner fleet section.
- Find the runner that advertises
computer-use. - Click its Computer Use off button.
- Enter the allowed application bundle identifiers (reverse-DNS, comma
separated) in Allowed applications, for example
com.apple.TextEdit, com.apple.calculator. Prefix an application with!
to also allow reading its data through Apple Events. - Optionally add per-application operation limits with
allowedOperationsByBundle, for example
{"com.apple.calculator": ["snapshot"]}. A listed application may only run
the operations in its entry (intersected with the global set); an
application without an entry keeps the global set. - Confirm. The change is audited as
runner_computer_use_enabled.
To disable it, click the button again and provide a reason. The change is
audited as runner_computer_use_disabled. The fleet card shows the effective
policy, the per-application limits, the kill-switch state and the latest
admission decision.
Per-application editor on the fleet card
Expand Applications, limits and the approval floor on a Computer Use runner
to see three sets side by side:
- Advertised by the runner — what the machine says it can execute.
- Operator operations — what the administrator allowed.
- Effective (advertised ∩ operator) — what dispatch will actually accept.
Each allowlisted application has its own checkbox: clearing it removes only
that application and leaves the rest of the policy (including whether Computer
Use is enabled) untouched. A new application is added by its reverse-DNS bundle
id. If an application stays listed but has an empty per-application operation
entry, the card marks it not effective instead of hiding it, so the gap can
be repaired.
The approval floor is shown with the three mandatory classes —
final_submit, credentials, payment — marked as required. They cannot be
removed by an operator; the list only ever grows. The same panel carries the
per-runner stop, separate from the installation-wide one: releasing a runner
does not restart work while the global switch is still engaged.
Emergency stop (kill switch)
The operator can stop Computer Use without withdrawing the configured policy:
PUT /api/v1/computer-use/kill-switch
{"engaged": true, "reason": "unexpected automation"}
Omit runnerId to stop every runner; pass {"runnerId": "<id>", ...} to stop
one runner. Engaging the switch cancels queued Computer Use tasks immediately
and every admission path refuses new work; a local Desktop helper latches the
stop before the native action. Releasing it restores admission but does not
restore cancelled work. Both decisions are audited as
computer_use_kill_switch_engaged / computer_use_kill_switch_released.
Each node checks the operator stop before admitting work. The runner also
checks it before executing a task it has already received. Stop does not undo
an effect that has already happened.
Read the current state, both scopes and recent decisions:
GET /api/v1/computer-use/kill-switch
API
Read the stored and effective policy:
GET /api/v1/runners/{id}/computer-use
Change the policy (requires integration write permission). The same endpoint
accepts killSwitch/killSwitchReason for a per-runner stop and
allowedOperationsByBundle for per-application limits:
PUT /api/v1/runners/{id}/computer-use
{"enabled": true, "allowedBundles": ["com.apple.TextEdit"],
"allowedOperations": ["targets", "snapshot", "act"],
"allowedOperationsByBundle": {"com.apple.TextEdit": ["targets", "snapshot", "act"]}}
Execute one operation through the unified service. Select a particular
runner explicitly; use {"source":"local"} for this Desktop:
POST /api/v1/computer-use/execute
{"operation": "targets", "executor": {"source": "runner", "id": "<runner-id>"}}
Read the local helper audit ring:
GET /api/v1/computer-use/audit
Desktop records an action’s result in the permanent audit log after the local helper responds. The recent activity ring starts fresh after restarting the helper.
Approving a consequential action
Reads and ordinary navigation run without a prompt. Before an action that
submits data, touches credentials or moves money, Mockarty shows ONE
confirmation containing what will change:
| Field | Meaning |
|---|---|
| Effect | final_submit, credentials or payment |
| Application / window | the exact target application and window id |
| Element | stable element id plus its title and role |
| Current value | the value the element holds in the approved snapshot |
| New value | the value the action will write, or the action’s effect |
| Screen diff | how many elements change, how many stay unchanged, and the window title |
The card is the Approval required region of Desktop → Computer Use; a
read-only action never produces one, and there is no server-wide dialog. The UI
discovers a pending approval by polling, so the card can appear while you are
elsewhere in the pane; Approve once issues the token and Decline ends
the request.
The confirmation is bound to one session, element, action and snapshot hash.
Approving issues a single-use token; the screen is re-verified immediately
before the native action, and a changed screen refuses rather than acting on a
stale approval. Values in a secure field or in a credential/payment action are
shown as <hidden>: the card states that the value changes and which field it
is, never the secret itself. If the approval’s own result is unknown (for
example the helper was reached but its acknowledgement failed), the card does
not retry: inspect the application, take a new snapshot and request a new
approval.
The local helper records the confirmed action in its audit ring with the same
snapshot hash, so a decision can be matched to the exact screen state it
authorised.
Seeing the last action
In Desktop → Computer Use, Recent actions and Where the last action
landed show the local helper’s readback. The position is relative to the
reported window. A refused action has no marker; a missing or unusable position
is shown as unknown rather than placed at an invented point. Changing the
selected profile or workspace clears the previous activity. If activity cannot
be read, the view says so instead of claiming that no actions have run.
A supported macOS helper in an active desktop session shows a compact blue
indicator over the last confirmed target. It moves smoothly to the next target
and shows a brief ring after a click. With Reduce Motion enabled, the indicator
changes position immediately. It stays visible between actions until the helper
clears it or stops. It passes clicks through and leaves the real mouse pointer
and application focus untouched. On a headless helper, activity is available
in the audit readback.
If typing stops after a prefix has been sent, the result is incomplete: part of
the text may already be in the application. The same caution applies to an
unknown action result. Inspect the application and obtain a fresh view before
starting a new action; never repeat the whole text or action blindly. Stopping
does not undo changes already made. Releasing Stop admits new work but does
not resume the interrupted action or restore its old marker, even if that
action finishes late.
macOS permissions (TCC)
Computer Use needs two grants, and Mockarty never grants them for you:
- Accessibility — reading the accessibility tree and injecting input.
- Screen Recording — capturing a window for vision fallback.
When a grant is missing, the run stops with that exact cause and names the
System Settings pane and list entry, for example:
macOS has not granted this Computer Use permission.
Open System Settings → Privacy & Security → Accessibility
and enable “Mockarty”, then re-run the task.
A missing grant stops the run with that cause instead of a generic timeout.
Desktop’s Check permissions button runs the same check and shows the same
panes.
The check is a passive real read of an on-screen application, not the trust
flag alone: macOS answers the trust flag for the responsible process, so a
helper started from a terminal can look granted while its own reads are
refused. The badge shows Granted or Missing; the detail line distinguishes
granted after a successful read; not granted, naming the pane and list entry;
and could not verify when no application window could be read (open one and
re-check). It can also report granted for “Mockarty”, not for this process — use
Computer Use from the app so its helper inherits the app’s grant, and relaunch
the app after enabling the grant. Mockarty never grants or prompts from this
check.
On macOS, in Grid Console → Desktop app testing, select Open Settings
beside a missing permission. Enable the listed entry, then re-check readiness.
If the pane fails to open, go to System Settings → Privacy & Security
and select Screen Recording or Accessibility.
Desktop assistant and Computer Use
Mockarty Desktop hosts the same assistant as the server: the panel uses the
same /api/v1/chat and agent-task handlers, the same tool registry and the same
role checks. A Computer Use chip in the assistant header states the local
capability before a request is made:
- Computer Use ready — helper running, both macOS grants confirmed, and the operator stop check completed successfully. If either check cannot be read, the chip remains unavailable.
- Computer Use needs permission — a macOS grant is missing; the tooltip
names the pane. - Computer Use stopped — the operator kill switch is engaged.
- Computer Use off / unavailable — disabled in settings, helper not running,
or the state could not be read.
Clicking the chip opens the Desktop Computer Use tab with the permission
check and the allowlist.
The assistant performs Computer Use through its ordinary tool catalogue: the
operation is the post_computer-use_execute tool (the same
/api/v1/computer-use/execute route). One request is one tool call, and the
result is returned to the model like any other tool result. A snapshot result
is bounded for the model: it carries snapshotId, snapshotHash and the
actionable or labelled elements, while elementCount states the full tree
size. Pass those element ids to act; take a fresh snapshot if the control you
need is not listed.
Find a runner in a connected Company workspace
In a connected Company Harness session with a Room selected, search for
computer_use and call get_mesh-targets with
{"job":"computer_use"}. The list uses the selected workspace and your
permission to read its executor catalogue.
Choose a host from an external MCP client
Connect your MCP client to the Mockarty installation you intend to use. Its
exposed tools must include get_mesh-targets, post_computer-use_execute and
runner_task_get. The connection’s identity needs access to the selected
namespace. Discovering a machine does not enable Computer Use or grant access
to its applications.
- Call
get_mesh-targetswith yournamespaceandjob: "computer_use".
Choose an eligible candidate whosesourceisrunner. A mesh device ID
is not a runner ID; a device advertising a capability is not sufficient
evidence that this operation can execute there. - Call
post_computer-use_executewith operationtargetsand an explicit
executorfield in the request body:{"source":"runner","id":"<runner-id>"}.
On Desktop,{"source":"local"}selects that Desktop’s helper.
Keep the returnedexecutorRef; an unavailable selection is refused,
rather than silently replaced with another computer. - Select a PID and window ID from
value.targets. This is a bounded list of
permitted windows, without window titles, screen pixels or document text.
Per-application limits must allow bothtargetsandsnapshot. A
truncatedresult is incomplete; the MCP counts describe only the rows
supplied and shown, not the total number of windows on the machine. - Request
snapshotwith a newsessionId, the selectedpid,windowId
and the same executor. Use its exactsnapshotIdand element IDs for
actortype. Keep the namespace, session and executor together. A
snapshot from one computer cannot be used on another; after a helper
restart or an unavailable executor, obtain a fresh observation.
Choose your own unique observation label for sessionId. Keep it until the task
finishes. For act and type, copy the snapshot element’s id into
elementId. For vision, provide the same session, process, window and
snapshot, plus a hint of up to 500 bytes describing the control. The
selected machine needs a configured visual model. Use the accessibility
actions listed on the element, including when navigating a scrollable view.
The administrator must enable Computer Use and its operations on the chosen
runner and allow the application. The machine’s own allowlist, macOS
permissions, operator Stop and required human approvals still apply. Headless
servers do not provide a desktop simply because they serve MCP; select a
connected machine with a supported graphical session. The target marker shows
a confirmed action position, not a recording of physical mouse movement.
If a remote result includes a taskId, keep it. When the outcome is unknown,
call runner_task_get with id equal to that value and the same namespace
to read its status and result. Do not submit the action again to find out
whether it worked. A timeout or a canceled request is not proof that no effect
occurred; inspect the receipt and the target application first.
Replay safety
The local helper keeps a bounded ledger of recent successful operations. A
recorded observation (snapshot) can be replayed as a fresh read. A recorded
mutation (act/type) is replayed only with an explicit approval token bound
to the ORIGINAL session, element, action and snapshot hash, and the ledger entry
is single-use, so a replay cannot produce a second effect. Replay re-runs the
existing pipelines; it is not a second executor.
On Desktop the helper’s ledger is reachable through the product proxy:
GET /api/v1/desktop/computer-use/ledger
POST /api/v1/desktop/computer-use/replay
{"sessionId": "demo", "ledgerId": "r_12", "approvalToken": "..."}
Security
- A runner only receives Computer Use tasks when it advertises the capability
and an administrator enabled the policy with at least one allowed
application. - The effective operation set is the intersection of what the runner advertised
and what the administrator allowed. - Actions that submit data, touch credentials or move money always require a
single-use approval, regardless of the configured policy. - The local helper listens on loopback only, requires a per-launch token and is
never exposed to the local network. - Every executed operation is written to the audit log as
computer_use_action;
the same stream covers local and remote execution. - The kill switch is checked at submission, push delivery and pull delivery.
The helper checks it again in the final native guard and before Mail or
Vision effects. A stop does not undo an effect that has already started. - Replay of a mutation requires a fresh single-use approval bound to the
original snapshot, and each ledger entry can be replayed once. If the native
executor was reached but its acknowledgement failed, the outcome remains
unknown and that replay stays blocked. Inspect the application before
requesting a new action. A refusal before native dispatch may be retried
with a fresh approval.
Local Desktop settings
The local executor is configured in Desktop → Computer Use. These are stored
settings of this Desktop, not server settings.
| What you configure | Where |
|---|---|
| Applications the helper may drive | Desktop → Computer Use → Allowed applications |
| Applications whose data may be read through Apple Events | Desktop → Computer Use → Apple Events applications — each must also be on the allowed list |
| Vision fallback provider, model, key and minimum confidence | Desktop → Computer Use → Vision fallback |
An Apple Events application must also be on the allowed list; the API refuses
the pair otherwise. The vision key is stored locally and never sent to the
server. The grid operator policy still narrows all of it: the effective grant is
the intersection, and the mandatory approval classes cannot be removed.
In the installed macOS Desktop app, Choose application… opens the system
application picker with application names and icons. Choosing an application
only fills a draft: review its name and click Add to save the permission.
Cancelling leaves the draft unchanged. Enter application ID manually remains
available for advanced setup; the native picker is unavailable in a web browser.
Advanced: environment seeds
These are Desktop settings, configured in the interface above. On a headless or
pre-provisioned installation the variables below can seed them at first start;
a value saved in the interface always wins. Desktop → Computer Use → Applications
holds the application lists; Desktop → Computer Use → Vision fallback holds the
vision provider settings.
| Variable | Seeds |
|---|---|
MOCKARTY_CUA_ALLOWED_BUNDLES |
Allowed applications |
MOCKARTY_CUA_SCRIPTABLE_BUNDLES |
Applications readable through Apple Events |
MOCKARTY_CUA_DEV_ALLOW_ALL |
Development switch that allows every application |
MOCKARTY_CUA_VISION_BASE_URL |
Vision fallback base URL |
MOCKARTY_CUA_VISION_MODEL |
Vision fallback model |
MOCKARTY_CUA_VISION_API_KEY |
Vision fallback key |
MOCKARTY_CUA_VISION_CONFIDENCE |
Minimum vision confidence |
Limitations
- One Computer Use action at a time per machine (a machine has one screen).
- Mail is read/draft only.
- Sending messages, deleting data and changing system settings are outside the
contract.