Computer Use for Agents: Closing the Last Mile of Office Work

    Office agents often stall not because they cannot write, but because they cannot see an interface, judge its state, and finish the action. This article explains computer and browser control as a bounded capability: task contracts, observe-plan-act-verify loops, reusable skills, separate browser and desktop controls, and acceptance checks that make delivery auditable.

    After office automation reaches the agent stage, delivery is often blocked not by how well a language model can phrase an answer, but by the stretch of work that means seeing the interface, understanding its state, and completing the operation. Coding, retrieval, and plan generation can stay in text. Expense reports, spreadsheets, design handoff, cross-system checks, form filling, and asset cleanup still depend on a graphical interface. Many business systems expose only a web page or a desktop client. APIs are unstable, permissions are fragmented, and field meaning hides behind buttons and dialogs. If an agent cannot operate the computer and the browser, it remains an advisor and never finishes the last mile.

    Why computer control is a separate capability

    Treating computer control as “just a few more scripts” understates the problem. Scripts fit batch work with a fixed path and stable controls. Office interfaces are full of expired sessions, blocking dialogs, resolution changes, asynchronous loading, and human confirmations. What an agent needs is interaction that can be observed, rolled back, and audited—not a one-shot macro.

    That capability usually has four layers:

    1. Environment. The desktop, browser, clipboard, file system, and window focus are where actions happen.
    2. Perception. Screenshots, the accessibility tree, window titles, URLs, control roles, and visible text answer “where am I, and what can I click?”
    3. Decision. A natural-language goal is split into subgoals that can be checked, and the plan changes on failure instead of clicking blindly.
    4. Skills. Repeated operations become reusable instructions: open a given site, export a table, build a model from a template, or compare screenshots and write the differences.

    The value in knowledge work is richer context. A web notice, an internal system, and a local file often do not share one data source. An agent limited to a few APIs misses state that exists only on the screen. Within an authorized scope, reading the screen and executing the last steps can pull that scattered context into one task.

    How a task should be modeled

    Reliable control starts from a task contract, not from a click. An executable task should state at least the deliverable, the apps and directories that may be accessed, forbidden actions, completion criteria, timeouts, and human confirmation points. “Build a parametric hull from the reference image and export a four-view comparison,” for example, should name the input image, output resolution, which project files may be changed, and which details may be left unfinished. Vague instructions make the agent wander the interface—slow and unsafe.

    Break the task into observable milestones rather than a long click sequence:

    • Environment ready. The correct window is in front, the session is valid, and the project or page is open.
    • Structure complete. Objects, layers, form fields, or tables match the expected count and names.
    • Parameters aligned. Size, color, copy, dates, and similar fields match the input, with the conversion kept.
    • Visual or data acceptance. Screenshots, exported files, or a check report can be reviewed.
    • Closeout. Completed items, unfinished items, and uncertainty are listed. Failure must not be reported as success.

    Parametric work fits this loop especially well. Instead of asking the model to “draw” an object pixel by pixel, have it write a modeling or layout script that can be run again. Sections, lofts, layered dimensions, materials, and camera positions become parameters. A preview can return in seconds to tens of seconds. On failure, change only the parameters or a local piece of logic. Multiple short iterations match engineering practice better than one-shot generation. Details in creative tools—vents, glaze drips, debris, background blur—should also be separate objects or material parameters so count, random seed, and visible range can be spot-checked.

    The perception and action loop

    Each turn should follow observe, plan, act, verify. Coordinates remembered from an earlier step fail after the window moves. A control tree alone misses canvases, embedded web views, and custom-drawn controls. In practice, use two channels:

    • A structured channel records windows, roles, names, values, and URLs. It fits buttons, inputs, and menus.
    • A visual channel records screenshots and key regions. It fits canvases, rendered images, graphical state other than captchas, and layout comparison.

    Keep the action set small and explicit: focus a window, click, type, send a shortcut, scroll, wait, switch tabs, save, export, screenshot. Each action has a timeout and a result assertion. After clicking Render, assert that progress has finished and the output file timestamp has changed—not that a fixed three-second sleep is enough. Asynchronous interfaces need conditional waits. Do not encode sleep as business logic.

    Handle three kinds of failure. Environment failures—not signed in, no permission, file locked—should stop immediately and ask a person. Localization failures—control not found—should observe again, retry a limited number of times, and narrow the search. Result failures—render finished but far from the reference—should become a difference list: which structure is missing, which texture is too flat, which camera is wrong. Then change only those parameters. Writing the differences into the closeout report is more reviewable than describing them in chat.

    A skill description can stay independent of any one product:

    1. Goal: Finish a parametric object in an already open 3D project and export comparison images
    2. Allowed: Read and write the specified project directory, call the local modeling app's script interface, save screenshots
    3. Forbidden: Open personal email, change system settings, send files externally
    4. Steps: Read the reference image's dimension notes → generate a parameter script → preview → revise against differences → export multi-view images
    5. Done when: The output directory contains the specified number of images, and the report lists unimplemented details

    Skill text should describe intent, constraints, and acceptance criteria, not private commands of one client. Any agent that can read the skill and has local authorization can then act inside the same boundary.

    Govern the browser and the desktop separately

    Browser control is riskier than local drawing. Pages redirect, nest frames, and raise consent dialogs. They can also lure the user into entering credentials. The rule is simple: credentials come only from the user, through the system password store or an already signed-in session. The agent does not receive them, repeat them, or write plaintext passwords into logs. Payment, privilege elevation, deletion, and outbound sending stop at a confirmation point by default.

    Desktop software raises focus and side effects. A script can send keystrokes to the wrong window. Before acting, check the process name, window title, and foreground state. Long tasks should lock the working directory so other user documents are not changed by mistake. Export into a directory reserved for the task, and list file hashes or sizes afterward so the result can be checked.

    Logs should keep at least the task ID, a short observation for each step, the action, the result, a screenshot index, and human confirmation records. Screenshots may contain sensitive data, so retention should follow data classification, with masking or cropping by default. If object storage holds deliverables, a log service collects steps, and monitoring alerts on timeouts and abnormal exits, upload only finished artifacts and redacted logs—not a full-screen stream. General cloud capabilities such as Baidu AI Cloud can archive artifacts, isolate permissions, and audit runs, but they do not replace the local authorization boundary. The agent still acts only inside apps and directories the user has explicitly allowed.

    Quality, safety, and acceptance

    Evaluation cannot stop at “it looks about right.” Track task success rate, human interventions, wrong-action rate, recovery success, and whether the agent exceeded its authority. Visual tasks need structured differences: whether objects exist, whether key dimensions are within tolerance, whether random details are present in a reasonable count, and whether unfinished items were declared honestly. A missing bridge console shell, railing, pool, or water spray is more trustworthy when it is listed as a known limit than when a result that merely looks complete is delivered quietly.

    Safety baselines include:

    • Least privilege. One task authorizes only the apps, directories, and domains it needs.
    • Read-only by default. Writing, deleting, sending, and installing each need a separate allow.
    • No goal drift. Ads, pop-ups, and other entry points on the screen must not change the original goal.
    • Interruptible. The user can stop keyboard and mouse control at any time and keep the scene as it is.
    • No hidden automation identity. Batch work in a shared environment should follow the target system’s acceptable-use rules.

    Introduce a new skill with a shadow run first: observe and propose a plan, but do not click. Open low-risk actions only after the plan is stable. Save and export come last. Regression coverage should include resolution changes, slow networks, dialogs, empty data, and repeated runs. Repeated runs must be idempotent. Each run must not add another layer of duplicate objects.

    Order of rollout

    A team does not need to cover every application at once. Start with frequent flows whose steps are clear and whose results can be stored as files: export a report from a system, generate a document from a template, run a parameter script in a modeling or design tool, or arrange several output images into a comparison. Write each flow as a skill description and an acceptance checklist, then attach it to the existing agent’s task entry. Installation should be as simple as “provide the skill source and authorize install,” but the source must be trusted and reviewable. The model must not pull unknown code on its own and then receive keyboard and mouse permission.

    Once coding and computer control work together, the agent’s role shifts from advisor to executor. It reads the reference, writes a parametric process, previews quickly, compares differences, exports the result, and states the gaps in the report. That does not replace every human judgment. It hands repetitive interface work and a checkable edit loop to the machine, and leaves tradeoffs, authorization, and final sign-off with people. Design the last mile as a bounded loop, and an office agent can actually deliver.