When teams try to build a "24/7 autonomous agent," the first instinct is often a while (true) daemon polling for work. In practice, continuously running loops inflate context windows, collide when two webhooks arrive simultaneously, and create unacceptable blast radius when no human is watching.

Anthropic's engineering guide Building always-on agents (published November 13, 2026) flips that model: an always-on agent should be asleep most of the time—burning zero tokens—and wake up only for short, bounded runs when an event arrives.

The Five Core Primitives

Anthropic structures unattended, long-lived agents around five composable primitives:

[Webhooks / User Messages] ──┐
                             ▼
[Timers: Cron & Follow-ups] ─► [1. Event Inbox (Durable Queue · Single Worker)]
                                        │
                                        ▼ (Wake Run)
                             [Agent Session] ◄──► [3. Memory (Progress & Pointers)]
                                        │
                                        ├──► [4. Permissions (Proxy & Deferred Calls)]
                                        │
                                        ▼
                             [5. Outbox ("Start Quiet" · Batch or Suppress)]

1. Event Inbox

External webhooks, scheduled triggers, and messages land in a durable store (typically a database table) rather than spawning ad-hoc agent loops. The critical invariant is one active worker per inbox, enforced via leases or generation counters so duplicate events are dropped and bursts are batched into a single run.

2. Timers

Timers cover two distinct scheduling needs: fixed recurring jobs (such as a daily digest) and self-scheduled follow-ups (for example, "check whether staging recovered in 25 minutes"). When a timer fires, it simply pushes an event into the inbox.

3. Memory

Because each run starts with a fresh context window, durable state must live outside the prompt. Anthropic's rule of thumb is to store only what cannot be easily looked up again—user preferences, decision logs, and explicit progress files—rather than stuffing raw files into persistent memory.

4. Permissions

Unattended agents cannot rely on synchronous chat confirmations for every command. Anthropic separates trust boundaries outside the model:

  • Credential-injecting proxies: Keep raw API keys out of the agent environment; the proxy attaches auth headers at request time.
  • Deferred tool calls: High-risk actions pause execution, terminate the run, and wait for asynchronous human approval—which arrives later as an inbox event to resume the workflow.

5. Outbox

The outbox governs how results reach users or external systems. Anthropic emphasizes a "start quiet" policy: noisy agents get muted quickly, so the outbox decides whether an output warrants an immediate alert, belongs in a batched digest, or should stay silent.

What to Test Before Deploying This Pattern

Anthropic's guide is an architectural blueprint rather than a drop-in runtime. Before shipping an event-driven agent to production, write fault-injection tests for three failure modes:

  • Duplicate and concurrent webhooks: Verify that idempotency keys and worker leases prevent double execution when identical events arrive back-to-back.
  • Crash and restart recovery: Kill a worker mid-run before memory is flushed and confirm missed timers and unacknowledged inbox items resume cleanly.
  • Approval denial handling: Feed a rejected deferred tool call back into the inbox and ensure the agent exits or pivots instead of retrying the blocked action in a loop.