Pick a recipe
Design an agent in five decisions
1. Name the one job
Write the job as a sentence a teammate would understand: “Answer order questions using our order system.” If you need the word “and” twice, you probably want two agents. A narrow agent is easier to instruct, test, and trust.2. Decide where the work happens
A session without a sandbox uses no machine time. Only add one when the agent must run commands or handle files.
3. Give it the fewest tools that work
Every tool is something the model can misuse or call at the wrong time. Prefer narrow tools:lookup_order(order_id) rather than run_sql(query). Validate every argument in your code. Instructions such as “never refund more than $50” are guidance for the model, not a security control. See keep it safe.
4. Write instructions for the model, not for people
Good instructions say:- What the job is, in one or two sentences.
- How to use each tool, and when not to.
- What to do when information is missing: ask, or say it is unknown. Tell it not to guess.
- What the result looks like: the format, the length, and the path for files (
/workspace/outputs/report.md).
5. Decide where the result goes
- A reply. Read it from the session’s items, or stream it as it is written.
- A file. Tell the agent to save it under
/workspace/outputs. Orca saves it as an artifact when the turn completes. - An action in your system. Have the agent call a function tool, and let your code decide whether to carry it out.
Shared setup
Every recipe uses the same three settings as the quickstart:await, so they need "type": "module" in package.json, and Node 22.18+ or 24+ to run .ts files directly.
Before you ship an agent
- Test it with bad input. Missing IDs, a file in the wrong format, a question outside its job. Check that it says so instead of inventing an answer.
- Handle every turn outcome. A turn can end
completed,failed, orcancelled. See turns and statuses. - Watch the cost. Check token usage on a few real runs before you scale up. Subagents and web searches add calls. See usage and wallet.
- Share it. When it works, a kit hands the agent, its skills, and its templates to a teammate or customer as one link.