Agent Script

Agent Script gives builders precise control to create business-ready agents that deliver reliable results. It blends the creative problem-solving of LLMs with the certainty of a deterministic system. You get auditable, step-by-step control over agent behavior, ensuring your critical workflows follow specific business policies and achieve consistent, intelligent outcomes.

What was Agent Script built to do?

Guarantee consistency.

Eliminate the inherent randomness of Large Language Models, guaranteeing that your critical business workflows follow the exact same steps every single time.

Inject real-time context.

Use real-time data to provide your agent the context it needs, allowing it to adapt instantly as new information arrives for smarter decision making.

Break the prompt doom loop.

Replace fragile, overloaded system prompts with structured logic, eliminating the latency, complexity, and confusion that comes from forcing models to memorize too many rules.

 

Build agents that deliver consistent outcomes.

Define tailored workflows that combine deterministic logic with agentic reasoning to deliver the right result. Encode business logic directly in the agent’s configuration so that outcomes remain consistent and repeatable even as underlying models evolve. This eliminates random deviations and reduces failure rates.

Reasoning instructions screenshot

Configure every element of the agent workflow. Provide the right context upfront to ensure accuracy, speed, and reliability at scale. Fully customize how requests are handled: use strict rules to guide the path, or let the agent’s reasoning interpret the user’s needs. Agent Script gives you the flexibility to combine both approaches seamlessly.

Configuration screenshot

Capture key information from the user or your systems and store it as variables to give your agent consistent memory. You can then apply these variables instantly to drive smarter decision-making and high-quality results.

Information capture screenshot
Reasoning instructions screenshot
Configuration screenshot
Information capture screenshot

Simulate and test agents at scale.

Preview agent behavior before going live. Send a message in the simulator and instantly see how your agent responds, with a detailed interaction summary, AI-generated overview, and clear visibility into key events. Hover over any step to reveal metadata and drill down into the exact moment things went right (or wrong).

Agentforce Builder Screenshot

Understand exactly how your agent makes decisions. Dive into full-trace data that shows the topics selected, the actions triggered, variable changes, and timing. Follow hyperlinks into detailed span views to pinpoint failures, explore logic branches, and get the context needed to refine your agent’s behavior with confidence.

Agentforce Builder Screenshot
Agentforce Builder Screenshot
Agentforce Builder Screenshot
Screen shot of Agentforce Builder
Get started with code samples from our agent library.

Use a collection of easy-to-digest code examples demonstrating Agent Script best practices. Each recipe shows you how to code a specific agent while adhering to best practices.

Agent Script FAQ

Agent Script is a scripting language for AI agents that gives builders precise control by blending deterministic rules with agentic reasoning.  This ensures predictable outcomes and reliable, consistent performance for complex business workflows.

The main benefit is achieving predictable and reliable agent behavior for critical enterprise workflows. It provides a deterministic anchor, eliminating the randomness of LLMs. This gives enterprises full control over agent actions and ensures business policies are strictly enforced.

Agent Script does not cost anything and is included with the purchase of Agentforce. The AI assistance inside Agentforce Builder is included, and has no cost to use within the builder.

Build agents with Agent Script in Agentforce Builder, which is located inside Agentforce Studio in the App Launcher. Access is granted by admin permissions.

Yes. Agentforce comes with a library of prebuilt agent templates you can use right away, including the Service Agent, Employee Agent, Campaign Agent, Sales Development Rep, Sales Coach, Guided Shopping (B2B & D2C), Guided Shopping (B2C), and Setup Agent templates. Each can be customized with your own data, guardrails, and business logic to fit your exact needs.

No. There are three ways to build agents. With AI Assistance, with natural language in the canvas, or with Agent Script. All methods of building use the same Salesforce metadata foundation.

Yes, you can build in whichever method you prefer at any time: either the low-code canvas view or the developer friendly script view. Regardless of where you choose to build, you are always writing Agent Script.

Copy, paste, and reuse agents. Agents are portable, which means you can quickly share agents across teams or environments and build on proven patterns without starting from scratch.