Alfos
Back to blog

Schedule AI Agent on Mac the Safe Way with launchd

Learn how to schedule an AI agent on Mac using native launchd LaunchAgents, not cron, with a human approval queue for risky actions and a full audit log.

You want to wake up to a cleaner inbox and tidier reminders, handled by your AI coding agent before coffee. The scheduling part is easy on a Mac. The part nobody warns you about is the risk: an agent running at 7am has no human next to it, so one wrong tool call (a reply sent to the wrong person, a thread deleted) happens while you sleep and nobody catches it. Here is how to schedule the run, and how to stop an unattended agent from doing something dumb.

Scheduling a job on a Mac

On macOS you have two classic options: cron and launchd. cron is the old Unix standby, but launchd is the native macOS mechanism, and for jobs inside your logged-in GUI session it is more reliable. You register a LaunchAgent (a small plist that says “run this at these times”), and the system fires it for you.

One honest caveat before you trust this: a LaunchAgent needs an active GUI session. Your Mac must be awake and logged in when the job runs. It will not fire while the machine is asleep or shut down. For genuinely always-on morning runs, leave a low-power Mac (a Mac mini works well) awake and logged in. No VPS, no cloud server. If a small local machine as your agent’s home is a new idea, we made the case for giving your AI agent a Mac, not a server.

Why scheduling an agent is not like scheduling a script

A plain script is deterministic: you know exactly what it will do every time. An AI agent is a different animal. It decides what to do from a prompt, and that freedom is also the danger. “Triage my inbox” could mean flag and draft, or it could mean archive forty threads because it misread you. When you are sitting there, you catch it. At 7am, you are not.

So the real problem is not “how do I schedule it.” It is “how do I let it run unattended without handing it a loaded gun.”

What actually keeps an unattended run safe

The answer is to make a scheduled run obey the exact same safety gate as a manual action, so being unattended changes nothing about what is allowed. Alfos is built around this.

Alfos generates a native macOS launchd LaunchAgent per automation (launchd, not cron), and runs fire even when the Alfos app is closed, as long as the Mac is awake and you are logged in. Schedules can be a fixed interval, a single daily time, or a set of hours. An “agent” automation runs your coding-agent session from a prompt; a “script” automation runs a plain deterministic command with no AI, so not everything needs an LLM.

The safety comes from a single rule: a scheduled run re-enters the same approval gate as anything you do by hand. Under the default posture (Copilote), low-stakes creations run on their own (draft an email, add a reminder, add a calendar event), but anything irreversible waits in a human approval queue: send, reply, forward, delete, move, archive, send an iMessage. The agent can line an action up or cancel it, but it can never approve its own. You wake up, review the queue, and release what is right.

You also get an autonomy slider with three postures: Panic (everything that touches the world waits), Copilote (the default above), and YOLO (everything runs, audit-only). A deny-rule you set overrides every posture, even YOLO, and one flip to Panic freezes everything at once. Every scheduled run writes what it did (executed, queued, or denied) to an audit log you can read back later. For why a queue beats blind trust, see why your Gmail agent needs an approval queue.

Start with one small thing

Do not automate your whole morning on day one. The free tier costs nothing (no card, no account) and runs up to 3 scheduled automations. Pick one agent and one daily time: “at 7am, triage new mail and draft replies.” Let it run for a week under Copilote and read the audit log. When you trust it and want unlimited automations plus acting at full scale, Pro is a one-time 29 EUR purchase, no subscription.

Alfos brings no AI of its own and holds no API key. You bring your own coding agent (Claude Code, Codex, others); it stays agent-agnostic. The schedule is the easy part. The gate is what lets you actually sleep.

FAQ

Will my scheduled AI agent run while my Mac is asleep or closed?

Alfos schedules with native macOS launchd LaunchAgents, so runs fire even with the Alfos app closed. The Mac must be awake and logged in, since a LaunchAgent needs an active GUI session. It will not run while asleep or shut down.

Is it safe to run an AI agent on a recurring schedule?

Under the default Copilote posture, low-stakes creations run automatically while irreversible actions like send, delete, or move wait in a human approval queue. The agent can queue or cancel an action but never approve its own, and everything is written to an audit log.