Skip to main content

Why agent-native is built for AI

agent-native is specifically designed for AI agent workflows. Unlike traditional automation tools built for human use, agent-native provides:
  • Structured, parseable output with JSON format for every command
  • Stable refs (@n1, @n2) that AI agents can track between operations
  • Self-contained commands that work in stateless environments
  • Rich element metadata including roles, labels, actions, and accessibility attributes
  • Predictable workflow patterns that match how LLMs reason about UI automation
Inspired by agent-browser from Vercel Labs, agent-native brings the same agent-first design philosophy to macOS native applications.
The core workflow (snapshot → interact → re-snapshot) mirrors how AI agents naturally break down UI automation tasks.

Integration patterns

There are three main ways to integrate agent-native with AI agents:

1. Tool calling / function calling

Map each agent-native command to a function/tool in your LLM framework:
Python (OpenAI)
TypeScript (Vercel AI SDK)

2. Direct shell commands

For agents with shell access (like OpenCode, Aider, Claude Code):
Instructions

3. MCP (Model Context Protocol) server

Create an MCP server that wraps agent-native commands:
MCP server example

Example workflows

Toggle Wi-Fi in System Settings

Search and message in Slack

Fill a web form in Safari

Always re-snapshot after UI navigation or state changes. Refs from old snapshots may not resolve correctly after the UI structure changes.

Multi-step automation

AI agents excel at breaking down complex tasks into steps:
The LLM can reason about the navigation hierarchy and dynamically adjust the path if the UI doesn’t match expectations.

Handling uncertainty

AI agents should handle cases where the AX tree doesn’t provide enough information:

Best practices

For detailed guidance on using agent-native effectively with AI agents, see:

JSON output mode

Learn about structured output formats for each command

Best practices

Essential patterns for reliable AI automation

OpenCode skill

Install the pre-built OpenCode skill for instant integration