Skip to main content
An AI Agent gambit hands each turn of the conversation to a model. The model reasons about the message, calls tools when it needs them, and returns control to the flow when the conversation is done.

How an AI Agent gambit runs

When the conversation reaches an AI Agent gambit, the gambit takes over the turn. It reasons about the end user’s message, calls tools when needed, and composes the reply. It repeats this loop, turn after turn, until an exit route matches, then hands the conversation to that branch.
The reasoning and tool-use loop that repeats each turn until an exit route matches and hands the conversation to a flow branch

The gambit editor

Every page in this section shows the same demo flow: Start, a Welcome message, the gambit this page covers, then End. The gambit sits third, selected, with its editor open on the right. The rest of the screen is dimmed. The gambit carries one handle per exit route, and a Loop badge that marks it as the step that holds the turn. The Label and Variable fields at the top behave as they do on every gambit editor. Below that row sit the sections this page walks through: Messages, Instructions, Model, Tools & Capabilities, Exit Routes, Behavior, and Guardrails.

Messages

The Messages accordion holds the gambit’s welcome messages. These bubbles fire once when the gambit activates, before the agent takes over the conversation. Use them to greet the end user or to introduce the AI agent. If you leave the bubbles empty, the Auto-Greet switch in Behavior can open the conversation instead, with a greeting based on conversation context.

Instructions

The Instructions region shows a preview of the current prompt. Select Edit to open the System Prompt dialog, where you write the prompt in one of two tabs.
The System Prompt dialog on the Structured tab, with the Persona, Instructions, Constraints, and Response Format fields
The Structured tab splits the prompt into four fields: The Raw tab shows the same prompt as one free-form Base prompt. Type @ in either tab to insert a captured variable. The History rail beside the raw editor keeps your recent saved prompts, and Use restores one. Generate with AI drafts a prompt for you from a short description. Save Prompt applies your changes and closes the dialog.

Model

The Model region picks which model powers the agent. The picker has a Search models… field. Selecting a model your plan does not include opens an upgrade prompt instead. Select the gear icon next to the picker to open the Model parameters popover. It groups the parameters under Generation, Reasoning, and Sampling.
The Model parameters popover open above the Model picker set to Claude Sonnet 5, with Temperature and Max output tokens, Effort set to Off, a disabled Max reasoning tokens field, and Seed, and an info tooltip explaining that the model does not support temperature
A parameter that the selected model does not support stays in the popover but is disabled. Its info icon says why. A model that requires reasoning does not offer Off, so switching to it picks its lowest effort level.

Tools and capabilities

The Tools & Capabilities region lists what the agent can call, as badges. Select Configure to open the Built-in Tools & Capabilities dialog.
The Built-in Tools & Capabilities dialog with the Input components section and the Built-in Tools cards: Web Search, Code Interpreter, Data Extraction, File Generator, and File Reading
The dialog has three sections, each with selectable cards. A search field at the top filters all of them.
  • Output components (render_ui) lets the agent render visual elements beside its reply, such as charts, tables, and cards. A switch turns the capability on, and the cards choose which components the agent may use.
  • Input components (request_user_input) lets the agent show an interactive input and wait for the end user, such as forms, pickers, and file upload. It works the same way, with a switch plus component cards.
  • Built-in Tools holds Web Search, Code Interpreter, Data Extraction, File Generator, and File Reading.
The book icon on a component opens its documentation panel. What each capability does at run time is covered in Built-in AI capabilities. Tool gambits connected to the agent also appear as badges in this region, each with a dot that shows its toolkit connection status. A Knowledge Retrieval gambit attaches to the agent the same way a tool gambit does. Its purpose is to search knowledge bases and return results to the agent, so the agent answers from your own source material. One gambit can cover several knowledge bases. See Attach knowledge to an agent.

Exit routes

Exit routes are how the agent hands control back to the flow. The agent reads each route’s name and description from its system prompt, then decides when to exit based on conversation context. The Exit Routes region shows the routes as badges, with the first one marked (default). Select Configure to open the Exit Routes dialog.
The Exit Routes dialog with a Default route card holding the exit name, the Jump to dropdown, the description field, and the Add Exit Route button
Each route card holds three inputs:
  • An exit name, such as Escalate.
  • A target gambit dropdown, which picks where the conversation goes next.
  • A description of when the agent should take this exit. Write it clearly, because it steers the agent’s decision.
Add Exit Route adds another card. The first route carries a Default badge and is used when the conversation completes naturally. With no routes at all, Add default (Complete) seeds one, and until then the agent keeps the conversation and is never offered a transfer. You wire each route’s edge in the builder like any other branch. See Flow control and branching.

Behavior

The Behavior section collapses below the main regions and holds two settings.
The lower gambit editor with the Behavior section holding the Auto-Greet switch and the Max Steps per Turn field, above the Guardrails section
  • Auto-Greet makes the agent open the conversation itself when no welcome bubbles are configured, based on conversation context.
  • Max Steps per Turn caps how many tool calls the agent can chain within one turn. The default is 10 and the maximum is 50. A higher cap allows more tool use but takes longer.

Guardrails

The Guardrails section takes Custom Guardrails, one rule per line. The rules are injected into the agent’s system prompt as soft constraints, on top of the platform’s own safety rules. See Guardrails and safety for the full safety model.

Data Extraction

When the Data Extraction tool is enabled, a Data Extraction section appears below Guardrails. Its Extraction Schema defines the fields the agent pulls out of the conversation. Each field row takes a field name, a type, and a description. A Required switch marks the field as mandatory, and an optional flow variable name saves the extracted value for later gambits.