Safety and Limits
This guide covers the safety controls available for tool use, including allowlists, turn budgets, and timeouts. These controls help prevent runaway loops and ensure predictable generation behavior.
Overview
When LLM columns use tools, the model can make multiple tool calls in a loop until it produces a final answer. Without limits, this could lead to:
- Excessive API calls and costs
- Long generation times
- Infinite loops if the model keeps requesting tools
Data Designer provides three types of controls:
Tool Allowlists
Restrict which tools are available using allow_tools:
Behavior
Tools not in the allowlist won’t be included in the schemas sent to the model, so the model won’t know they exist.
Use allowlists for untrusted tools If your MCP providers expose tools that could be dangerous or expensive, use allowlists to restrict access to only the tools you need.
Turn Budgets
Limit the number of tool-calling iterations using max_tool_call_turns:
Understanding Turns
A turn is one iteration where the LLM requests tool calls. With parallel tool calling, a single turn may execute multiple tools simultaneously.
This approach gives models flexibility to use parallel calling efficiently while still bounding total iterations.
Graceful Budget Exhaustion
When the turn limit is reached, Data Designer doesn’t abruptly stop generation. Instead:
- The model’s tool call request is recorded in the conversation
- Tool “results” are returned with a refusal message explaining the limit was reached
- The model receives this feedback and can produce a final response
This ensures the model can still provide a useful answer based on the tools it already called, rather than failing silently.
Timeouts
Limit how long each tool call can take using timeout_sec:
Timeout Behavior
When a timeout occurs:
- The tool call is terminated
- An error message is returned to the model
- The model can attempt recovery (retry, skip, or answer without the result)
Default Timeout
The default timeout is 60 seconds. Adjust based on your tools:
Combining Controls
You can use all controls together for defense in depth:
See Also
- Tool Configurations: Complete ToolConfig reference
- Message Traces: Monitor tool usage patterns