---
title: "Budgets, loops and guards"
url: https://eldan.ai/tutorials/tool-calling-from-scratch/budgets-and-guards
canonical: https://eldan.ai/tutorials/tool-calling-from-scratch/budgets-and-guards
locale: en
language: en
updated: 2026-11-23
author: "Eldan Abdrashim"
cite_as: "Eldan Abdrashim. \"Budgets, loops and guards.\" Eldan.ai, updated 23 November 2026. https://eldan.ai/tutorials/tool-calling-from-scratch/budgets-and-guards."
---

# Budgets, loops and guards

> Bound a run with step, time and token budgets, detect repeated calls, and guard tools with side effects.

This lesson is free for newsletter readers. Open https://eldan.ai/tutorials/tool-calling-from-scratch/budgets-and-guards, subscribe with your email and confirm the address: the lesson opens in that browser.

## Sources

- [Tool Calling From Scratch](https://eldan.ai/tutorials/tool-calling-from-scratch)
