Agent! for macOS26

September 21, 2026 Β· View on GitHub

< Back to README

Agent! Agentic AI for the rest of us only on ο£Ώ macOS Desktop

Agent! for macOS26

Swift 6.2 Website Version GitHub downloads GitHub stars

Latest source code of Agent! running

Agent! running inside a virtual machine

Screenshot 2026-03-26 at 5 22 43β€―PM

🧠 Agentic AI for the  Mac Desktop

Agent! is the result of 27 years of Mac automation experience β€” from FaceSpan and AppleScript on macOS 9 through AppleScript Studio, AppleScript-ObjC, and now Swift. It connects LLMs to Apple Events, ScriptingBridge, Accessibility APIs, and XPC services for native macOS control.

Now with Apple Intelligence supporting 10 LLM providers.

Apple Intelligence Mediator

Apple Intelligence serves as a communication mediator between the LLM and the user, not as an LLM provider. It observes conversations and adds helpful context using on-device intelligence:

Annotations are tagged with [ο£ΏAI] prefixes to distinguish them from LLM responses.

Enable Apple Intelligence Mediator in Settings to enhance communication clarity. Requires Apple Intelligence-capable Mac running macOS 26+.

Key Capabilities

  • 50+ App Automation via ScriptingBridge (Mail, Messages, Music, Safari, Xcode, etc.)
    • 86 Tools for file ops, git, web, accessibility, Xcode, MCP integration
    • AgentScripts β€” Swift Package-based automation scripts
    • Apple Messages Monitor β€” Remote control via iMessage
    • MCP Support β€” Model Context Protocol for extended functionality

Table of Contents


Getting Started

1. Prerequisites

  • macOS 26+ (Tahoe)
  • Xcode Command Line Tools (Agent will prompt to install if missing)
  • Apple Silicon recommended for local LLMs (minimum 32GB RAM, recommended 64-128GB)
  • An API key for your preferred provider

2. Build and Run

  1. Open Agent.xcodeproj in Xcode
  2. Build and run the Agent! target (⌘R)
  3. If prompted, install Xcode Command Line Tools via the system check overlay

3. Register Background Services

Click the Register button in the toolbar to install the background services:

This registers two background services using Apple's SMAppService framework:

  1. User Agent (Agent.app.toddbruss.user) β€” Runs commands as your user account
  2. Privileged Daemon (Agent.app.toddbruss.helper) β€” Runs commands as root when needed

4. Approve in System Settings

After clicking Register, macOS will prompt you to approve the background services:

  1. System Settings β†’ General β†’ Login Items
  2. Allow both Agent and AgentHelper (you may see two prompts)

The privileged daemon requires explicit approval because it runs with root privileges. Agent follows Apple's recommended XPC + SMAppService pattern for secure privilege separation.

5. Configure Your Provider

Click the gear icon (βš™οΈ) to open Settings and configure one of the 10 supported providers:

Supported Providers (Click to expand)
ProviderModelsNotes
ClaudeSonnet 4, Opus 4, Haiku 3.5Recommended for complex tasks
OpenAIGPT-4o, GPT-4 Turbo, GPT-3.5General-purpose option
DeepSeekDeepSeek V2, DeepSeek CoderCost-effective
Hugging FaceAny model IDDirect model access
Ollama CloudVariousOllama Pro API
Local OllamaLocal modelsRequires 32GB+ RAM
vLLMOpenAI-compatibleSelf-hosted
LM StudioOpenAI/AnthropicLocal hosting

Note: Local models require significant RAM (minimum 32GB, recommended 64-128GB). For Mac minis or devices with limited RAM, cloud-based LLMs are strongly recommended.

6. Set a Project Folder (optional)

Click the folder icon in the toolbar to select a project folder or file. This sets a default working directory for file operations.

7. Connect and Run

  1. Click Connect to test the XPC services
  2. Type a task in natural language
  3. Press Run (or ⌘Enter)

Agent will autonomously execute your task using the appropriate tools.


Security Hardening

Agent! implements a comprehensive security model based on Apple's recommended patterns:

Dual Privilege Model

Privilege Model Details (Click to expand)
ServiceIdentifierRuns AsPurpose
User AgentAgent.app.toddbruss.userUser accountFile editing, git, builds, scripts
Privileged DaemonAgent.app.toddbruss.helperRoot (via LaunchDaemon)System packages, /Library, launchd, disk operations
The AI defaults to **user-level execution** and only uses the privileged daemon when explicitly required for system-level operations.
Full Entitlements & Security Details (Click to expand)

TCC Permissions

ComponentTCC Grants
run_agent_script, applescript_tool, TCC shell commandsALL (Accessibility, Screen Recording, Automation)
execute_user_command (LaunchAgent)None
execute_command (root)Separate context

Rule: Use run_agent_script or applescript_tool for Accessibility/Automation tasks, not shell commands.

Full Entitlements List

EntitlementPurpose
automation.apple-eventsAppleScript and ScriptingBridge automation
cs.allow-unsigned-executable-memoryRequired for dlopen'd AgentScript dylibs
cs.disable-library-validationLoad user-compiled script dylibs at runtime
assets.music.read-writeMusic library access via MusicBridge
device.audio-inputMicrophone access for audio scripts
device.bluetoothBluetooth device interaction
device.cameraCamera capture (CapturePhoto script)
device.usbUSB device access
files.downloads.read-writeRead/write Downloads folder
files.user-selected.read-writeRead/write user-selected files
network.clientOutbound connections (API calls, web search)
network.serverInbound connections (MCP HTTP/SSE transport)
personal-information.addressbookContacts access via ContactsBridge
personal-information.calendarsCalendar access via CalendarBridge
personal-information.locationLocation services
personal-information.photos-libraryPhotos access via PhotosBridge
keychain-access-groupsSecure API key storage

See SECURITY.md for complete XPC architecture details.


Messages Monitor

Agent! includes a built-in Apple Messages monitor that lets you control your Mac remotely via iMessage. Send a text message starting with Agent! from any approved contact and Agent will execute it as a task β€” then reply with the result.

Dedicated Messages Tab

Agent! now features a dedicated Messages tab (green) specifically for iMessage Agent! commands. This tab:

  • Uses the main LLM for processing (not a separate model)
  • Provides a focused interface for remote command execution
  • Shows real-time message monitoring status
  • Integrates seamlessly with the Messages Monitor popover

How It Works

  1. Toggle Messages ON in the toolbar (green switch next to "Messages")
  2. Click the speech bubble icon to open the Messages Monitor popover
  3. Send a message starting with Agent! from another device or contact (e.g., Agent! Next Song)
  4. The sender's handle (phone number or email) appears in the recipients list
  5. Toggle the recipient ON to approve them
  6. Future Agent! messages from approved recipients will automatically run as tasks
  7. When the task completes, Agent sends the result (up to 256 characters) back via iMessage

Message Format

Agent! <your prompt here>

Examples:

  • Agent! What song is playing?
  • Agent! Next Song
  • Agent! Check my email
  • Agent! Build and run my Xcode project

Message Filter

The filter picker controls which messages are monitored:

Filter Options (Click to expand)
FilterDescription
From OthersOnly incoming messages from other people (default)
From MeOnly your own sent messages (useful for self-testing between your devices)
BothAll messages regardless of sender

Recipient Approval

Every recipient must be explicitly approved before their Agent! commands trigger tasks:

  • Recipients are auto-discovered when they send an Agent! message
  • Unapproved messages are logged with a "not approved" note but not acted on
  • Use All / None buttons to bulk-toggle recipients within the current filter
  • Use Clear to remove all discovered recipients and start fresh

How It Reads Messages

Agent reads the macOS Messages database (~/Library/Messages/chat.db) directly using the SQLite3 C API. It polls every 5 seconds for new messages. The attributedBody blob is decoded using the Objective-C runtime for messages where the text column is NULL (common with iMessage).

No external dependencies. No network requests. Everything runs locally on your Mac.


MCP Servers

Agent! supports MCP (Model Context Protocol) servers for extended functionality.

Available MCP Servers

MCP Server List (Click to expand)
ServerDescriptionLink
internet-names-mcpDomain and social handle availabilityhttps://github.com/drewster99/InternetNamesMCP
xcode-mcp-serverXcode project building, running, screenshotshttps://github.com/drewster99/xcode-mcp-server
appstore-mcp-serverApp Store search, rankings, keywordshttps://github.com/drewster99/appstore-mcp-server
XCFExternal MCP serverhttps://xcf.ai

Configuration

  1. Click the server icon in toolbar β†’ + to add
  2. Configure: Name, Command, Arguments, Environment, Transport (stdio/HTTP/SSE)
  3. Enable Auto-start to connect on launch
  4. Enable/disable individual tools per server as needed

Architecture

Agent.app (SwiftUI)
  |-- AgentViewModel         Task loop, screenshots, clipboard, project folder
  |-- ClaudeService          Anthropic Messages API (streaming)
  |-- OllamaService          Ollama native API
  |-- ChatHistoryStore       SwiftData task memory
  |-- CodingService          File operations
  |-- MCPService             MCP client for external tools
  |-- ScriptService          Swift Package for agent scripts
  |-- XcodeService           Xcode ScriptingBridge
  |-- AppleEventService      Dynamic Apple Events
  |-- AccessibilityService   AXUIElement API
  |-- Messages Monitor       iMessage remote control

Execution contexts:
  |-- [In-Process]           TCC commands (ALL grants)
  |-- UserService XPC        LaunchAgent (user)
  |-- HelperService XPC      LaunchDaemon (root)

App Automation Priority

Tool Priority Table (Click to expand)
PriorityToolBest For
1run_agent_scriptComplex automation (full TCC)
2applescript_toolReading app data and AppleScript automation
3execute_shell_command (TCC)Quick one-off AppleScript commands
4Accessibility toolsUI inspection and interaction

Coding Tools Priority

Coding Tools Priority (Click to expand)
PriorityTool TypeExamples
1Native toolsread_file, write_file, edit_file, git, xcode
2MCP server toolsmcp_xcf_*
3Shell commandsLast resort only

Xcode Build Priority

For Xcode project builds, the AI follows this priority:

Xcode Build Priority (Click to expand)
PriorityToolWhen to Use
1xcode_buildNative ScriptingBridge tool β€” ALWAYS PREFERRED
2XCF MCP server (mcp_xcf_*)Backup if native tools unavailable
3xcode-mcp-server (mcp_xcode-mcp-server_*)Third choice if XCF unavailable
4xcodebuild via shellLAST RESORT only if no other options

System Prompt Version Management

Agent! manages system prompts with automatic version tracking:

Version Headers Table (Click to expand)
HeaderBehavior
// Agent! v{version}Default prompt β€” auto-updates when app version changes
// Agent! custom v{version}User-edited prompt β€” auto-updates on version change (preserves custom edits)
// Agent! READ ONLY v{version}Locked prompt β€” never auto-overwritten, even on version changes

To lock a prompt: Add READ ONLY or // READ ONLY at the top of your custom prompt. This prevents automatic updates even when a new Agent! version is released.

Prompts are stored in ~/Documents/AgentScript/system/ as {provider}.txt files.


Available Tools

Agent! provides 86 tools across multiple categories for autonomous task execution.

Quick Reference

CategoryToolsDescription
Core28File ops, git, web, text generation
Agent Scripts7Create, run, manage Swift scripts
AppleScript/JS11AppleScript and JXA automation
Accessibility12UI automation via AXUIElement API
Xcode7Build, run, manage Xcode projects
MCP β€” XCF21Xcode project automation via MCP

Core Tools (28 tools)

ToolDescription
about_selfDescribe Agent's capabilities, features, and usage
read_fileRead file contents with line numbers
write_fileCreate or overwrite a file
edit_fileReplace exact text in a file
list_filesFind files matching a glob pattern
search_filesSearch file contents by regex pattern
read_dirList directory contents
create_diffCompare two text strings and return a pretty D1F diff with emoji markers
apply_diffApply a D1F ASCII diff to a file for precise multi-line edits
diff_and_applyEdit a file by line range in one step
undo_editUndo a previous diff edit
file_managerUnified file operations (read, write, edit, list, search, read_dir, if_to_switch, extract_function)
gitGit operations (status, diff, log, commit, diff_patch, branch)
execute_agent_commandExecute shell command as current user (no TCC)
execute_daemon_commandExecute shell command as ROOT via LaunchDaemon (no TCC)
run_shell_scriptRun shell command or script (alias for execute_agent_command)
batch_commandsRun multiple shell commands sequentially in one call
batch_toolsRun multiple tool calls sequentially in one batch
plan_modeManage step-by-step plans (create, update, read, list, delete)
task_completeSignal that a task has been completed
write_textGenerate well-structured prose on any topic
transform_textConvert text into different formats (lists, outlines, summaries, tables)
fix_textCorrect spelling and grammar errors
send_messageSend message via iMessage, email, or other channels
webWeb browser automation (open, scan, click, type, execute_js, etc.)
web_searchSearch the web for current information
lookup_sdefLook up an app's AppleScript scripting dictionary
list_toolsList all enabled tools (built-in and MCP)

Agent Scripts (7 tools)

ToolDescription
agent (list)List all Swift automation scripts
agent (read)Read source code of a script
agent (create)Create a new Swift script
agent (update)Update an existing script
agent (run)Compile and run a Swift dylib script
agent (delete)Delete a script
agent (combine)Merge two scripts together

AppleScript & JavaScript (11 tools)

ToolDescription
applescript_tool (execute)Run inline AppleScript source with full TCC
applescript_tool (list)List saved AppleScripts
applescript_tool (run)Run saved AppleScript by name
applescript_tool (save)Save AppleScript for reuse
applescript_tool (delete)Delete saved AppleScript
applescript_tool (lookup_sdef)Read app's scripting dictionary
javascript_tool (execute)Run inline JXA source
javascript_tool (list)List saved JXA scripts
javascript_tool (run)Run saved JXA script
javascript_tool (save)Save JXA for reuse
javascript_tool (delete)Delete saved JXA

Accessibility API (12 tools)

ToolDescription
accessibility (list_windows)List all visible windows with positions and owner apps
accessibility (get_properties)Get all properties of an accessibility element
accessibility (perform_action)Perform an accessibility action (AXPress, AXConfirm, etc.)
accessibility (type_text)Simulate keyboard typing
accessibility (click)Simulate mouse clicks at coordinates
accessibility (press_key)Simulate key presses with modifiers
accessibility (screenshot)Capture screenshot of region or window
accessibility (set_properties)Set accessibility property values
accessibility (find_element)Find element by role/title/value with timeout
accessibility (get_children)Get children of an accessibility element
accessibility (check_permission)Check if Accessibility access is granted
accessibility (request_permission)Request Accessibility permission

Xcode Automation (7 tools)

ToolDescription
xcode (build)Build an Xcode project/workspace (auto-detects)
xcode (run)Build and run an Xcode project
xcode (list_projects)List all open Xcode projects
xcode (select_project)Select a project by number
xcode (add_file)Add a file to pbxproj
xcode (remove_file)Remove a file from pbxproj
xcode (grant_permission)Grant macOS Automation permission for Xcode

MCP Tools β€” XCF (21 tools)

ToolDescription
mcp_xcf_xcfExecute an xcf action or command
mcp_xcf_listList all available tools on this server
mcp_xcf_xcf_helpHelp for xcf actions only
mcp_xcf_helpRegular help with common examples
mcp_xcf_snippetExtract code snippets from files
mcp_xcf_analyzerAnalyze Swift code for potential issues
mcp_xcf_read_dirList contents of a directory
mcp_xcf_read_fileRead content from a file
mcp_xcf_cd_dirChange current directory
mcp_xcf_use_xcfActivate XCF mode
mcp_xcf_toolsShow detailed reference for all tools
mcp_xcf_show_helpDisplay help information
mcp_xcf_grant_permissionGrant Xcode automation permissions
mcp_xcf_run_projectRun the current Xcode project
mcp_xcf_build_projectBuild the current Xcode project
mcp_xcf_show_current_projectShow information about the current project
mcp_xcf_show_envDisplay all environment variables
mcp_xcf_show_folderDisplay the current working folder
mcp_xcf_list_projectsList all open Xcode projects
mcp_xcf_select_projectSelect an Xcode project by number
mcp_xcf_analyze_swift_codeAnalyze Swift code for potential issues

AgentScripts

Agent! includes a built-in Swift scripting system. Scripts live in ~/Documents/Agent/agents/ as a Swift Package:

~/Documents/Agent/agents/
β”œβ”€β”€ Package.swift
└── Sources/
    β”œβ”€β”€ Scripts/           ← one .swift file per script
    β”‚   β”œβ”€β”€ CheckMail.swift
    β”‚   β”œβ”€β”€ Hello.swift
    β”‚   └── ...
    └── XCFScriptingBridges/  ← one .swift file per app bridge
        β”œβ”€β”€ ScriptingBridgeCommon.swift
        β”œβ”€β”€ MailBridge.swift
        └── ...

Core Scripts (bundled)

29 scripts come pre-compiled in Agent.app/Contents/Resources/:

ScriptDescription
AccessibilityRecorderRecord accessibility actions
AXDemoAccessibility API demonstration
CapturePhotoCapture photo from camera
CheckMailCheck for new email messages
CreateDMGCreate a DMG disk image
EmailAccountsList email accounts
ExtractAlbumArtExtract album artwork from Music
GenerateBridgeGenerate ScriptingBridge for any app
HelloSimple hello world script
ListHomeContentsList home directory contents
ListNotesList Apple Notes
ListRemindersList Reminders
MusicScriptingExamplesMusic app scripting examples
NowPlayingGet currently playing track
NowPlayingHTMLNow playing info as HTML
OrganizeEmailsOrganize email into folders
PlayPlaylistPlay a Music playlist
PlayRandomFromCurrentPlay random track from current playlist
QuitAppsQuit running applications
RunningAppsList running applications
SDEFtoJSONConvert SDEF to JSON
SafariSearchSearch in Safari
SaveImageFromClipboardSave image from clipboard
SeleniumWebDriver automation
SendGroupMessageSend group iMessage
SendMessageSend iMessage
SystemInfoGet system information
TodayEventsGet today's calendar events
WebFormWeb form automation
WebNavigateWeb navigation
WebScrapeWeb scraping

The AI can create, read, update, delete, compile, and run these scripts autonomously:

  • list_agent_scripts β€” list all scripts
  • create_agent_script β€” write a new script
  • read_agent_script β€” read source code
  • update_agent_script β€” modify an existing script
  • run_agent_script β€” compile with swift build --product <name> and execute
  • delete_agent_script β€” remove a script

D1F Diff Integration

Agent includes the D1F (Diff 1 Format) package integrated as a local dependency for pretty diff output:

  • create_diff β€” Compare two text strings and get a visual diff with emoji markers:
    • πŸ“Ž Retained lines (unchanged)
    • ❌ Deleted lines (removed)
    • βœ… Inserted lines (added)
  • apply_diff β€” Apply D1F ASCII diffs directly to files
  • edit_file β€” Shows D1F diff preview when replacing text

The D1F package lives in the project folder as a local Swift package dependency, enabling clear visual diffs for file edits without external dependencies.

Dynamic Apple Event Queries

Agent includes an applescript_tool tool that lets the AI query any scriptable Mac app instantly β€” with zero compilation. It uses Objective-C dynamic dispatch to walk an app's Apple Event object graph at runtime.

OperationDescriptionExample
getAccess a property{action: "get", key: "currentTrack"}
iterateRead properties from array items{action: "iterate", properties: ["name", "artist"], limit: 10}
indexPick one item from array{action: "index", index: 0}
callInvoke a method{action: "call", method: "playpause"}
filterNSPredicate filter{action: "filter", predicate: "name contains 'inbox'"}

ScriptingBridges Library

Agent ships with pre-generated Swift protocol definitions for 50 macOS applications:

CategoryApplications
Apple AppsAutomator, Calendar, Contacts, Finder, Mail, Messages, Music, Notes, Numbers, Pages, Photos, Preview, QuickTime Player, Reminders, Safari, Script Editor, Shortcuts, System Events, Terminal, TextEdit, TV
Developer ToolsXcode, Developer Tools, Instruments, Simulator
Creative AppsKeynote, Logic Pro, Final Cut Pro, Adobe Illustrator, Pixelmator Pro
BrowsersGoogle Chrome, Firefox, Microsoft Edge
SystemSystem Settings, System Information, Screen Sharing, Bluetooth File Exchange, Console, Database Events, Folder Actions Setup, Voice Over, UTM
LegacyPages Creator Studio, Numbers Creator Studio, Logic Pro Creator Studio, Final Cut Pro Creator Studio

Each bridge is its own Swift module. Scripts import only what they need (e.g. import MailBridge), keeping builds fast and isolated.

Streaming & Markdown

Agent streams responses token-by-token in real time. The activity log renders markdown inline: bold, italic, inline code, and fenced code blocks with syntax highlighting.

Vision: Screenshot and Clipboard Support

Attach screenshots or paste images directly into Agent. Images are encoded as base64 PNG and sent as vision content blocks. The AI can see what's on your screen and act on it.

Task Memory

Agent persists task history using SwiftData. Recent task messages and older task summaries are injected into the system prompt, giving the AI memory across sessions.


Agent! vs. OpenClaw on Mac

Agent!OpenClaw
FocusmacOS-native depthCross-platform breadth
RuntimeNative Swift binaryNode.js server
UISwiftUI appWeb chat / Telegram / CLI
Privilege modelXPC + Launch Daemon (Apple's official pattern)Shell commands
macOS integrationApple Events, ScriptingBridge, AppleScript, SMAppService, AccessibilityGeneric shell access
Xcode automationBuilt-in: build, run, grant permissionsN/A
AccessibilityFull AXUIElement API integrationLimited
Scripting languageSwift Package-based AgentScriptsPython/JS scripts
MCP supportYes (stdio, HTTP/SSE)Yes
MessagingNative Apple Messages (iMessage/SMS) with per-recipient approvalWhatsApp, Telegram, Slack, Discord, iMessage, and more
Message replyAuto-replies task results via iMessage to approved sendersPlatform-specific replies
App size~13 MB~90.5 MB unpacked (npm)
InstallationRun the .app, install Xcode Command Line Tools (xcode-select --install)openclaw onboard wizard
DependenciesXcode Command Line ToolsNode.js + npm ecosystem
Apple SiliconNative ARM64Interpreted (Node.js)

Both tools have their strengths. If you want a personal assistant across every messaging platform, OpenClaw is excellent. If you want an AI agent that reads Apple Messages natively, drives Xcode, compiles Swift, controls Mac apps through ScriptingBridge, and escalates to root through a proper Launch Daemon β€” Agent is built for that.


License

PolyForm Noncommercial 1.0.0 β€” see LICENSE. Free for noncommercial and personal use; commercial use and commercial versions are reserved to AgentiLoop.ai, a Logos InkPen LLC company.