← Back to Reading
ByteByteGo 2026-10-26

A Deep Dive into Salesforce’s Agent Tech Stack

Building an AI agent using a single large prompt is a common naive design where business rules, tool descriptions, and context are lumped together in hopes that the model adheres to them. This approach expects the language model to enforce rules, retrieve identity information, integrate data, and constrain behavior all simultaneously. In practice, models struggle as instruction counts grow; for instance, the initial version of Salesforce's Agentforce saw instruction adherence deteriorate beyond eight instructions. Research benchmarks like IFScale reinforce this limitation, showing that models treat instructions merely as text rather than hard constraints, necessitating external architecture beyond prompt engineering. Salesforce enhances system reliability by offloading tasks from large language model prompts into dedicated systems across its four-layer platform stack. The architecture consists of the data layer (Data 360), application layer (Customer 360), agent layer (Agentforce), and surface layer. Specialized systems handle discrete tasks, such as Agent Script enforcing business logic and the Agent Context Engine filtering data before it reaches the model. This design delegates routine operations to deterministic systems so the model only handles tasks requiring reasoning. Agent Script is an open-source, Python-like domain-specific language developed by Salesforce to enforce deterministic agent behavior outside of LLM prompts. By compiling agent definitions into an Agent Graph executed by the Atlas Reasoning Engine, the system guarantees rule enforcement through structured blocks like before_reasoning and after_reasoning. This architecture separates deterministic tasks, such as database lookups, from language model reasoning, significantly improving reliability and avoiding prompt instruction limits.

Read the original ↗
Contents 8 sections
  1. 01The naive design: one large prompt
  2. 02How Agentforce is built
  3. 031. Deterministic instructions with Agent Script
  4. 042. Unified profiles with Data 360
  5. 053. Relevant context with Agent Context Engine
  6. 064. Permission management with Agent Identity
  7. 07Where the agent runs
  8. 08What’s next

The naive design: one large prompt

Building an AI agent using a single large prompt is a common naive design where business rules, tool descriptions, and context are lumped together in hopes that the model adheres to them. This approach expects the language model to enforce rules, retrieve identity information, integrate data, and constrain behavior all simultaneously. In practice, models struggle as instruction counts grow; for instance, the initial version of Salesforce's Agentforce saw instruction adherence deteriorate beyond eight instructions. Research benchmarks like IFScale reinforce this limitation, showing that models treat instructions merely as text rather than hard constraints, necessitating external architecture beyond prompt engineering.

  • A single large prompt expects the model to simultaneously enforce rules, resolve identity, manage context data, and constrain execution.
  • The first version of Agentforce relied on a single-prompt approach and observed that performance degraded when exceeding eight instructions.
  • Models do not treat natural language instructions as strict rules, but merely as context tokens without execution guarantees.
  • Instruction-following performance deteriorates as prompt complexity and the number of instructions increase.
  • The IFScale benchmark revealed that even top-performing models followed only 68% of 500 simple instructions placed in a single prompt.

How Agentforce is built

Salesforce enhances system reliability by offloading tasks from large language model prompts into dedicated systems across its four-layer platform stack. The architecture consists of the data layer (Data 360), application layer (Customer 360), agent layer (Agentforce), and surface layer. Specialized systems handle discrete tasks, such as Agent Script enforcing business logic and the Agent Context Engine filtering data before it reaches the model. This design delegates routine operations to deterministic systems so the model only handles tasks requiring reasoning.

  • Salesforce divides its platform into four distinct layers: data (Data 360), application (Customer 360), agent (Agentforce), and surface.
  • Instead of relying on monolithic prompts, dedicated systems across the stack handle discrete tasks to improve overall reliability.
  • Agent Script is a scripting language running in the Agentforce layer designed to enforce rules.
  • The Agent Context Engine is a separate system responsible for determining which data is passed to the model.
  • The core AI model is reserved specifically for reasoning steps rather than operational execution or data retrieval.

1. Deterministic instructions with Agent Script

Agent Script is an open-source, Python-like domain-specific language developed by Salesforce to enforce deterministic agent behavior outside of LLM prompts. By compiling agent definitions into an Agent Graph executed by the Atlas Reasoning Engine, the system guarantees rule enforcement through structured blocks like before_reasoning and after_reasoning. This architecture separates deterministic tasks, such as database lookups, from language model reasoning, significantly improving reliability and avoiding prompt instruction limits.

  • Salesforce developed Agent Script to enforce rules deterministically outside of LLM prompts after Agentforce hit instruction limits.
  • Agent Script is open source and features syntax similar to Python.
  • Agent Script files compile into an Agent Graph specification executed by the Atlas Reasoning Engine.
  • The runtime mimics triggers by using before_reasoning and after_reasoning blocks to execute deterministic code before and after calling the LLM.
  • Separating deterministic code tasks from model reasoning ensures predictability while leaving the LLM free to focus purely on reasoning over prepared context.

2. Unified profiles with Data 360

Data 360 solves customer identity resolution by replacing model-based record matching with a reliable three-step data layer. First, it connects directly to disparate data sources, such as CRMs and cloud data warehouses like Snowflake, to ensure real-time visibility. Second, it automatically harmonizes inconsistent schemas across thousands of sources into a shared data model. Finally, it applies configurable matching rules to resolve identities into a unified profile without altering underlying source records.

  • Asking an AI model to deduce if records belong to the same person introduces unreliability into agent workflows.
  • The data layer executes a three-step process to manage customer identity: reaching data directly, harmonizing data formats, and resolving identities.
  • Data 360 automatically maps source data into a common model with standard entities such as person, lead, and account across thousands of sources.
  • Identity resolution in Data 360 uses configurable rules including exact match, fuzzy matching, and normalized rules for cleaned-up comparisons.
  • Source records remain unmodified while being linked to a centralized, unified profile.

3. Relevant context with Agent Context Engine

The Agent Context Engine (ACE) is a context management system in Data 360 that decides what relevant data should be injected into a prompt rather than overloading it with all available data. ACE handles requests across a six-step pipeline consisting of Resolve, Plan, Reconcile, Govern, Compile, and Learn. In an insurance support benchmark, ACE dramatically cut token consumption across multi-turn queries compared to a naive design without context management. The engine optimizes context using in-memory profile graphs, GraphRAG indexing for document filtering, and staged memory promotion.

  • Agent Context Engine (ACE) is a new context management component within Data 360 designed to sit between raw data and LLM prompts.
  • ACE executes queries via a six-step workflow: Resolve, Plan, Reconcile, Govern, Compile, and Learn.
  • Using ACE reduced an insurance query's prompt token count from 124,000 to 9,000, and a multi-turn session from 300,000 to 65,000 tokens.
  • Context retrieval can rely on GraphRAG, which combines exact-word matching, semantic search, and linked entity indexing to filter documents.
  • ACE distinguishes transient memory from approved facts, only promoting verified actions into persistent long-term memory.

4. Permission management with Agent Identity

In typical AI agent deployments, agents inherit full user credentials and permissions, which creates significant risk because agents can replicate errors rapidly. To resolve this, Salesforce introduced Agent Identity, giving agents distinct identities and permissions separate from the users they act on behalf of. Under this system, dual tokens represent both the agent and the user during authentication. Operations are only permitted if they satisfy the user's permissions, the agent's permissions, and the applicable data policies.

  • Most current AI agent setups assign the user's full credentials to the agent, creating risk when automated mistakes scale quickly.
  • Customers require agents to operate on behalf of users without inheriting the user's full permission set.
  • Agent Identity provides AI agents with their own unique identities and admin-configured permissions.
  • Authentication in Agent Identity uses two tokens simultaneously: one for the user and one for the agent.
  • Salesforce executes an operation only if it passes checks across agent permissions, user permissions, and data policies.

Where the agent runs

Salesforce enables external AI agents and platforms to access its capabilities by adopting a headless architecture that exposes APIs, skills, and protocols rather than requiring its native interface. To support this, Salesforce created AIforce and the Headless Toolkit, utilizing the Model Context Protocol (MCP) to connect external agents like Claude or Slack. Because exposing hundreds of individual tool definitions inflates context window consumption and costs, the Salesforce MCP Server optimizes tool retrieval down to four core tools: discover, describe, and dispatch. Through this indexing approach, an agent searches for matching skills and inspects parameters dynamically before executing API calls.

  • Headless software architectures separate the underlying platform from its user interface, exposing features via APIs to integrate with external surfaces like Slack or Claude.
  • Salesforce built AIforce and the Headless Toolkit to deliver platform data, workflows, and logic to outside environments using APIs, skills, and MCP.
  • Salesforce APIs currently handle 9.6 billion calls per day, and its skills are published in an open GitHub repository named sf-skills.
  • Loading hundreds of tool definitions directly into an agent's context window consumes significant capacity and increases inference costs on every prompt.
  • The Salesforce MCP Server addresses tool-count bloat by implementing an index-based workflow using only four tools: discover, describe, and dispatch.

What’s next

Current AI scaffolding components exist across fragmented products, requiring unified architecture. According to MK and Khushwant, the next evolution is the Enterprise AI Harness, a unified system where enterprises can plug in data and agents. This harness provides evaluation, tracing, and auxiliary capabilities across all connected agents regardless of whether they run on Agentforce or external platforms.

  • Model scaffolding tools currently exist across separate and disparate products.
  • MK and Khushwant propose unifying these scaffolding pieces into a single system called Enterprise AI Harness.
  • Enterprise AI Harness allows organizations to plug in agents and data to access centralized evaluation and tracing.
  • The harness supports agents operating on Agentforce as well as third-party runtimes.