Writing

What Computer-Use Agents Need Before We Trust Them

AgentDesk is my exploration of the policy, observability, evaluation, and cost-control layers computer-use agents need before they belong in real workflows.

TL;DR

  • Computer-use agents are compelling because they can operate real interfaces. That is also what makes them risky.
  • I built AgentDesk to explore the control plane around the agent: policy gates, approval boundaries, trajectory recording, deterministic evaluation, failure classification, cost limits, and replayable reports.
  • The v0.1 release uses declarative tasks and a deterministic planner inside a fresh Playwright browser context. It does not claim to provide unrestricted desktop control or hardened isolation.
  • The central design principle is simple: a model may propose an action, but the surrounding system must decide whether that action can execute.
  • Before we give the raccoon a keyboard, we should probably build the enclosure.

The demo is not the system

A lot of computer-use demos are impressive for about 90 seconds.

The agent opens a browser. It reads a page. It clicks something. It fills out a form. Everyone claps. The demo gods are pleased.

Then the real questions show up.

What if it clicks the wrong button? What if it submits a form too early? What if a page contains malicious instructions? What if the agent loops until the run becomes an infrastructure bill? What if it appears to succeed but fails the actual task? What if nobody can reconstruct what happened?

This is where a capability demo becomes a systems-engineering problem.

A chatbot producing a weak answer is annoying. A computer-use agent taking the wrong action can create side effects. Once a model can navigate, type, submit, download, or eventually interact with an operating system, the risk model changes.

That is the problem I wanted to explore with AgentDesk:

What needs to exist around a computer-use agent before we should trust it in a real workflow?

Not as a strategy slide. In code, with policies, logs, evaluations, reports, and explicit failure categories.

What AgentDesk is

AgentDesk is an open-source reference implementation of a control plane for computer-use-style agents.

The v0.1 MVP runs declarative YAML tasks through a replaceable planner interface. It executes them in a fresh Playwright Chromium context, applies policy before each action, records what happened, evaluates the persisted evidence, and produces a Markdown report that can be reviewed through an optional local Streamlit dashboard.

It includes:

  • Strictly validated policy rules for actions, domains, local paths, approvals, steps, runtime, and estimated cost
  • A fresh browser context with no persistent user profile and downloads disabled
  • Typed action and approval outcomes
  • JSON trajectories containing observations, proposals, policy decisions, execution results, latency, and cost
  • Deterministic task assertions and a structured failure taxonomy
  • Markdown reports and a localhost-only replay viewer
  • Configurable, provider-neutral cost estimates
  • Tests covering the policy engine, loop, browser executor, evaluator, recorder, and cost tracker

The first version deliberately uses a controlled browser and deterministic planner instead of an LLM driving a real desktop.

That is a constraint, but it is also the point. I wanted to test the safety, evidence, evaluation, and reporting layers before adding model variability and a much larger action surface.

The agent is not the whole system.

The system around the agent is what makes it inspectable, governable, and eventually useful.

Seven layers of production readiness

I think about AgentDesk as seven layers wrapped around execution.

LayerWhat it contributes
Controlled executionA smaller, disposable browser surface instead of a persistent personal environment
Policy enforcementAllowed, blocked, and approval-required decisions before execution
Trajectory recordingEvidence of every observation, proposal, decision, and outcome
Deterministic evaluationExplicit assertions instead of “it looked like it worked”
Failure classificationSpecific categories for policy, budget, tool, assertion, and planner failures
Cost trackingStep-level estimates and run-level budgets
Replayable reportingArtifacts a reviewer can inspect after the run

The main idea is simple:

Do not just build the agent. Build the system that keeps the agent accountable.

Put policy before execution

The most important architectural decision is where the policy engine sits.

flowchart TD
    A[Task] --> B[Planner proposes action]
    B --> C[Policy engine]
    C -->|Allowed| D[Browser executor]
    C -->|Approval required| E[Approval gate]
    C -->|Blocked| F[Stop and record]
    E -->|Approved| D
    E -->|Not granted| F
    D --> G[Capture observation and result]
    G --> H[Trajectory]
    H --> I[Deterministic evaluator]
    I --> J[Report and replay dashboard]

Policy sits upstream of execution.

If the planner proposes a dangerous action, the system should catch it before the action touches the environment. Logging a bad action after it happens is not a safety system. It is a very well-documented mistake.

AgentDesk loads policy from external YAML rather than hiding it in a planner prompt. A policy can block actions such as payments, file deletion, shell commands, package installation, or password changes. It can require approval for form submissions, downloads, or external navigation. It can also constrain domains, local file roots, step counts, runtime, and projected cost.

Every proposal receives one of three decisions:

DecisionMeaning
allowedThe executor may perform the action
approval_requiredThe action needs an explicit approval outcome
blockedThe action must not execute

The policy schema is strict. Unknown keys, missing controls, invalid limits, and blank rules fail validation instead of silently producing a more permissive run.

That distinction matters. The planner proposes. The system authorizes.

Evidence before confidence

Every AgentDesk step is recorded as a structured trajectory.

The record includes the current URL, screenshot path, visible-text hash, proposed action, concise decision summary, policy result, approval outcome, execution status, latency, and estimated cost.

The loop writes a pending record before it calls the executor, then updates that record atomically. If execution crashes, the authorization evidence does not disappear with it.

An abbreviated step looks like this:

{
  "step_id": 4,
  "observation": {
    "current_url": "file:///workspace/examples/local_invoice.html",
    "visible_text_hash": "3ca26d38dd69b...",
    "screenshot_path": "runs/local-invoice/screenshots/step-004.png"
  },
  "proposed_action": {
    "action_type": "submit_form",
    "target": "#invoice-form",
    "decision_summary": "Form submission must pass the approval gate."
  },
  "policy_decision": {
    "status": "approval_required",
    "matched_rule": "approval_required.form_submit",
    "risk_level": "medium"
  },
  "approval_outcome": "approved",
  "execution_result": {
    "status": "success"
  },
  "latency_ms": 14.761,
  "estimated_cost_usd": 0.005
}

AgentDesk does not record private chain-of-thought. It records the evidence needed to understand the system: observations, concise action rationale, proposed actions, control decisions, and outcomes.

That creates a shared evidence layer for evaluation, reports, replay, and debugging.

Evaluation cannot be vibes

“It looked like it worked” is not an evaluation strategy.

The first AgentDesk fixture is intentionally simple. A local page displays invoice #1048, including a total of $1,248.92. The task must read the page, enter the total, pass an approval gate before submitting the form, verify the success message, and return a concise answer.

The task defines explicit assertions:

assertions:
  - type: contains_text
    value: "$1,248.92"
  - type: contains_text
    value: "Success: invoice total confirmed."
  - type: max_steps
    value: 20
  - type: no_policy_violations
    value: true
  - type: final_status
    value: success
  - type: max_cost_usd
    value: 1.0

The evaluator reads the task and the persisted trajectory. It does not browse, call a model, or ask the planner to grade itself.

A verified local run produced this scorecard:

task_success: true
steps_taken: 6
policy_violations: 0
approval_requests: 1
blocked_actions: 0
runtime_seconds: 0.661
estimated_cost_usd: 0.03
failure_category: NONE
final_answer: "Invoice #1048 total is $1,248.92; the local form confirmed success."

The runtime is machine-dependent and not presented as a benchmark. What matters is the evidence contract: assertions, control decisions, outcomes, and costs are explicit.

The task is basic by design. Controlled fixtures let us test the control plane without confusing its defects with model nondeterminism or a website changing underneath us.

Chaos becomes more useful after you have a measuring stick.

”The agent failed” is not a diagnosis

An agent can fail because it misread a screen. It can target an element that does not exist. It can repeat an action without making progress. Policy can prevent a required action. The browser can fail. The task can be ambiguous. A run can exceed its budget.

Those are different engineering problems, so AgentDesk gives them different names.

Failure categoryWhat it means
POLICY_BLOCKEDPolicy or a missing approval prevented completion
LOOPING_BEHAVIORA step limit stopped a run that was not making progress
TOOL_EXECUTION_ERRORThe browser, executor, pending action, or run failed
EXCEEDED_BUDGETA policy or assertion cost limit was exceeded
UNSAFE_ACTION_ATTEMPTThe planner attempted a prohibited action or domain
ASSERTION_FAILEDThe recorded evidence did not satisfy the task
TASK_AMBIGUITYThe run failed without a more specific observable cause

The schema also reserves perception-specific categories such as VISUAL_MISREAD, BAD_CLICK_TARGET, and HALLUCINATED_UI_ELEMENT.

The deterministic v0.1 evaluator does not assign those categories without supporting evidence. It only claims what it can prove from the trajectory.

That restraint is important. A taxonomy is useful only if it improves diagnosis instead of giving uncertainty a more official-looking label.

Cost belongs inside the loop

Computer-use agents tend to be multi-step systems.

They process a screenshot. Propose an action. Execute. Observe again. Maybe retry. Maybe get confused. Maybe click around like someone trying to find the unsubscribe button on a gym membership website.

Those loops can become expensive.

AgentDesk tracks configurable estimates for input tokens, output tokens, screenshots, and executed actions. Before each action, the loop evaluates projected cost against the policy budget. The evaluator also checks the final run against task-level cost assertions.

The rates are provider-neutral placeholders, not billing claims. The deterministic invoice demo uses no model tokens; its estimate comes from screenshots and actions.

The exact estimate is less important than the architectural decision:

Cost is a runtime constraint, not a spreadsheet someone remembers to update later.

The tradeoffs are part of the design

AgentDesk v0.1 makes several deliberate tradeoffs.

Browser automation before desktop control

A fresh Playwright browser context is smaller, easier to inspect, and easier to evaluate than a general-purpose desktop. It does not cover native applications, and it is not VM-grade isolation.

Future desktop executors should run in hardened, disposable environments rather than inheriting trust from the agent process.

Deterministic planner before an LLM planner

The deterministic planner makes the control plane testable. It is not autonomous, but autonomy is not the first claim this project needs to prove.

A future schema-constrained model planner should be replaceable without bypassing policy checks or changing the evidence contract.

Hard blocks plus approval gates

Some actions should never run. Others are context-sensitive and need a human decision.

AgentDesk represents those as separate outcomes. In v0.1, the CLI can explicitly approve all sensitive actions for a controlled fixture, but that approval is run-wide and unauthenticated. Real deployments need per-action, identity-bound approval.

Local execution before hardened remote isolation

The current browser shares the host operating system. It does not enforce network egress across every redirect, popup, or page-initiated request. Screenshots and visible text are not redacted or encrypted.

Those are not footnotes. They define what the project is safe to claim.

What AgentDesk does not claim

AgentDesk v0.1 is a reference implementation, not a production security product.

It does not:

  • Control a real desktop or native applications
  • Provide VM-grade isolation
  • Operate personal or authenticated accounts
  • Send email, make purchases, modify calendars, or change passwords
  • Store or broker credentials
  • Eliminate prompt injection or computer-use risk
  • Provide authenticated, per-action human approval

It should not be used for high-risk or irreversible workflows.

Production use would require disposable execution, network controls, credential isolation, artifact protection, authenticated approvals, independent monitoring, and security review.

Trust starts with being precise about the boundary.

Where it goes next

The roadmap moves outward from the control plane:

  • Stronger navigation controls across redirects, popups, and browser requests
  • Per-action approval through an explicit approval-provider interface
  • Screenshot diffing and more deterministic fixtures
  • Schema-constrained LLM planner adapters
  • Prompt-injection and adversarial UI tasks
  • Provider-aware usage accounting
  • Disposable remote browser and desktop environments
  • Organization-level policy packs
  • OpenTelemetry-compatible traces, metrics, and logs

Provider-specific computer-use integrations come later, after the control and evidence layers are stronger.

That order is intentional.

The real frontier is trustworthy action

The future of AI will not be limited to models answering questions. Models will increasingly operate tools, workflows, systems, and interfaces.

That makes the engineering problem larger than model capability.

We need to think about autonomy, permissions, state, evaluation, observability, cost, failure modes, containment, and human control.

A computer-use agent that can click buttons is interesting.

A computer-use agent that can be constrained, observed, evaluated, replayed, stopped, and improved is useful.

That is the difference I am exploring with AgentDesk.

Because if we are going to give AI systems the ability to use computers, we should probably give ourselves the ability to understand what they did.

Seems fair.