TrueSolv — Header Component

Agent Script: The Layer Between AI Flexibility and Enterprise Control

Agent Script decision flow comparison — probabilistic agent vs controlled agent with Salesforce Agent Script

The biggest complaint about AI agents in production has always been the same: they work great in demos and go off-script in real deployments. Salesforce heard that complaint and built Agent Script — a scripting language that lets you define exactly how an agent behaves, step by step, without giving up the flexibility that makes AI useful. Here is what it is, how it works, and why it changes the calculus on Agentforce adoption. Agent Behaviour: Without vs. With Agent Script WITHOUT Agent Script — probabilistic path WITH Agent Script — deterministic rails User request Path A Path B Path C Outcome depends on reasoning and conversation flow ⚠ Risk: agent may skip required verification if the user’s phrasing is persuasive or impatient User request Identity verified REQUIRED STEP — Agent Script AI handles response Verification tool call must return confirmed — no bypass ✓ Deterministic: required steps always execute AI reasoning operates within defined rails The problem Agent Script was built to solve AI agents are probabilistic systems. Give an agent a task and it reasons toward an outcome — evaluating options, choosing actions, interpreting ambiguous inputs — in a way that is flexible and often impressive but never fully predictable from the instruction set alone. For customer service, sales qualification, and internal help desk use cases, that flexibility is valuable. The agent can handle variations in how a question is asked, adapt to unexpected inputs, and reach correct outcomes through different reasoning paths. However, for enterprise deployments where specific steps must happen in a specific order — identity verification before account access, compliance disclosure before a financial recommendation, escalation to a human at a specific deal stage — probabilistic behaviour is a blocker, not a feature. The question is not whether the agent gets to the right answer. It is whether it follows the required path to get there. How Agent Script works Agent Script adds a deterministic layer on top of the AI reasoning layer. You define the fixed logic in a human-readable JSON expression language — the if/then rules, the required tool calls, the handoff triggers, the compliance checkpoints — and the LLM handles the conversational reasoning in between the defined steps. The mental model is a set of rails. Between the rails, the agent reasons freely and handles variation naturally. At the defined points on the rails, the behaviour is fixed: the agent must perform a specific action, verify a specific condition, or hand off to a specific resource before it can continue. Agent Script — identity verification before account access Simplified example // Step 1: Required identity verification // Agent cannot proceed until this returns “verified” {   “step”: “verify_identity”,   “type”: “required_tool_call”,   “tool”: “IdentityVerificationService”,   “condition”: {     “result”: “verified” // must match — no bypass   } } // Step 2: AI handles the response conversation // LLM reasoning operates freely here {   “step”: “handle_account_query”,   “type”: “llm_reasoning”,   “context”: “account_data”,   “guardrails”: [“no_pii_in_response”] } // Step 3: Handoff trigger if deal threshold met {   “step”: “check_escalation”,   “if”: { “deal_value”: { “$gt”: 50000 } },   “then”: { “action”: “handoff_to_human”,     “queue”: “senior_sales_rep” } } Between the defined steps, the AI reasons freely. At the defined steps, the behaviour is fixed — the agent cannot proceed without completing the required action. The distinction from a traditional decision tree is important. Agent Script is not replacing AI reasoning with a flowchart. It is constraining the parts of the interaction where constraint is required while leaving the parts where AI is valuable free to operate as designed. Practical examples Customer service agent with identity verification Without Agent Script: The agent is instructed to verify identity before accessing account data. Whether it follows that instruction precisely depends on how the conversation goes — a persuasive or impatient customer might cause the agent to skip or abbreviate the step. With Agent Script: Identity verification is a defined step in the script. The agent cannot proceed to account lookup until the verification tool call returns a confirmed result. The LLM handles the conversation around verification, but the verification itself is not optional. Sales qualification agent with human handoff Without Agent Script: The agent is instructed to hand off to a human sales rep when a qualified opportunity reaches a specific threshold. Whether it recognises the threshold correctly depends on its interpretation of the conversation. With Agent Script: The handoff trigger is defined explicitly. When the deal value field exceeds the threshold, or when the prospect uses specific phrases indicating high purchase intent, the agent executes a defined handoff action to the Salesforce queue. The LLM does not decide whether the handoff happens; the script does. Integration with Agentforce Builder Agent Script integrates with Agentforce Builder — the conversational build environment introduced in Spring ’26. Admins and developers write Agent Script in the Builder interface alongside the natural language instructions that govern the agent’s conversational behaviour. The separation of concerns in the build environment mirrors the separation in the runtime: conversational behaviour is configured in natural language, deterministic controls are written in Agent Script. Neither replaces the other. Additionally, Agent Script was open-sourced at TDX 2026. The full specification, parser, and compiler are on GitHub. For compliance teams and legal teams who need to understand and audit agent behaviour independently of the vendor, this is significant: Agent Script is a readable, auditable format that does not require Salesforce expertise to understand the logic. Who needs Agent Script now, and who can wait Use case type Determinism non-negotiable Pure AI reasoning is fine Customer service — account access Identity verification must precede account lookup without exception. Agent Script enforces the required step regardless of conversation flow. Handling FAQ questions that do not involve personal data — product information, store hours, general policies. Financial services Regulatory disclosures must be delivered before a product recommendation. Compliance checkpoints cannot be skipped regardless of conversation length. Summarising publicly available market information with no personalised recommendation required. Sales qualification Handoff to a human rep must trigger at a specific deal stage or value threshold,

TrueSolv — Footer Component