Recipe: Agent team, a budget each
A writer and a tester work at once in one sandbox, each with its own turn and dollar cap, under a run-wide key budget and a locked network. What it does, when to use it, how to make it yours, and what a run costs.
Runs two agents at the same time in one sandbox: a writer adds docs and a tester writes tests. Each has its own turn and dollar cap, the whole run has a budget on the Claude key, and the network is locked so nothing in the run can widen it.
| At a glance | Notes |
|---|---|
| Level | Advanced |
| Category | Safety |
| Shape | Two agents at once, each capped, the key capped too |
| Plan | Free and up |
| Needs a Claude key | Yes |
| Limits it comes with | 1 loop, 900 seconds, $0.60 |
| Claude key limit for a run | $0.50 of Claude, 40 requests |
| Internet | Off and locked, except Claude through your key |
Opens it in the Playground as a flow of your own. Simulate shows what a run costs. Run asks before it starts.
The steps
| Step | Block | What it does |
|---|---|---|
| Set up the module | Run command | Writes a small module with two functions, no docs and no tests. |
| Writer and tester | Agents together | Starts the writer and the tester together. Both must finish. |
| Writer: docs | Agent | Writer: adds docstrings and docs/slugs.md. Files only, 6 turns, $0.15 at most. |
| Tester: tests | Agent | Tester: writes and runs tests/test_slugs.py. 8 turns, $0.20 at most. It's done when the tests pass. |
| Docs and tests there? | Decide | Checks the docs exist and the tests pass. |
| Done | Output | Done. |
When to use it
- Work splits into parts that can happen at once, like code, tests and docs.
- You need each agent's spend capped, and the run's total capped again, however the agents behave.
- Agents must not reach anything but their model.
Run it
The quick way: choose Try it now under the drawing. It opens the recipe in the Playground as a flow of your own, after you sign in if you aren't yet. Simulate opens it and shows the forecast, and Run opens it and asks before it starts, with what the run will likely cost. From the dashboard instead:
- In the dashboard sidebar, open Agent Playground → Recipes and find Agent team, a budget each. Choose Advanced to filter the list. In the builder, Recipes in the toolbar lists them too.
- Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
- If you haven't yet, save your Claude key on the Secrets page. The builder offers Add a key… in the step's key list if it's missing.
- Choose Simulate to see the forecast, then Run.
What you'll see: Both agents work at once; open Writer and tester to see each one's turns and spend. If an agent reaches its cap it stops, and its part shows as failed.
Make it yours
- Give the team up to six members: agents, commands or code.
- Change each agent's caps on its step, under It stops at whichever comes first. The run's key limit is shown in the Policy panel and set in the flow's JSON under
policy.keyBudgets. A flow's key limit can only tighten the key's own budget on the Secrets page, never raise it. - Open the network to just what the agents need, for example your package registry, and keep Lock it on.
What a run costs
These are the builder's own forecast for the recipe as it comes, with its limits, rounded. Simulate shows the same numbers for your version, and they change as you change the flow.
| Notes | Typical | 1 in 10 runs | At most |
|---|---|---|---|
| Sandbox time | $0.001 | $0.002 | $0.01 |
| Claude, on your key | $0.11 | $0.17 | the run's spend limit |
| How long it takes | about 2 minutes | about 2 minutes | 900 seconds |
A typical run uses $0.0012 of sandbox time, so about 840 runs cost $1, and every plan includes $5 of usage a month. Claude is billed by Anthropic to your own key, at their usual prices. The run counts it toward its spend limit, so it can't overspend, but we don't charge you for it. At most is the most a run could cost with these limits: it stops at $0.60 or 900 seconds, whichever comes first.