An agent that scans Slack channels and GitHub pull requests every weekday morning to post a short action list sounds straightforward on paper. In practice, unattended runs fail quietly: an expired token drops one data source and the agent reports “nothing new today,” a retry posts the same brief twice, or an already merged PR shows up as an open blocker. Because nobody watches a scheduled job run in real time, those silent errors compound unnoticed. This post walks through Anthropic’s reference automation to see how concrete state and permission boundaries prevent each failure mode.

At a Glance

  • Anthropic published a reference implementation on Claude Managed Agents (beta) that reads Slack and GitHub on a schedule and posts only net-new changes to Slack.
  • The architecture separates six concerns: sources, destination, agent definition, schedule, memory stores, and guardrails.
  • Six operational rules anchor the design: read from per-source bookmarks instead of fixed time windows, never report an unreadable source as a quiet day, re-verify every candidate item right before posting, advance bookmarks and ledgers only after Slack confirms delivery, re-read preferences from a store the agent cannot edit, and pair read-only source credentials with a per-run budget cap.

About the Original Post

Lance Martin and CJ Avilla published this 9-minute engineering guide on October 8, 2026. It walks file by file through a working reference repository while calling out the silent failure modes that appear at each step. Developers automating recurring reports or operational digests with agents can adapt its configuration layout directly. Source: Building effective agent automations .

System Layout and Configuration Files

The reference implementation is a declarative bundle of configuration files: agent.md, deployment.md, environment.yaml, two memory stores, and vault.yaml for credentials. Running ant apply with the ant CLI provisions those resources in a Claude API workspace and records their IDs in claude-lock.json. Once deployed, the schedule runs on Anthropic’s infrastructure without requiring your laptop to stay online. Running /claude-api managed-agents-onboard in Claude Code with the post URL walks through setting up the same files interactively.

The diagram below maps how those pieces connect during a scheduled run.

Agent automation architecture: Schedule wakes Agent, which reads Sources, checks Already posted, and writes to Destination, backed by read-write State memory, read-only Preferences memory, and Guardrails

Figure 1. Schedule wakes Agent, which reads Sources, checks Already posted?, and posts to Destination. Under Memory, the agent reads and writes State, while the human Reader edits Preferences and the agent only reads it. Dashed Guardrails bound turns, runtime, spend, and heartbeat monitoring. Source: Original post .

Sources: Read from Bookmarks and Surface Read Failures

Credentials live in a vault so the agent never sees raw secret values. For GitHub, an out-of-sandbox proxy attaches the token to MCP calls. For Slack, the agent calls curl from inside the sandbox using a $SLACK_BOT_TOKEN placeholder, and the platform swaps in the real token only when the outbound request targets an allowlisted host.

Hardcoding a fixed window like “the past 24 hours” breaks as soon as schedule timing drifts: a delayed run misses items in the gap, while an early run re-reports items from yesterday. Instead, the automation tracks per-source bookmarks. At the end of each run, it records the timestamp of the newest item read from each source in bookmarks.json inside the state memory store mounted at /mnt/memory/, and the next run picks up from there.

Dead MCP servers or expired tokens cause a subtler failure. The run still starts and logs an error in the session trace, but with that source’s tools missing, the agent sees zero new items and cheerfully posts “nothing new.” Three rules in agent.md block that behavior:

flowchart TD
  A["Read source"] --> B{"Read succeeded?"}
  B -->|"Yes"| C["Include new items<br/>Advance bookmark"]
  B -->|"No"| D["Keep bookmark unchanged"]
  D --> E["Draft brief from<br/>remaining sources"]
  E --> F["Append one-line note<br/>naming unread source"]

Leaving the bookmark untouched guarantees the next healthy run catches up on the missed window, and the trailing one-line warning tells readers whether a source was genuinely quiet or simply unreachable.

Delivery: Update State Only After Slack Confirms

The agent posts its brief with a single curl call to the Slack API via bash, with no human approval step in between. Without strict ordering, internal records easily drift out of sync with the Slack channel. Recording a failed post as delivered advances the bookmark past items that never appeared in Slack, dropping them forever; retrying an ambiguous post without checking the channel sends readers duplicate briefs.

The reference workflow locks down the sequence. Before posting, the agent checks recent channel messages and skips posting if today’s header is already present. After posting, it counts delivery as confirmed only when Slack’s response includes both "ok": true and a message ts. Only then does it update the ledger and advance bookmarks. Each run records its delivery state in runs/<date>.md:

stateDiagram-v2
    state "posting" as posting
    state "posted" as posted
    state "maybe posted" as maybe
    [*] --> posting
    posting --> posted : ok and ts confirmed
    posting --> maybe : outcome uncertain
    posted --> [*] : update ledger and bookmarks
    maybe --> [*] : leave other records untouched

When the response is ambiguous, marking the run maybe posted and leaving bookmarks and the ledger untouched guarantees that no source items are silently skipped.

Agent Definition, Schedule, and Memory Split

In Managed Agents, an agent is a versioned resource bundling the model, system prompt, and toolset. The reference config runs claude-sonnet-5-5 with web search and web fetch disabled. MCP tools normally pause for per-call approval, which would hang an unattended run where nobody is around to click approve. Instead, GitHub MCP tools are set to always_allow, while the underlying GitHub token itself is restricted to read-only permissions.

Of the eight execution steps in the prompt, the post highlights two that protect brief quality. The first is ruthless filtering: an item makes the cut only if it changes what the reader will do today or alters an upcoming decision, and ambiguous items get dropped. Raw counts like “12 open reviews” never qualify as items. The second is pre-post re-verification: because PRs merge and Slack threads resolve while the agent is still reading, the agent re-opens every selected source item right before posting, drops anything already resolved, and updates lines whose status shifted. Items that cannot be re-verified are omitted from the brief and logged in the run record instead. URLs are copied verbatim from source link fields rather than pieced together by hand.

Scheduling lives in the deployment configuration, which runs on cron 32 7 * * 1-5 in America/New_York for weekday mornings. Computing relative dates from UTC server time causes classic off-by-one bugs—calling this morning’s activity “yesterday”—so the deployment injects the reader’s local timezone directly into the initial wakeup message.

Memory is split across two separate stores with different permissions. The preferences store is written by the human reader and mounted read-only for the agent. It lists which channels and repositories to watch, what topics to mute, and how long the brief can be. The agent re-reads preferences.md fresh on every run, and if the file cannot be read, it halts and alerts rather than falling back to generic defaults. Because ant apply deployment.md provisions the store without populating files, scripts/seed-preferences.sh seeds preferences.md before the first run. The state store is read-write for the agent: alongside bookmarks.json, run logs, and the item ledger ledger.md, the agent writes suggested preference tweaks and per-source operational notes there. Each row in ledger.md records the report date, source, a stable identifier such as a Slack message timestamp or PR number, and the last reported status.

Guardrails: Permissions and Budget Caps

Because this agent ingests untrusted Slack messages and GitHub issues written by others, prompt injection is a real risk. The design limits blast radius through hard platform boundaries rather than prompt wording alone: the GitHub token and preferences store are both read-only, and network egress is restricted to an explicit host allowlist. A crafted issue body could still skew a single morning’s summary—or leave a note in state that carries into a later run—but it cannot push code to GitHub or rewrite the reader’s preference rules. Because the Slack bot token needs write access to post the brief, the bot should be invited only to channels it strictly needs.

For cost control, the post recommends setting a per-run spend cap at 3–5x the cost of a normal run and tightening it once real usage data settles. In the example config, "500" is denominated in cents, setting a $5.00 ceiling. A run that hits the cap stops cleanly with status budget_reached rather than throwing an error—which means setting the cap too tight can make truncated runs look deceptively like quiet days.

Takeaways

The notes below are this blog’s own interpretation, not part of the original post.

  1. Per-source bookmarks, post-confirmation state writes, and maybe posted states map one-to-one onto incremental ETL watermarks and two-phase commit ordering in data engineering. Unattended agent automations need the exact same discipline as batch pipelines: persist your high-water mark outside the process, and advance it only after downstream delivery is confirmed so retries remain safe.

  2. Rules like “drop when ambiguous” and “drop when unverified” deliberately bias the brief toward precision over recall. That same tradeoff governs internal data-quality alerting: missing two minor anomalies hurts far less than sending one false alarm that trains engineers to mute the channel.

  3. Splitting preferences and state into separate stores with different write permissions is a clean defense against configuration drift. Allowing the agent only to propose preference edits inside state keeps injected prompts from rewriting operating rules. Still, as the authors note, state itself persists across runs—so teams running this pattern in production should periodically audit state notes alongside run logs.

What to Try First

  • Check whether any recurring report or alert automation you run today queries a fixed "last N hours" window; if so, switch it to persist and resume from the last processed item timestamp.
  • Intentionally revoke or break one data source in staging and verify whether your automation surfaces the missing source explicitly or sends a misleading “no updates” message.
  • Run claude update followed by /claude-api managed-agents-onboard with the original post’s URL, then adapt the generated config files to your own repositories and Slack channels.

Original post: Building effective agent automations