---
title: Recipe: Agent team, a budget each · Agent Playground docs
description: 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.
url: https://www.quietrobot.ai/docs/playground/recipes/budget-team
---

# 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 | |
|---|---|
| **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 |

```flow
{"recipe": "budget-team", "title": "Agent team, a budget each, as it is on the canvas.", "nodes": [["setup", "run", "Set up the module"], ["team", "team", "Writer and tester", "Writer: docs + Tester: tests"], ["check", "branch", "Docs and tests there?"], ["done", "end", "Done"]], "edges": [["setup", "team"], ["team", "check", "Done"], ["check", "done", "Yes"]]}
```

## 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:

1. 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.
2. Choose **Use this recipe**. It becomes a flow of your own, so changing it never changes the recipe.
3. If you haven't yet, [save your Claude key](https://www.quietrobot.ai/docs/playground/ai-steps#add-your-claude-key) on the **Secrets** page. The builder offers **Add a key…** in the step's key list if it's missing.
4. 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

1. Give the team up to six members: agents, commands or code.
2. 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.
3. 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.

| | 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.

## Related

* [Agents together](https://www.quietrobot.ai/docs/playground/blocks#agents-together)
* [Rules and budgets for each key](https://www.quietrobot.ai/docs/sandboxes/secrets#rules-and-budgets-for-each-key)
* [All recipes](https://www.quietrobot.ai/docs/playground/recipes)
