← All writing

AI Engineering

Always-On Agents Mostly Sleep, and That Works

Mani G 3 min read

Painterly night scene of a small white robot asleep in a green armchair beside a wooden chest full of glowing envelopes and a brass alarm clock.

The best line I read this month comes from Anthropic's guide on always-on agents, published on 13 November: an always-on agent is not actually always on. It spends most of its life asleep. That one sentence clears up a common design mistake: treating an agent like a long-running chat window that nobody ever closes.

Always-on agents are mostly asleep

The guide, written by William Hu, describes a simple cycle. Something happens. The agent wakes up, does one bounded stretch of work called a run, saves what it learned, and goes back to sleep. Repeat forever. The user experiences a helpful colleague who never logs off. The server experiences a process that idles most of the day.

Around that loop sit five pieces: an event inbox, timers, memory, permissions and an outbox. None of them is exotic. Most are database tables with a background worker attached, which is exactly why I like this design.

The five pieces, in plain words

Event inbox. Webhooks, scheduled jobs and user messages don't call the agent directly. They write a row to an inbox table, and a worker picks it up. That fixes two ugly failure modes: two events arriving together and starting competing runs, and a crash silently losing an event. The guide's rules are sensible. Acknowledge events fast, treat the inbox as the source of truth, allow one active worker per inbox, and batch messages that arrive in a burst so the agent replies once. Max Nardit, who rebuilt the pattern in Python and SQLite, boils most of the failure handling down to one move: give every wake-up a key the database refuses to store twice.

Timers. These make the agent proactive. A follow-up is a deadline the agent sets for itself, like "check whether Priya replied by Friday". A schedule is a recurring job. Timers live in their own table, and a scheduler polls it and drops due items into the inbox. Timers never start runs themselves.

Memory. Anthropic implements it as a directory of files, mapped to durable storage so it outlives the worker. The rule of thumb I am stealing: store only what the agent can't look up again. If the fact already lives in your issue tracker, save a pointer.

Permissions. This is where the risk sits, because a run holds your access and nobody is watching. The guide recommends keeping credentials in a proxy outside the agent that adds them to outgoing requests, plus classifiers for risky actions. For the big decisions it uses deferred tool calls. The run stops mid-call and saves the session, you get an approval card, and your answer arrives as a new inbox event that resumes the work.

Outbox. Results go into an outgoing table that a dispatcher sends, which lets you pace messages and retry failures. The guide's advice here is lovely: start quiet and earn the user's attention.

A quick example

This blog has a writer bot that wakes every eight hours. Mapped onto this design, a schedule row comes due, the scheduler drops an event in the inbox, and the worker starts a run. The agent reads its memory file of topics already covered and writes a post. If I wanted a check before anything public goes out, it would hit a deferred call and I'd tap approve on my phone over breakfast. That reply lands in the inbox and the next run finishes the job. Nothing spun in a loop all night burning tokens.

If you want the classifier part to be cheap, the decision models I wrote about earlier fit neatly into that permission step.

One number from the guide stuck with me. On a long-horizon coding benchmark, Anthropic says Opus 5.5 cost 78% less per solved task than Opus 5, against 40% less on typical work. Cheaper long tasks are exactly what makes sleepy agents viable. So what would you let an agent do at 3 a.m. without asking you first?