For AI agents and developers: machine-readable getting-started guide and automated Salesforce org setup (/llms.txt).

Agent Script

Agent Script

Agent Script is a programming language purpose-built for AI agents. It gives you deterministic control over workflows while letting the LLM reason where it matters. One file defines your entire agent: subagents, actions, transitions, and guardrails.

Readable by Anyone

Syntax designed so product managers, architects, and developers can all understand what an agent does at a glance.

Deterministic Where It Counts

Business-critical logic runs before the LLM. Conditionals, transitions, and action chains execute exactly as written.

Source-Controlled

.agent files live in your repo. Version, diff, review, and deploy agents the same way you ship code.

Your First Agent in 30 Lines

Here's a complete agent that routes customer requests, verifies identity, and manages orders:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
config:
  developer_name: "Support_Agent"
  agent_type: "AgentforceServiceAgent"

system:
  instructions: "You are a customer support agent. Be concise and helpful."

start_agent topic_selector:
  description: "Welcome the user and route to the right subagent"

  reasoning:
    instructions: ->
      | Welcome the user and determine what they need help with.
      | Use the available actions to route them appropriately.

    actions:
      go_to_orders: @utils.transition to @subagent.Order_Management
        description: "Handles order lookup, refunds, and updates"

      go_to_faq: @utils.transition to @subagent.General_FAQ
        description: "Answers common questions about products and policies"

      go_to_escalation: @utils.transition to @subagent.Escalation
        description: "Connects user with a human representative"

That's it. The agent greets the user, the LLM classifies their intent, and they're routed to the right subagent. No framework, no boilerplate, no deployment pipeline to configure.

Two Types of Instructions

Agent Script's power comes from separating what's deterministic from what needs AI reasoning. Two arrow types make this explicit:

Patterns That Ship

Building Blocks

Deploy from Your IDE

Agent Script files are standard source — build, test, and deploy using the tools you already know:

What's Coming Next

On the Roadmap

Agent Script is evolving fast. Here's what's shipping soon:

  • MCP Integration — Connect agents directly to Model Context Protocol servers. Your agent will be able to call external tools, databases, and APIs through the standard MCP interface, making it a first-class citizen in the broader AI tooling ecosystem.
  • Enhanced Flexibility — More expressive control flow, richer variable types, and deeper integration with Salesforce data models. Write less configuration, get more capability.
  • Cross-Agent Orchestration — Agents that can invoke other agents as tools, enabling multi-agent architectures for complex enterprise workflows.

Quick Reference

SymbolMeaningExample
->Logic instructions (deterministic)instructions: ->
|Prompt instructions (sent to LLM)| Help the customer with their order
@variables.Reference a variable@variables.customer_email
@actions.Reference an action@actions.Get_Order
@subagent.Delegate to another subagent@subagent.Order_Management
@outputs.Reference action output@outputs.order_data
@utils.Utility functions@utils.transition to @subagent.FAQ
{!expr}Interpolate in prompts{!@variables.name}
...LLM slot-fill tokenwith order_id = ...
#Comment# This is a comment

Language Reference

Variable Types

TypeNotes
stringAlphanumeric text
numberIEEE 754 double-precision (integers and decimals)
booleanTrue / False (case-sensitive, capitalize first letter)
objectJSON object — regular variables only, not linked
dateAny valid date format
idSalesforce record ID
list[<type>]List of any primitive type — regular variables only, not linked

Variables come in three kinds: regular (mutable, with optional default), linked (read-only, tied to an external source like @session.sessionID), and system (predefined, read-only — currently only @system_variables.user_input).

Action Targets

Actions support several target protocols:

TargetFormatExample
Apexapex://<class>.<method>apex://c__CustomerActions.getProfile
Flowflow://<flow_name>flow://Issue_Refund
Promptprompt://<template_name>prompt://Case_Summary_Template

Action parameter types: string, number, integer, long, boolean, object, date, datetime, time, currency, id, list[<type>].

Operators

CategoryOperators
Comparison==, !=, <, <=, >, >=, is, is not
Logicaland, or, not
Arithmetic+, -

Conditionals support if and else only (no else if).

Utils

UtilityPurpose
@utils.transition to @subagent.<name>One-way transfer to another subagent. No return to caller. Discards any accumulated prompt from the source subagent.
@utils.setVariablesLets the LLM set variable values from conversation context. Use ... token for LLM-determined values.
@utils.escalateHands off to a human service rep via Omni-Channel. Requires an active connection messaging block.

Flow of Control

  1. Every utterance starts at the start_agent subagent (the router).
  2. The router classifies intent and transitions to the appropriate subagent.
  3. Reasoning instructions are parsed sequentially, top-to-bottom.
  4. Logic instructions (->) execute deterministically — actions run, variables set, conditions evaluate.
  5. Prompt instructions (|) are concatenated into a single prompt sent to the LLM.
  6. after_reasoning runs after the LLM responds.
  7. The next utterance returns to start_agent.

Transitions via @utils.transition to are one-way — the caller's context is discarded. Use @subagent.<name> as a tool reference for round-trip delegation that returns to the caller.

Keep Going