Keep tool results inside a token budget
Bound every model-visible tool result before it enters the next prompt.
Bound every model-visible tool result before it enters the next prompt.
How to bound time, tokens, retries, tool calls, and estimated cost across a complete AI execution instead of limiting each call in isolation.
Set a hard iteration limit on automatic function invocation and treat hitting it as an explicit application outcome.
Treat model-generated tool arguments as untrusted input even when they satisfy the generated schema and bind successfully to the expected C# types.
Give AI tools precise parameter names, units, formats, and side-effect expectations so the model receives an unambiguous contract.