Source: Anthropic, Building always-on agents (William Hu, 13 Nov 2026), surfaced by Elvis Saravia (DAIR.AI). Audience: staff engineers designing proactive or background agents.
TL;DR
An "always-on" agent is a UX claim, not a runtime property. The agent is asleep almost all the time and wakes for short runs: receive an event, act, persist what changed, sleep. What makes it feel continuous is five pieces of ordinary infrastructure around the same agent loop: an event inbox, timers, memory, permissions (including deferred tool calls), and an outbox. The guide's argument is that each of these should be its own durable store or service, not something the agent improvises inside its context window. The economics changed too: the guide cites one long-horizon coding benchmark where cost per solved task fell 78% between model generations, versus about 40% on typical workloads.
Architecture
Run and session. A run is one wake-up: events in, work done, state saved. A session is the transcript a run executes inside. A reply to earlier work resumes the existing session; anything else starts a new one. Sessions that grow too long are compacted or replaced, so anything that must survive goes to memory during the run.
1. Event inbox. Every trigger (user message, webhook, scheduled job, background job) writes to one durable list instead of calling the agent directly. Minimal form: a table of events, an HTTP handler that appends rows and wakes the worker, and a worker that reads pending rows and starts a run. Rules:
The handler acknowledges fast; deep checks (including prompt-injection screening) happen inside the run.
The inbox is the source of truth; a woken worker re-reads it, so a crashed run is retried from the same event.
One active worker per inbox (start with one inbox per user). Events arriving mid-run are deferred, folded in, or trigger an interrupt-and-restart.
Pending events are batched, so five quick user messages get one reply.
Events carry source IDs for deduplication and a status column.
2. Timers. Two kinds: follow-ups (one-shot deadlines the agent sets for itself, e.g. "check if they replied") and schedules (recurring cadence). They live in their own store, separate from the inbox, because the inbox should only hold work that is ready now. A scheduler polls on a fixed interval, marks follow-ups done or advances a schedule's next due time, and enqueues an event. A timer never starts a run directly; it goes through the inbox like everything else. A durable execution engine can replace the hand-built scheduler.
3. Memory. A directory of files mapped to durable storage (database or object store) so it outlives workers. Store only what the agent cannot look up again; for anything in another system, store a pointer. Four kinds:
User instructions: their own file, loaded every run.
User notes: role, preferences, corrections; one file, then many small files behind an index.
Past messages: what the agent already told the user, so it does not repeat itself.
Task progress: one progress file per ongoing task (done / remaining), indexed. Optional "dreaming" passes review past sessions to prune stale entries and find cross-run patterns. Every run pays a fixed context overhead (system prompt, tools, memory index), so keep it lean and cache it.
4. Permissions. The highest-risk primitive, because runs act unattended with the user's access. Three parts: a credential proxy outside the agent's environment that injects secrets into outbound requests (the agent never holds them); an auto mode where classifiers review risky actions and block dangerous ones so the agent finds a safer path; and deferred tool calls, where a call needing approval ends the run, saves the session mid-call, shows the user a request (for example an interactive card), and the answer arrives as a new inbox event that resumes the session. The worker keeps serving other events meanwhile.
5. Outbox. A run ends one of three ways: send a message, decide nothing needs sending, or defer for input. A simple send tool is enough at first; a formal outbox table plus a dispatcher is for pacing messages and recovering from send failures. The guide's tuning advice: build evals for message volume, and start quiet, earning attention over time.
The cycle. Event in, run in a new or resumed session, read memory, act within permissions, write memory, push to outbox, optionally set a timer. The user's reply or the timer becomes the next event.
Tradeoffs
| Decision | Option A | Option B | When to pick which |
|---|---|---|---|
| Event delivery | Sources call the agent | Sources write to an inbox | Inbox as soon as there is more than one event source or any chance of concurrent events |
| Mid-run arrivals | Queue for next run | Fold in / interrupt | Queue by default; interrupt only for cancellations or corrections that make the current run wrong |
| Memory content | Copy facts in | Store pointers | Pointers for anything with an owning system (tickets, docs, CRM); copy only what cannot be re-fetched |
| Session length | Compact | New session | New session when the task changes; compact when continuity of reasoning matters more than detail |
| Approvals | Block the run | Deferred tool call | Deferred whenever a human may take minutes or more |
| Outbound | Direct send tool | Outbox + dispatcher | Outbox when you need pacing, quiet hours, dedupe of near-identical messages, or retries |
| Scheduler | Own polling service | Durable execution engine | Engine when timers must survive deploys at scale or when steps already run there |
Failure modes
Double runs. Two workers on one inbox, or a timer and a user message racing, produce duplicate or conflicting actions. Enforce single-worker leases per inbox.
Lost events. A source calls the agent directly and the agent crashes; nothing records the event. The inbox exists to make this impossible.
Duplicate side effects on retry. The inbox gives at-least-once runs; any external action the agent takes needs an idempotency key, or the retry repeats it.
Timer storms. Agents setting follow-ups on every run accumulate timers that all fire; cap per-task timers and expire them with the task.
Memory drift. Notes summarize what the user said; over time they diverge from the source. Pointers and periodic pruning help; so does recording where each note came from.
Stale repetition. Without a record of past messages the agent re-reports the same thing each run.
Noisy agent. Too many messages train users to ignore the agent; too few hide real problems. Message volume is an eval target, not a prompt adjective.
Approval limbo. Deferred calls that are never answered leave sessions parked forever; give them expiry and a fallback.
Unattended prompt injection. Webhook payloads and fetched content enter runs with no human watching; screening belongs inside the run, and credentials stay outside the agent.
Review checklist
Is there exactly one durable path by which anything wakes the agent?
Does each event have a source ID, status, and dedupe rule?
Is there a single-worker lease per inbox, and a stated policy for events that arrive mid-run?
Are timers in their own store, with follow-ups and schedules distinguished and an owner task for each?
Is every external side effect idempotent under retry?
Does memory hold pointers for anything owned elsewhere, and a separate always-loaded file for user instructions?
Does the agent keep a record of what it already told the user?
Are credentials injected by a proxy the agent cannot read?
Which tool calls are auto-approved, classifier-reviewed, or deferred, and is that list written down?
Do deferred calls expire, and what happens when they do?
Is there an eval for how often the agent messages the user, with a quiet default?
Is the per-run fixed context small and cached?
Related entries
Long-horizon agents and durable execution (R035): the same "waits hold no compute" idea, implemented with a workflow engine.
Plannotator Inbox (R050): deferred human answers in coding agents, the agent ends its turn and resumes on reply.
A2UI 1.0 (R049): a way to render approval requests as native interface cards.
The 5 layers of agent memory (R002), Memory Tax (R059) and 15 building blocks of agent memory (R083): what goes into the memory store and what it costs.
Anthropic's agent-memory evals (R036): small injected memory layers and pruning passes.