Technical Article

Computer Use in Microsoft Agent Framework .NET 1.28

Why computer use helps AI agents work with UI-only applications, and how MAF .NET 1.28 carries ordered actions, screenshots, and results through Foundry.

Diagram of a computer use loop: the agent observes a screenshot, proposes ordered actions, and an application executes them before returning a fresh screenshot.

An AI agent can answer a question about a claim, but that does not enter the claim into an old portal. Many business tasks end at a browser form or desktop application that has no usable API. Computer use gives an agent a way to look at that interface, propose mouse and keyboard actions, and inspect a new screenshot after the application performs them. Microsoft Agent Framework (MAF) .NET 1.28 added support for the generally available computer tool and for carrying those calls through Foundry hosting. The Microsoft Foundry computer use guide explains the underlying interaction.

The useful distinction is who does what: the model decides what to try, MAF carries the computer call, and your application remains in control of the computer. A browser driver, permissions, approvals, and screenshots are still application responsibilities.

Why this is useful for an AI agent

A normal agent tool expects a known operation such as CreateClaim(claim) or SearchPolicy(query). Some applications offer neither. A person has to read the screen, find the right field, enter a value, notice a validation message, and decide what to do next. Computer use makes that visible sequence available to an agent.

The model can interpret a screenshot and propose actions such as click, type, scroll, key press, drag, or wait. After the application executes an action, a fresh screenshot lets the model see what actually happened. That feedback is valuable when a page changes after a click, a field moves, or a validation error appears. It allows a workflow to continue from the observed UI state rather than assuming every action succeeded.

Good candidates are UI-only tasks with a clear stopping point: preparing a draft in a legacy portal, checking whether a web workflow reaches the expected screen, or gathering information from an internal desktop application. If a stable, authorized API exists for the same task, it usually offers clearer inputs, stronger validation, and a more predictable result. Computer use is most valuable where the interface itself is the available integration surface.

A concrete example: prepare a claim, then pause

Imagine a claims intake portal that exposes only a web form. A user asks an agent to prepare a record from a supplied claim packet. The intended result is a draft ready for review, not an automatic claim decision or submission.

  • The application gives the agent the task and a screenshot of the portal. The agent identifies the claim ID and incident-date fields.
  • The model proposes an ordered batch: click the claim ID field, type the supplied ID, click the date field, and enter the date. The application validates and performs each action in that order.
  • The application captures the updated page. If the portal shows an invalid-date message, the next model turn can respond to that visible result instead of claiming the form is complete.
  • When the form reaches Submit, the application pauses for a person to review the values. It does not let the agent silently complete the consequential action.
A three-step claims intake example: read supplied details, fill fields in a UI-only portal, then pause for human review before submission.
Illustrative UI-only workflow: the agent prepares fields, while the application holds submission for review.

The same pattern can help with a software test that checks whether a checkout page reaches the confirmation screen, or an internal application where staff otherwise copy information between screens. In each case, the application must define which pages and actions are in scope. The model's ability to read a screen does not grant it permission to act everywhere on that screen.

What Microsoft added in MAF .NET 1.28

The release adds three pieces that matter to a .NET developer:

  • GA computer tool registration. The parameterless FoundryAITool.CreateComputerTool() represents the new {"type":"computer"} tool. The older preview overload takes an environment and display dimensions. The GA definition is simpler, but the browser driver still needs the real viewport size to map action coordinates to pixels.
  • Computer calls through Foundry hosting. MAF now carries computer_call and computer_call_output items between the model and a hosted caller. Before this addition, a hosted loop could lose those computer-specific items, so returning a screenshot and continuing the task was not a complete path.
  • Ordered action batches. A GA computer_call can include actions[] rather than one preview action. One model turn might request a click, typing, and a key press. The application must execute the actions sequentially and send back the resulting screenshot with the matching call_id.

Batched actions can reduce model round trips for a short sequence, but they do not make execution automatic. Every action still needs to be permitted and carried out by the application. The Foundry documentation describes the GA schema and the preview-to-GA change.

The screenshot loop in a .NET application

The loop is easiest to understand as three actors. The model reads a screenshot and returns a computer call. MAF exposes that call and carries the response through the agent integration. The application checks the proposed actions, drives an isolated browser or desktop, and returns a real screenshot. The diagram above the article shows one complete turn.

In practice, a turn looks like this:

  • Send the user task and an initial screenshot with a supported model deployment.
  • Read the returned computer_call, including its call_id, ordered actions[], and any pending safety checks.
  • Pause for approval when required. Validate the destination and each action, then execute the batch in order. Stop dependent actions if one fails.
  • Capture a fresh screenshot of the actual screen and return it as computer_call_output with the same call_id.
  • Continue the same agent session until the task is complete, the user stops it, or a configured time or action limit is reached.

Microsoft's Foundry .NET walkthrough shows an AIProjectClient.AsAIAgent(...) registration using the GA tool shape:

ResponseTool computerTool = ModelReaderWriter.Read<ResponseTool>(
    BinaryData.FromObjectAsJson(new { type = "computer" }));

AIAgent agent = projectClient.AsAIAgent(
    model: deploymentName,
    name: "ComputerAgent",
    instructions: "Use the browser to complete the requested task.",
    tools: [computerTool.AsAITool()]);

This excerpt only registers the tool; it assumes a configured project client, a compatible model deployment, and the packages used by the guide. The walkthrough's action handler uses pre-captured screenshots to simulate a browser. For a real task, replace that simulation with an action executor and screenshot capture that report the true UI state. MAF 1.28 also introduced FoundryAITool.CreateComputerTool() for GA registration; use the form supported by your endpoint and SDK versions.

What the application must decide

Computer use is powerful because it can act through an interface, so the application needs explicit boundaries. Give it an isolated browser or desktop with only the account and data the task needs. Keep screenshots and action coordinates aligned when the viewport changes. Limit both model turns and actions per batch; one turn can contain several clicks or keystrokes. Treat text displayed by a webpage as untrusted task data, not an instruction to override the user's request.

For a consequential step such as Submit, Send, Purchase, or a destructive edit, pause before that action and any actions that depend on it. Present the actual proposed step to the user. If the model returns pending safety checks, show them and continue only after the required approval. A failed click, unexpected page, or partial batch should stop the loop with an honest status rather than a claim of completion.

There is also a version detail. At the MAF 1.28 release, the Foundry project endpoint still used the preview computer tool, while the GA path targeted supported Azure OpenAI integrations. The current Foundry guide shows a GA computer example through AsAIAgent. Check your endpoint, model deployment, and SDK versions before choosing a sample; do not combine the preview tool's action handler with the GA actions[] protocol. For a non-hosted GA loop on the 1.28 stack, stored-response continuation also avoids a known locally replayed-call serialization limitation.

Computer use is useful when an AI task must cross a UI boundary that otherwise needs a person. MAF makes the model's computer calls available to a .NET agent and supports the new batched protocol. The result is a practical integration point, provided the application supplies a real environment, observes the outcome, and keeps the final authority over actions.

An unhandled error has occurred. Reload