Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent workflows

Cap session spend and resume safely

Bound the cost of an unattended research session, inspect state at the cap, and resume only when authorized.

Goal

Goal: Bound the cost of an unattended research session, inspect state at the cap, and resume only when authorized.

Steps

  1. Set budget={"type":"limit","max_list_cost":{"currency":"USD","amount":"10"}} when creating the session. [budget]
  2. Monitor spend from session.usage; on budget_reached, stop automatic submissions and inspect session state and events. [budget]
  3. After human approval, resume with sessions.update(session_id, budget={...higher cap...}); verify output and archive. [budget]

How to verify

At the cap, verify the session is idle with recorded `list_cost`; after raising the budget, the same session resumes.

Troubleshooting

A request can finish slightly above the cap; a new cap cannot be below spend, so inspect `usage.list_cost` first.

Permissions

Prerequisites

Permissions

Limitations

The cap applies to one session, not workspace/org quotas; the request crossing the limit can cause slight overage.

Pinned upstream source

https://github.com/anthropics/anthropic-cookbook/blob/9c1e493ddd2b82df399d2a61b9c806c539e18be6/managed_agents/CMA_cap_session_spend.ipynb

Repository
anthropics/anthropic-cookbook
File path
managed_agents/CMA_cap_session_spend.ipynb
Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources