What it is
Agent Script is Salesforce's scripting language for defining how an Agentforce agent behaves, combining deterministic rules with LLM reasoning. It gives builders granular control over steps that must always happen the same way, such as conditions, variables and escalation to a human.
Why it matters
Pure prompting leaves business-critical steps up to the model. Scripted logic makes the parts that must be predictable, like when to hand a conversation to a person, behave the same way every time.
Key components
- Conditional logic (if / else if)
- Expression functions
- System variables for connection and modality
- Deterministic escalate statement
How it connects
Agent Script is authored in Agentforce Builder. The Winter '27 updates added more expression functions, else-if conditions, new system variables and a top-level escalate statement for deterministic human handoff.
Good to know
Nested if statements and elif were not supported as of the Winter '27 developer guide; check current release notes before designing complex branches.
Frequently asked questions
What is Agent Script in Agentforce?
Agent Script is the language used to define Agentforce agent behavior with deterministic rules, such as conditions, variables and escalation, alongside LLM reasoning.
Related terms
Agentforce
Salesforce's AI agent platform that enables businesses to build, customize, and deploy autonomous AI agents across sales, service, marketing, and commerce.
Topics and Actions
The building blocks of Agentforce agents — topics define what an agent can discuss, actions define what it can do.
Agent Handoff Protocol
The structured rules governing how one AI agent transfers context and control to another agent or human.
Agent Builder
Salesforce's low-code tool for creating and configuring Agentforce agents — define topics, actions, and guardrails without writing code.
Guardrails
AI guardrails are the rules and controls that keep an AI model or agent inside safe, approved boundaries, limiting what it will discuss, which actions it can take, what data it can see and what it is allowed to say.
Agent Script in practice
Articles from the Funnelists Team that put this term to work.

How Agentforce Routes Conversations Between Agents and Humans
Agentforce uses defined routing patterns to move tasks and context between AI agents or to people while keeping full conversation history intact.

Agent Design, Not Chatbot Design, Delivers Reliable Automation in Agentforce
Agent design defines goals, actions, and boundaries so systems handle variable enterprise processes. Chatbot design maps fixed paths that break when inputs change or systems interact.

How to Build an Agentforce Rollout Plan
A clear, phased approach turns Agentforce from a promising tool into measurable results. This guide walks through the steps to plan, pilot, and scale Agentforce agents.

Questions to Ask Before Handing Over a Custom Agentforce Build
Verify data readiness, permission scoping, and testing before handing control to a custom AI agent, so it does not act on incomplete information or exceed intended boundaries.

