Skip to main content
The GATHER: section defines structured information that the agent needs to collect from the user during a conversation. Each field specifies a data type, prompt, validation rules, and collection behavior. The runtime orchestrates multi-turn collection, extracting values from natural conversation and prompting for missing fields.

Syntax

At the top level of an agent document, GATHER: defines fields as named blocks:
Within a FLOW: step, gather uses a different syntax. See GATHER within FLOW.
A top-level field here can carry an ASR: listening-settings block (vocabulary, provider, language, no-input timeout) for round-trip compatibility, but it has no effect: the reasoning agent has no per-field prompt turn to apply it to, so the call’s existing listening settings are used instead, and the compiler warns GATHER_ASR_REASONING_UNSUPPORTED. ASR: only takes effect on a field gathered inside a FLOW: step — see Field-level listening settings.
A VOICE block with BARGE_IN and STREAMING is read only on a field of a FLOW step GATHER:. On a field of this top-level section it is not read and gives warning W170. See Voice delivery for a field.

Field properties

Field types

The type property specifies the expected data type for the field value:

Entity binding

Instead of declaring type, options, and validation inline, a field can reference a reusable named entity from the ENTITIES: section via entity_ref. The field then inherits the entity’s type, allowed values, synonyms, and validation.
A field with entity_ref should not also declare type, options, or values — the referenced entity owns that contract.

Enum options

For enum-style fields, options lists the allowed values directly. Use it as an alternative to validate: enum(...). Both inline and block forms are accepted:

Value provenance

The satisfied_by property restricts which sources may satisfy a field — useful for fields that must come from an authoritative system rather than user claims.

Validation

validate is always a single-line string. What it’s read as depends on validation_process (default REGEX):

Validation process

enum(a, b, c) is the one special-cased validate expression: the compiler lowers it into the same allowed-values metadata as options — use whichever reads better for the field. Any other non-regex text (min(1), pattern(...), email(), and similar function-call-looking strings) is read literally as a regular expression, not evaluated as a function — it almost never matches what was intended, so don’t write validate that way. Write a regular expression with a single backslash, such as ^\d{9}$. A double backslash is kept as two characters and never matches. The same applies to extraction_pattern. A regular expression check rejects every value of type number, integer, currency, or boolean, because those values are not text. Do not put a regular expression validate on those types. Rely on the type, or collect the value as string. retry_prompt, max_retries, and validation_process need a validate rule. Without one the compiler reports GATHER_VALIDATION_RULE_REQUIRED. In a FLOW step GATHER, retry_prompt is the question the step asks again after a failed check, and max_retries counts failed attempts per field. When the limit is reached, the agent’s ON_ERROR handler for validation_error with SUBTYPE: max_retries_exceeded runs. In a top-level GATHER, the model receives retry_prompt as a hint and asks again. The platform counts the attempts and records a validation_max_retries trace event. It resolves a matching ON_ERROR handler and applies its SET assignments, but it does not run the handler’s RESPOND, ESCALATE, or COMPLETE action. To act on the limit, collect the field in a FLOW step.
validate must be one line. A multi-line validate: block, or an object/list value such as { pattern: "..." }, is not read as a rule: the top-level parser warns W170, and a FLOW step GATHER warns W174 (empty) or W175 (object/list shape) — the field is left unvalidated rather than failing the compile.

LLM inference

When infer: true, the runtime can fill the field from what the customer already said, without asking. In a FLOW step, inference runs once, when the step starts to collect. It reads the last few customer messages. It does not read assistant messages, tool results, or memory. The conversation_history_window setting in EXECUTION sets how many messages it reads. The default is 2, the maximum is 10, and 0 turns inference off. On a top-level GATHER, infer: true only makes the field eligible for extraction. The infer_confidence and infer_confirm properties have no effect there.

Inference properties

When the confidence in an inferred value falls below infer_confidence, a FLOW step leaves the field empty and asks its prompt. Write infer, infer_confirm, and required as lowercase true or false. Any other spelling reads as false. Use extraction_hints to steer extraction with example surface forms:

Extraction strategy

The strategy property selects how a value is extracted. It can be set per field, and the same enum is available as a block-level default on flow-step gather.

Range collection

When range: true, the field collects a range with low and high values instead of a single scalar:
The collected value is stored as an object: {low: number, high: number}. Either end can be missing, so test budget.low IS SET AND budget.high IS SET. Do not set both list and range on one field. The list wins and the range is dropped without a warning.

List collection

When list: true, the field collects multiple values as an array:
The collected value is stored as an array: ["vegetarian", "no nuts"]. A text reply is split on commas. A {{dietary_restrictions}} template prints the array as JSON. Use "item" IN dietary_restrictions to test membership, because CONTAINS works on text only. Do not add validate to a list or range field. The rule applies to the whole value and rejects valid answers.

Preference collection

preferences: true marks a field that holds preferences:
The property does not change the stored value. The field holds the value as collected. A reasoning agent that has a memory store also scans each customer message for stated preferences and saves them under preferences.accept, preferences.desire, preferences.avoid, and preferences.refuse. That scan runs for top-level GATHER fields only.

Progressive activation

The activation property controls when a field becomes active for collection:
A conditional activation needs a non-empty, valid executable expression.
  • A value that contains only a // line comment is invalid. It is not treated as an omitted activation.
  • Malformed expressions receive a compiler diagnostic. An unknown activation mode, such as sometimes, gets no diagnostic in line-based ABL, and a required field with that mode never completes. The YAML form reports error E175.
  • For a required field, default GATHER completion stays incomplete when its activation declaration is invalid, even if the field already has a collected or default value.
  • A valid condition that evaluates to false leaves the field inactive.
  • The independent required: false, optional, and progressive policies, and an explicitly authored COMPLETE_WHEN, keep their existing completion rules.
  • Write the condition as a block: activation: followed by when: on the next line. The one-line form activation: { when: "..." } is stored as text, and the field never activates.
  • Write when in lowercase. An uppercase WHEN: works only in line-based ABL.
  • depends_on gates a field only with activation: progressive. With required or no activation, it does not gate.
  • Write depends_on as a one-line list, such as [a, b]. A multi-line list is misread without an error.
  • Write the mode in lowercase in a top-level GATHER.

Field dependencies

The depends_on property lists fields that must be collected before this field activates. Combined with activation, this creates ordered collection flows:

Corrections handling

In flow steps, the CORRECTIONS: true property enables natural corrections — the user can update previously collected values by stating corrections in natural language:
See FLOW for the full flow step GATHER syntax.

Transient and sensitive fields

Sensitive fields

Fields marked sensitive: true carry PII and receive special handling:
Vault tokenization and prompt protection depend on the project PII protection setting. With protection off, sensitive: true does not stop the raw value from being stored or from appearing in the model prompt. Trace masking is always on.
sensitive: true controls how a value is displayed and stored afterward (masking, redaction) — the raw value is still extracted by the LLM and lands in session state during collection. For data that must never reach the model, transcript, session state, or logs at all — a full card number, CVV, and similar PCI-scoped values — use SECURE_INPUT instead of GATHER. SECURE_INPUT is currently a FLOW:-step-only action: it has no reasoning-mode/top-level form, so it’s only available to agents that have a FLOW: section — a pure reasoning-mode agent has no equivalent construct today.
When the field name is non-canonical, add pii_type so the redactor can produce a shape-preserving mask:
Alternatively, bind the field to a named project PII pattern with pii_pattern_ref instead of pii_type:
pii_pattern_ref is a free-form reference — the parser has no project scope, so it can’t validate that the named pattern exists. It’s resolved at runtime when the field is written; a reference that matches no configured pattern falls back to pii_type and emits pii_pattern_ref_unresolved. Studio also flags a dangling reference in the gather field editor.

Sensitive display modes

Mask configuration

Write mask_config as a block with snake_case keys. A camelCase key such as showLast gives warning W170 and the defaults apply. A one-line mask_config: {show_last: 2} is dropped without an error. Without a mask_config block, mask shows the last 3 characters. mask_config has no effect unless sensitive_display is mask. Write sensitive_display in lowercase. An unknown value, such as hide or MASK, shows the raw value.

Transient fields

Fields marked transient: true are cleared from the session when an agent with a top-level GATHER completes or hands off. The property is not applied to fields in a FLOW step GATHER. Use it for sensitive data that should not persist beyond its immediate use:

Extraction patterns

The extraction_pattern property defines a custom regex for extracting structured values from user input. Combined with extraction_group, it specifies which capture group to use:

Semantics

The semantics block provides supplemental metadata that helps the runtime interpret and process field values:

Semantics properties

Complete example


Related articles:
  • Tools — tool definitions (tools and gather work together)
  • FLOW — GATHER within flow steps uses a different syntax
  • Language overview — syntax rules for lists and blocks