# 31.9 The always-on worker (/building-ai-workers/self-improving-ai-workers/the-always-on-worker)

---
type: Document
title: "31.9 The always-on worker"
description: "What makes a worker always-on, the seven parts around its loop, and three rules for actions that must not happen twice."
status: stable
order: 331.09
ksor:
  owner: team:panaversity
  audience: [ public ]
  approval:
    by: process:panaversity
    at: 2026-11-25T09:06:44Z
chapter: "31"
part: III
expert_status: co-build
concepts: [ "31.9" ]
last_verified: 2026-11-24
sources:
  - id: always-on
    title: "Building always-on agents (William Hu, Claude Platform, 13 November 2026, verified 2026-11-24)"
    resource: https://claude.com/resources/articles/building-always-on-agents
  - id: ma-engineering
    title: "Scaling Managed Agents: Decoupling the brain from the hands (Lance Martin, Gabe Cemaj and Michael Cohen, Anthropic Engineering, 8 April 2026)"
    resource: https://anthropic.com/engineering/managed-agents
generated:
  at: 2026-11-25T09:06:44Z
  by: process:panaversity
trust_tier: unverified
build_id: sha256:0decb5023f044061076dd533dd5b490739d442d95c609ce2fff5ad3af880174c
dirty: true
ksor_version: 0.0.60
---

> **Part C on a first reading.** Parts A and B built the worker's memory and its learning. Part C steps back and looks at the whole worker on the job, and it has many new names. On a first reading, keep one idea from each section:
>
> - **31.9:** the worker sleeps between events, and each event wakes it for one run. It must never do an outside action twice.
> - **31.10:** build in order, with dreaming last, and count what each step costs.
> - **31.11:** a job definition and three trusted records turn an agent into a worker.
>
> Some parts can wait until you need them. These are the brain, hands and session (31.9), the vendors' figures (31.10), and DSoR, SSoR and KSoR (31.11). Each section ends with its key ideas, and Sitting 3 of the lab practises one idea from each.

**In everyday life.** A building's caretaker lives on site. Most of the night she is asleep. When a tenant rings the bell, she wakes, reads the logbook and fixes the leak. She writes down what she did, sets an alarm to check the boiler at six, and goes back to sleep. The tenants say she is always there. She is not always awake. She is always reachable, and she always remembers.

**What you will learn.** What makes a worker always-on, and the seven parts around its loop. Who owns where the work stands. And the rules for actions that must not happen twice. You meet some of these parts in Lab 31, Tasks 2 and 3, and you build a small inbox in Task 11. Part IV builds them as a durable system.

**Why it matters.** The morning triage runs once a day because a schedule starts it. A real job also arrives as events: a vendor's email at noon, Luis's answer at four. So the worker must wake for those events, remember, and report safely with nobody watching. That worker is the whole this chapter builds. The loop, the memory and the dream are its parts.

### What does always-on mean?

**Stateful and proactive: it keeps context across sessions, and it acts without a person starting it.** That is the definition in Anthropic's article on always-on agents.[^always-on] "Always on" is how it feels to the person. The worker sleeps most of the time. A **run** is one wake-up: receive an event, do the work, save what happened, sleep. A **session** is the record that run works within.

Read together, the loops article, the talk and the always-on article make one claim. This whole chapter rests on it: **a proactive loop becomes an always-on worker when it gains durable memory and a runtime around it. The runtime gives it events, scheduling, permissions and a way to report results. Dreaming is a second loop that runs over memory instead of over the task.**

### What are the seven parts?

The article places seven parts around the core loop.[^always-on] Brightline's worker has a simple form of each, from Chapter 23 and this chapter:

| Part | What it does | At Brightline |
| --- | --- | --- |
| **Event inbox** | Holds the list of events waiting for the worker | The 7:10 schedule is the only event today |
| **Timers and scheduler** | Holds the follow-ups the worker sets for itself | "Look at NA-2245 again on Thursday" |
| **Memory** | Keeps files that outlive any run | `memory/published/v6/`, and each run's scratch folder |
| **Context window** | Decides what each run loads | Two small files, loaded every run |
| **Permissions** | Controls what the worker may do with nobody watching | Ready to pay needs an approval row |
| **Outbox and dispatcher** | Delivers each run's result | The triage report, after the code check |
| **Notification etiquette** | Decides how often the worker speaks to people | One report per company per morning |

Each part has a few rules. Here they are, in short sentences.

- **Event inbox.** The inbox is the true list of what is waiting. Events come from webhooks ([23.15](../hosted-agents/schedules-and-webhooks.md)), from timers that came due, and from background jobs. Start with one inbox per person, and one active worker per inbox. Acknowledge each event quickly. Group related events. Drop an event that arrives twice, using its source id. At Brightline, Luis's answer in the portal, or a vendor's email, would be the next kinds of event.
- **Timers and scheduler.** Timers live in their own store. A scheduler checks them, and puts each due timer in the inbox. A timer never starts a run directly.
- **Memory.** Keep only what cannot be looked up again, with pointers to other systems. Load `instructions.md` and `index.md` on every run. Read `reported.md` before reporting a hold, and `notes/` and `progress/` only when needed. Dreaming keeps memory tidy.
- **Context window.** Keep the part loaded on every run small, so it can be cached (reused cheaply). Condensing a long conversation loses detail, and so does a new session. So write anything important to memory during the work. At Brightline, the two injected files stay under 40 lines, with one line per page.
- **Permissions.** This is the part with the highest risk ([23.8](../hosted-agents/permission-policies.md)). Passwords and keys stay behind a proxy, a service that uses them so the worker never sees them. A filter called a classifier blocks risky actions. A tool call that needs a person ends the run, and the person's answer comes back as a new event in the inbox. At Brightline, the connector holds the portal's passwords.
- **Outbox and dispatcher.** A run ends in one of three ways: it sends a message, it decides that nothing needs sending, or it asks a person.
- **Notification etiquette.** This is what the worker does without being asked, and how often it speaks ([9.3](../../managing-ai-workers/work-that-runs-without-you/governing-initiative.md)). Start quiet, and speak more only when people find it useful. Test the balance with evals: repeatable tests of how the worker behaves. At Brightline, the worker sends nothing else unless a hold needs a person.

`reported.md` is a list of what the worker has already told people, so that it does not report the same hold every morning. `progress/` holds one file per piece of work that spans several runs.

![A cycle. On the left, event sources and timers. Timers go to a scheduler, which puts due items into the event inbox. Event sources go straight into the inbox. The inbox starts a run in the middle, with one active worker and one session. Above the run, the memory files: core files each run, the rest as needed. Below it, permissions: a credential proxy, classifiers and deferrals. The run sends its result to the outbox on the right: send, stay quiet, or ask. The outbox reaches the person. The person's reply returns to the inbox as a new event, and a run can set its own follow-up timers. Below: the worker sleeps between events; every wake-up is one run.](img/chapter-31-always-on-cycle.png)

*Figure 31.7. An always-on worker sleeps between events. Every wake-up is one run.*

### How does the cycle close?

**On itself.** A timer or an event starts a run. The run uses memory and permissions within a session. The outbox delivers the result. The person's reply comes back as a new inbox event, and the run can set its own next wake-up. On Tuesday, October 13, the worker asked Luis about NA-2245 and went to sleep. In an always-on worker, Luis's answer at 16:05 would be an event. The worker would wake and apply the credit at once, instead of waiting for the next morning. You build this in Lab 31, Task 11.

This is the proactive loop of [31.2](two-loops-over-one-memory.md), with two things added. One is durable state. The other is the parts that let it wake, queue its events and report safely, with no person present.

### Who owns where the work stands?

**The record of the work, not the runtime.** Of the four kinds of state in [31.8](memory-never-overrides-policy.md), the always-on worker adds one rule about task state. The runtime controls how the work runs. But whether an invoice is approved or paid belongs to the business system and to the record of the work. If the two disagree, the record wins, and recovery checks the runtime against it before the worker acts again.

Anthropic's engineering post on Managed Agents applies the same split to the runtime itself.[^ma-engineering] It separates three parts. The **brain** is Claude and its harness. The **hands** are the sandboxes and tools. The **session** is a durable log of events, kept outside the context window. Each part can fail and be replaced on its own. A failed sandbox is swapped out, and the harness, which keeps no state of its own, carries on by reading the log again.

### What if an action happens twice?

**A durable log keeps the work, but it cannot make an outside action happen exactly once.** Say the worker sends an email, then crashes before it records the send. A retry sends the email again. If it marks an invoice ready to pay and crashes, a retry may mark it twice, and a payment run may pay it twice. Three rules follow:

1. **Give every outside action a stable id**, and use the provider's **idempotency key** where there is one. An idempotency key is a unique label on a request, so a request sent twice is carried out once. Brightline's connector takes the run id and the invoice number as the key for "mark ready to pay".
2. **Otherwise, check the provider's state before a retry.** Ask the payment system whether INV-7850 is already marked, and act only if it is not.
3. **For an action that cannot be undone and whose result cannot be checked, stop and ask a person.** Never retry it blind.

These are the duplicate checks that [4.5](../../ai-worker-paradigm/the-architecture-in-one-picture/dsor-acts.md) assigned to DSoR. The chapter's reference page turns them into a six-step lifecycle with a ledger.

**Key ideas of 31.9.**

- An always-on worker is asleep most of the time. Each event or timer wakes it for one run, and each run ends by sending, staying quiet or asking.
- The record of the work, not the runtime, says where the work stands. Check it before you act.
- Give every outside action an id, so that a repeat does nothing. If you cannot check, ask a person.

[^always-on]: Building always-on agents (William Hu, Claude Platform, 13 November 2026).
[^ma-engineering]: Scaling Managed Agents: Decoupling the brain from the hands (Lance Martin, Gabe Cemaj and Michael Cohen, Anthropic Engineering, 8 April 2026).
