Hybrid reasoning in practice — the conversation stays flexible, the policy stays in code. A hands-on AI Projects Lab build.
Falcon Retail's refund policy: delivered within 30 days, item not final-sale, max two refunds per customer per year. A purely instruction-driven agent gets this mostly right — and "mostly" is unacceptable when money moves. A sweet-talking customer, an ambiguous date, a long conversation that pushes the policy out of context… and the model approves a refund it shouldn't.
The principle: let the LLM handle the conversation, let code handle the consequences. That's exactly what hybrid reasoning with Agent Script (public beta since November 2025) is for.
A natural-language instruction like "Only refund if the order was delivered within 30 days" is a suggestion the model usually follows. An Agent Script condition is a branch the model cannot skip — the Atlas Reasoning Engine executes it deterministically, like code, because it is code.
topic refund_request:
description: "Handle a customer's request to refund a delivered order"
reasoning:
instruction: |
The customer wants a refund for order {{@variable.order_number}}.
Be empathetic. Gather the order number if missing, then check
eligibility before promising anything:
{{@action.Check_Refund_Eligibility}}
actions:
Check_Refund_Eligibility:
with order_number = @variable.order_number
set @variable.eligible = @result.is_eligible
set @variable.deny_reason = @result.reason
# ── Deterministic guardrails — not up for negotiation ──
if @variable.eligible == false:
@utils.transition to @topic.explain_denial
if @variable.eligible == true:
@utils.transition to @topic.process_refund
topic process_refund:
description: "Execute an approved refund"
reasoning:
instruction: |
Confirm the refund amount with the customer, then execute:
{{@action.Issue_Refund}}
Share the confirmation number and expected timeline.
Check_Refund_Eligibility action — a Flow or Apex invocable you can unit-test.if transitions are evaluated programmatically. No phrasing, mood or prompt injection changes the branch taken.process_refund is only reachable through an approved check — the money-moving action isn't even in the first topic's toolbox.Want working examples to poke at? Salesforce published an Agent Script Recipes sample app with runnable hybrid-reasoning patterns.
Sources: Introducing Hybrid Reasoning with Agent Script · Agent Script — Agentforce Developer Guide