Playbooks#Coding agent#Prompts
Anthropic's agent automation reference: six parts and the failure modes that matter
Daily-brief automation built on Claude Managed Agents, open-sourced by Anthropic: six components, bookmark windows, delivery confirmation, vaulted credentials.
Making an agent run on a schedule is easy. Making it deliver reliably every day is not: no repeats, no gaps, no overreach, and no hiding failures behind “nothing to report today.” On October 8, Anthropic’s Lance Martin and CJ Avilla published “Building effective agent automations,” a walkthrough that builds a daily-brief automation on Claude Managed Agents (beta) and open-sources the entire configuration. This article follows that post; a Chinese summary circulated first, but the reusable part is the set of rules that clearly came from real failures.
Why the daily brief
The agent does something plain: read the Slack channels and GitHub repositories you name on a schedule, track what changed since the last run, and post what deserves action to Slack. That single loop covers most classic scheduled-agent failures — a misaligned read window, silently swallowed source errors, uncertain delivery causing duplicates, leaked credentials, and being steered by instructions embedded in message text. Handle those five and most automation designs follow.
Six components
The reference implementation splits the system into six parts, each backed by a configuration file:
- Sources: a named list of places to read, with credential references for each.
- Destination: the one place the agent may write — a Slack channel here.
- Agent: the model, tools, MCP servers and instruction body in
agent.md, with numbered run steps. - Schedule: a cron expression and time zone in
deployment.md, e.g. a weekday 7:32 a.m. run in America/New_York. - Memory: two directories mounted at
/mnt/memory/— your preferences (read-only to the agent) and the agent’s own state (read-write). - Guardrails: a network allowlist, read-only tokens, a credential vault and a per-run budget cap.
ant apply creates all of it as resources in a Claude API workspace and records their IDs in claude-lock.json; the automation then runs on Anthropic’s infrastructure, with nothing kept running on your machine.
Bookmarks, not time windows
The most common mistake is asking the agent to read “the last 24 hours.” A late run leaves a gap; an early run repeats items. The reference implementation keeps a bookmark per source: at the end of each run the agent writes the newest timestamp it read to bookmarks.json, and the next run starts there, so the window stretches or shrinks with actual timing. The bookmarks live in the state memory store, mounted into each run’s sandbox.
Failed reads must surface
When an MCP server is down or a token has expired, the run still starts — just without that server’s tools. The session logs an error, but the agent sees nothing from that source and reports “nothing new,” which is worse than a visible miss. Three rules in agent.md fix this: when a source fails, keep its bookmark where it is; write the brief from the other sources; and end with one line naming what could not be read (“pull requests unavailable this run”).
Confirm before recording
Automated delivery produces two classic accidents: the post never lands but progress is recorded, losing items forever; or delivery is uncertain and a retry sends readers the brief twice. Again three rules: look for today’s title in the channel before posting; count the post as sent only when Slack returns "ok": true and a message ts; update the ledger and bookmarks only after that confirmation. If the result is unclear, mark the run “maybe posted” and change nothing else. The agent also keeps a run record in runs/<date>.md with the state before and after the post.
Two quality rules are worth copying too: an item earns a line only if the reader would act on it today — a count (“12 open reviews”) is not an item; and just before posting, re-check each item’s live status: resolved means drop it, changed means fix the line, unconfirmable means drop it and log the cut. Links are copied from the source’s own fields (a pull request’s html_url, a Slack permalink), never assembled by hand.
Guardrails and credentials
The agent reads messages other people wrote, and that text can be read as instructions. The defense is to limit what it could do even if it obeyed: the GitHub token is read-only; the Slack bot token lives in a vault, and the sandbox only holds the placeholder $SLACK_BOT_TOKEN, with the real value injected for allowlisted hosts as the request leaves the sandbox; MCP tools reach credentials through a proxy outside the sandbox. The deployment file also sets a spending cap per run, bounding cost.
Start from the template
You need two things: a Slack app (created from the repo’s manifest) and a GitHub token. Copy the template, run ant apply to create the resources, seed your preferences into the preferences memory store (the repo ships scripts/seed-preferences.sh), then test with ant beta:deployments run --deployment-id <id>. Or run /claude-api managed-agents-onboard https://claude.dev/blog/building-effective-agent-automations/ in Claude Code and let the skill configure it. Re-read the preferences file at the start of every run instead of baking a copy into the prompt, or rules you have already changed will keep applying.
A checklist to copy
If you are building a scheduled agent, the rules below are the portable part of the reference implementation:
- Replace time windows with bookmarks. Persist the newest timestamp read per source and start the next run there; never ask for “the last 24 hours.”
- Declare failed reads. On a source error, keep its bookmark, build the brief from the rest, and name the unavailable source in one line.
- Confirm delivery before recording. Only a provider success response counts as sent; update the ledger and bookmarks after confirmation, and mark uncertain runs “maybe posted.”
- Keep a ledger with stable IDs. Store when an item was reported, where it came from, and an ID that does not change, so open items are carried as one line and closed items disappear.
- Re-check at the last moment. Right before posting, verify each item still holds; resolved means drop, changed means fix, unconfirmable means drop and log it.
- Limit blast radius. Read-only tokens, credentials in a vault with placeholders inside the sandbox, an allowlist, and a per-run spending cap.
Summary
The value here is not the daily brief itself but how the post turns reliability into executable rules: bookmarks prevent gaps and repeats, failure declarations keep bad news visible, confirmation keeps records consistent with reality, and vaulted credentials plus read-only tokens cap the damage from injection. For the same evidence-first approach applied to code review, see our walkthrough of the Claude Code verification loop.