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 prompt can include {{system.transcript}}, which keeps the newest 20,000 characters of the conversation. 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. An agent that uses tools can open its reply with a short line, such as “Let me check that for you.” Ask for this in Instructions. The end user sees the line while the tool runs, and the answer follows as a new paragraph in the same bubble.

Model

The Model region picks which model powers the agent. The picker has a Search models… field. It groups the models by provider, with a count on each group. Meta models are under META-LLAMA and META. A lock marks a model your plan does not include. 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 GPT-5.6 Luna, with Temperature and Max output tokens under Generation, Effort set to Off and a disabled Max reasoning tokens field under Reasoning, and Seed under Sampling
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 Manage tools to open a popover with two tabs. With nothing linked, the region says no tools are connected yet.
  • A tool gambit offers actions from a connected toolkit or from CodeKit. Its badge carries a dot that shows the connection status. See Enable and use actions.
  • A Component gambit offers native capabilities, such as forms, a meeting booking, file reading, and file generation. See Component gambit and Built-in AI capabilities.
  • A Knowledge Retrieval gambit searches knowledge bases and returns results to the agent, so the agent answers from your own source material. One gambit can cover up to 10 knowledge bases. See Attach knowledge to an agent.
Two kinds of badge come from older settings. A Web Search badge marked Coming soon means web search is turned on but not available yet, so the agent cannot search the web. A badge with the tooltip Now a component. Manage it under Legacy capabilities in Manage tools. is a legacy capability. Both are managed in Manage tools. See Built-in AI capabilities.

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 two route cards, the Default Resolved route jumping to End and the Needs a human route jumping to a Live Chat gambit, each holding the exit name, the Jump to dropdown, and the description field, above 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. After a Button gambit, the greeting answers the option the end user selected.
  • 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

A Data Extraction section below Guardrails appears only on an agent that still has the legacy Data Extraction capability on. Its Extraction Schema defines the fields the agent collects. For new agents, add the Data Extraction component instead. See Data Extraction.