vvek

Always-on agents: five building blocks for an AI worker that sleeps between jobs

An agent that runs for weeks is mostly an inbox, timers, memory, permissions and an outbox. How the pieces fit, based on Anthropic's new guide.

Most agent demos are conversations: you ask, the agent works, you read the answer. An always-on agent is different. It lives for weeks or months, wakes up when something happens, does a small piece of work and goes back to sleep.

On November 13, 2026, Anthropic published a guide called "Building always-on agents". It describes the architecture around the model rather than the model itself, and that is the useful part: most of the engineering is ordinary backend work you may already know. This post summarises the five building blocks in my own words and adds notes on how to apply them.

The cycle

An always-on agent spends most of its time idle. The guide describes the loop like this:

  • Something happens: a message, a webhook, a schedule.
  • The agent wakes for a run and handles the event inside a session, which is the transcript of messages and tool calls.
  • It saves what it learned.
  • It goes back to sleep.

The core loop of model, tools and results is the same as any other agent. What differs is everything around it, and the guide names five parts.

flowchart LR
  T[Timers] --> I[Event inbox]
  W[Webhooks and messages] --> I
  I --> R[Run in a session]
  M[(Memory)] <--> R
  R --> P{Permissions}
  P --> O[Outbox]
  O --> U[User]
  U --> I

1. The event inbox

Events should not call the agent directly. They go into a durable list first: usually a database table. A small HTTP handler writes events to it, and a worker reads them.

The guide's recommendations are practical:

  • Track each event's status and deduplicate by the ID the source gives you. Senders retry, so you will see some events twice. Our post on receiving webhooks safely covers the same habit.
  • Acknowledge quickly, and leave deep checks, such as screening for prompt injection, to the run.
  • Allow only one active worker per inbox, so two events do not start competing runs.
  • Batch consecutive user messages into one run.
  • A reply to earlier work resumes the existing session. Other events start a new one.

If a worker crashes, the inbox is the source of truth, so another worker can retry. This is the same shape as a Postgres job queue, and a plain table is a fine place to start.

2. Timers

Agents need to act without being poked. The guide separates two kinds:

  • Follow-ups: deadlines the agent sets for itself, such as "check whether they replied on Friday". They fire once.
  • Schedules: recurring work, such as a daily summary. After each firing they get a new due time.

Keep timers in their own store, not in the inbox, which should hold only ready work. A scheduler polls at a fixed interval, finds due timers, marks them and writes an event to the inbox. After that, a timer is just another event.

3. Memory

A run starts with a fresh context window, so anything the agent should remember has to live outside it. The guide suggests a directory of files backed by durable storage, so memory outlives any single worker. The guiding rule: store only what the agent cannot look up again, and keep a pointer to information that lives in other systems.

Four kinds of memory are suggested:

  • User instructions, loaded at the start of every run.
  • User notes: preferences, role, corrections. Start with one file, and split into an indexed set as it grows.
  • Past messages: what the user has already been told, so the agent does not repeat itself.
  • Task progress: per-task files saying what is done and what is left.

It also mentions an optional step called "dreaming": reviewing past sessions offline to prune outdated entries and spot patterns.

Each run loads the system prompt, tool definitions and memory before any work starts. Keep the always-loaded part small, and use prompt caching to cut cost (see prompt caching for LLM apps). Long sessions can be compacted, so write important state to memory during the run rather than trusting the summary.

4. Permissions

An unattended agent uses someone's access while nobody watches. The guide's advice:

  • Keep credentials out of the agent's environment. A proxy outside it attaches them to outgoing requests, so the agent never handles raw secrets.
  • Let automated review block clearly dangerous actions, and reserve human review for the most consequential decisions.
  • Use deferred tool calls. When a run reaches a risky call, it pauses and saves the session. The request goes to a person, and the answer comes back as an inbox event that resumes the session. Other events can be handled while the request waits.

The deferral pattern is worth copying even in a small system. It turns "ask for approval" into one more event, with no process left waiting. It also fits the least-privilege thinking in our checklist for agent access.

5. The outbox

Background agents give users outcomes, not streamed reasoning. A run can end in one of three ways: send a message, send nothing, or defer a tool call to ask for input.

For most agents, a "send" tool that delivers straight to the user is enough. If you need to pace messages or recover from delivery errors, use an outbox table drained by a dispatcher. Whichever you choose, tune the volume. Too many messages become noise, and too few hide something important. The guide recommends building evals to find the balance and starting quiet, so the agent earns attention over time.

Why now

The guide gives two reasons these agents are becoming practical. Models show better judgment about what the user intends and when to check in. And the cost of long-running work has fallen: on one long-horizon coding benchmark, Anthropic reports that Opus 5.5 cost 78% less per solved task than Opus 5, and 40% less on typical workloads. Those are the vendor's own figures, so test the economics on your own tasks.

A starting plan

  1. One inbox per user, as a database table.
  2. A worker that takes one event at a time and runs the agent.
  3. A memory folder with an instructions file and a notes file.
  4. A single "send message" tool and a single "ask for approval" tool.
  5. A timer table and a scheduler that writes into the inbox.
  6. A small eval set that checks the agent stays quiet when it should (see evals for AI agents).

None of this needs a special framework. It needs a table, a worker and some discipline.

Sources

Keep reading

A short email when we publish. Confirm once, unsubscribe any time.