Section 4 · AI Agents · 35% of exam
4.3 Hybrid Reasoning and Deterministic Behavior
Exam objective
Explain hybrid reasoning and identify when to use LLM reasoning together with deterministic rules and actions.
Two kinds of reasoning
Hybrid reasoning combines probabilistic, language-model reasoning with deterministic, rules-based execution. Language-model reasoning is useful for understanding varied user wording, interpreting context, asking relevant questions, and composing natural responses. Deterministic logic is useful when a business rule must produce a consistent result, such as checking a threshold, requiring verification, or enforcing a mandatory sequence. Agentforce’s reasoning engine can coordinate both in a single configured workflow. The design question is not whether an agent should be ‘AI’ or ‘rules.’ It is which parts need interpretation and which parts need predictable control.
Choose the amount of control
Consider a refund request. The agent can interpret the customer’s explanation and find the relevant policy. A rule or action can verify the purchase date, calculate whether a return window is open, and prevent a disallowed refund. The agent can then explain the result in clear language. If the requirement is a fixed calculation, do not ask the model to invent the number. If the requirement is to summarize a complex conversation, a rigid set of exact-match rules may be insufficient. Good design places each responsibility in the component suited to it. Make critical decisions explicit
Agent Script can express if/else logic, variable changes, transitions, and action sequencing. Filters can determine whether a subagent or action is available under the current conditions. A Flow, Apex action, or other deterministic service can enforce a rule that must not depend on model interpretation. Natural-language instructions remain useful for goals, tone, context, and nuanced tasks, but they are not a security boundary or a substitute for validation. For critical actions, validate inputs and outputs, handle errors, and consider a confirmation or approval step. The agent should not claim success until it has usable action results.
Avoid over-controlling the agent
Adding deterministic controls everywhere can make a system brittle and hard to maintain. If every phrase is handled by a separate branch, small wording changes may break routing. Conversely, leaving a sensitive operation to unconstrained natural-language reasoning can create unacceptable variability. Decide the needed control based on risk, repeatability, and the cost of an incorrect outcome. Use the minimum explicit logic that protects the important business requirements. Then test both expected and unexpected paths, including missing data, conflicting context, action failures, and user attempts to skip a required step. Review traces to see whether actual behavior follows the intended design.
TIP: Separate interpretation from enforcement. Let the model understand the request; use deterministic logic for exact eligibility, required checks, or fixed calculations.
Deterministic logic improves consistency but does not automatically make a workflow secure. Permissions, action design, and data validation still apply.
Extra concept: A mixed design can use an LLM for language and routing, Flow or Agent Script for a rule, and the LLM again to explain the verified result.
Official references:
- The Building Blocks of Agents https://help.salesforce.com/s/articleView?id=ai.copilot_building_blocks.htm&language=en_US&type=5
- Planning and Designing for Agent Script https://help.salesforce.com/s/articleView?id=ai.agent_migrate_plan_design.htm&language=en_US&type=5
Key takeaways
- Hybrid reasoning combines flexible LLM interpretation with deterministic execution.
- Use explicit rules for fixed business requirements and natural-language reasoning for context-sensitive work.
- Choose control based on risk; test failure and edge paths as well as the happy path.
