An API-backed coding agent needs an always-on Mac with a cloned repo, git, outbound HTTPS to an LLM API and a scheduler. Figment's Intel Mac VM ($25 a month, or $2 a day) runs that loop. Move to the Apple Silicon Mac VM ($39 a month, $6 a day) if any step needs arm64-only binaries or Xcode 26.4 or later.
A sleeping laptop or an ephemeral CI runner that is torn down after each job cannot hold the agent's state. A hosted Mac can. Below are the plan choice, a runtime checklist, a tool-permission matrix and a launchd loop you can copy.
Which Mac plan does my agent need?
Pick the smallest plan that runs your agent's actual binaries.
| Agent workload | Plan | Why |
|---|---|---|
Call an LLM API, run git, write files, commit | Intel Mac VM, $25 a month | 4 shared vCPUs, 4GB RAM, 80GB SSD, macOS Sequoia |
| Build with Xcode up to 26.3 | Intel Mac VM, $25 a month | Apple lists Xcode 26.0 to 26.3 for Sequoia |
| arm64-only binaries, Xcode 26.4 or later (needs macOS Tahoe 26.2 or later), visionOS | Apple Silicon Mac VM, $39 a month | 4 shared vCPUs, 4GB RAM, 65GB SSD |
| Several agents at once, heavy builds, or 48GB of memory | Dedicated M4 Pro, $349 a month | Whole Mac: M4 Pro, 48GB RAM, 512GB SSD |
For a "fetch a task, call an LLM, write a patch, open a PR" agent, start on the Intel Mac VM. VM vCPUs are shared, not reserved cores. The Intel VM cannot run arm64-only binaries or visionOS, and some iCloud features are disabled on it. Every plan gives you administrator access to your own Mac or VM. The Intel Mac VM and the Dedicated M4 Pro include SSH, encrypted remote desktop and browser access; the Apple Silicon Mac VM has the browser desktop and SSH. Prices are in USD before tax, and you can compare the plans on Figment Mac Hosting.
For an outside price reference, CloudMac pricing lists an M4 / 16 GB / 256 GB mini at $99.99/month, with 512 GB and 1 TB storage rows marked fully reserved. On 2026-11-10, cloudmac.org also listed a $999/year option, which is $83.25 effective monthly. That is a whole Mac mini, while Figment's Apple Silicon VM at 12 × $39 = $468 a year is a VM with shared vCPUs. Compare the hardware as well as the price.
What should be installed before the agent runs?
Verify every component on first login over SSH or remote desktop. Any MISSING line stops the agent before it runs a bad cycle. Install the missing tool, re-check, then proceed.
#!/usr/bin/env bash
# agent-bom-check.sh — verify runtime components on first login
set -euo pipefail
check() {
local name="$1" cmd="$2"
if eval "$cmd" >/dev/null 2>&1; then
echo "OK $name"
else
echo "MISSING $name"
MISSING=1
fi
}
MISSING=0
check "git" "git --version"
check "python3" "python3 --version"
check "node" "node --version"
check "curl" "curl --version"
check "jq" "jq --version"
check "LLM key" "security find-generic-password -a \"$USER\" -s llm-api-key -w"
check "workspace" "[ -d \"$HOME/agent-workspace\" ]"
exit "$MISSING"
What permissions does each tool need?
Give every tool an explicit, minimal grant. Over-permissioned agents are harder to audit and easier to exploit.
| Tool / capability | Credential | Scope | Where it lives |
|---|---|---|---|
git clone / push | Machine-user token or deploy key | Single repo, write | Keychain generic password |
| LLM API call | Bearer token | One project / one key | Keychain generic password |
| Task queue fetch | Bearer token | Read-only task endpoint | Keychain generic password |
| File writes | None special | ~/agent-workspace/ only | Run as a non-admin user |
| Outbound HTTPS | None | 443 to LLM + git host + queue | Update your own egress allowlist if you run one |
| Scheduled execution | User launchd agent | ~/Library/LaunchAgents/ | No root; user-only |
Store secrets in the login keychain, not in a dotfile:
# one-time, interactive
security add-generic-password -a "$USER" -s llm-api-key -w
# runtime
LLM_API_KEY=$(security find-generic-password -a "$USER" -s llm-api-key -w)
export LLM_API_KEY
Do not write every secret to a plain-text file and source it. Every process the agent spawns can read that file, and anything that touches the home directory can back it up. Move secret names between hosts and re-enter the values through the keychain on the new host.
How do I write the agent loop?
A minimal loop fetches a task, calls the LLM, applies the patch, commits and pushes. Run it under launchd so it restarts after crashes and at login.
#!/usr/bin/env bash
# agent-loop.sh — one iteration; launchd re-runs it on StartInterval
set -euo pipefail
WORKSPACE="$HOME/agent-workspace"
LOG="$WORKSPACE/agent.log"
TASK_API="https://your-task-queue.example.com/tasks/next"
log() { printf '[%s] %s\n' "$(date -u +%FT%TZ)" "$*" >> "$LOG"; }
LLM_API_KEY=$(security find-generic-password -a "$USER" -s llm-api-key -w)
TASK_TOKEN=$(security find-generic-password -a "$USER" -s task-token -w)
export LLM_API_KEY TASK_TOKEN
cd "$WORKSPACE"
git fetch --quiet origin
git checkout --quiet main
git reset --quiet --hard origin/main
TASK=$(curl --silent --show-error --fail --max-time 15 \
-H "Authorization: Bearer $TASK_TOKEN" "$TASK_API") \
|| { log "task fetch failed"; exit 1; }
[ -z "$TASK" ] && { log "queue empty"; exit 0; }
TASK_ID=$(printf '%s' "$TASK" | jq -r '.id')
PROMPT=$(printf '%s' "$TASK" | jq -r '.prompt')
log "start $TASK_ID"
PATCH=$(python3 agent_client.py --prompt "$PROMPT") \
|| { log "llm failed $TASK_ID"; exit 1; }
printf '%s' "$PATCH" | git apply - \
|| { log "patch failed $TASK_ID"; exit 1; }
git add -A
git commit -m "agent: task $TASK_ID"
git push origin HEAD:refs/heads/agent/"$TASK_ID"
log "done $TASK_ID"
Install it as a user launchd agent. See Apple's launchd agent guide and the launchd.plist(5) reference:
<!-- ~/Library/LaunchAgents/com.yourteam.agent.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>com.yourteam.agent</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>/Users/agent/agent-workspace/agent-loop.sh</string>
</array>
<key>StartInterval</key><integer>60</integer>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key><false/>
</dict>
<key>StandardOutPath</key>
<string>/Users/agent/agent-workspace/agent.log</string>
<key>StandardErrorPath</key>
<string>/Users/agent/agent-workspace/agent-err.log</string>
</dict>
</plist>
KeepAlive with SuccessfulExit: false restarts the script only on a non-zero exit, so a clean "queue empty" exit stays quiet. StartInterval: 60 schedules a fresh poll each minute regardless. Load it with launchctl bootstrap gui/$UID ~/Library/LaunchAgents/com.yourteam.agent.plist.
How do I know the agent is safe to leave running?
Check each of these before leaving it unattended:
agent-bom-check.shprintsOKfor every line.- Push one known task through the queue and confirm a commit appears on
agent/<id>. pkill -f agent-loop.sh; within 60 seconds confirmlaunchctl list | grep yourteam.agentshows a new PID.- After the first 30 minutes,
grep -Ei 'fail|error|denied' agent.log agent-err.logreturns nothing unexpected. - Rotate the deploy key, re-add it via
security add-generic-password, and run one task to prove rotation. - Confirm your egress allowlist (if any) covers the LLM endpoint, the task queue and your git host.
What limits should I plan around?
- Concurrency. One loop per plist. Add a second plist with its own workspace and label for a parallel agent on the same VM.
- Disk. The Intel VM has 80GB including the OS. Large monorepos and accumulated patch files fill it, so add
git gc --aggressiveand a workspace-cleanup step. - Memory. The Intel VM has 4GB of RAM. That fits an API-driven agent and
git. Local model inference, Xcode device builds or large simulator runs need more memory than 4GB: the Dedicated M4 Pro 48 GB. - Architecture. ARM-only binaries do not run on the Intel VM. If a step calls an ARM-only tool, check its exit code and do not count a failed invocation as a successful loop.
- Backups. Figment does not back up your Mac. Push work to your git host as the loop already does.
- Billing. You pay before use. Billing starts at the order and continues, even when the Mac is shut down, until you stop it in Figment or cancel a monthly plan. The first purchase is at least $25 of account credit, which pays for usage and is not a fee.
How do I move an existing agent to a hosted Mac?
- On the old host, list the keychain entry names the agent uses (
llm-api-key,task-token, deploy key passphrase). Do not export values to a file. - Push the current working branch so no state is left locally.
- On the new host, run
security add-generic-passwordfor each entry interactively. Clone the repo into~/agent-workspace. - Copy the launchd plist, update the absolute paths for the new user, and
launchctl bootstrap gui/$UIDit. - Send one test task and confirm the commit appears before you decommission the old machine.
Related guides: