Agentic AI - Agent Safety and Guardrails
Why does this budget control code fail?
budget = 50
costs = [20, 40, 10]
spent = 0
for cost in costs:
if spent + cost < budget:
spent += cost
print(spent)