Scale Agent Development with Salesforce Headless 360

Take your Agent Development Lifecycle headless with CLI-driven, AI-assisted workflows that help teams build complex agents faster while preserving quality as they scale.
The first version of an agent you build through the declarative Agentforce Builder feels like magic. As the agent evolves, the manual overhead becomes more noticeable. By the fifth iteration, those manual steps begin to add up. By the tenth, you may be tracking version history in a spreadsheet, running tests by hand before every deployment, and checking that each change has not affected something several iterations earlier.
The approach that brings a first agent to life is not always the one that supports it at scale. As development progresses, each change may still require a browser session and manual input, while the guardrails, fixes, and lessons gathered along the way can be difficult to carry forward as reusable assets.
Go headless to scale agent development
Moving your Agent Development Lifecycle (ADLC) to Salesforce Headless 360 lifts that ceiling. Managing the lifecycle through tool-agnostic application programming interfaces (APIs), command-line interfaces (CLIs), Model Context Protocol (MCP) tools, and skills, rather than a browser alone, puts the agent within reach of AI coding tools that can diagnose, test, and troubleshoot it directly, and makes version control, automated testing, and repeatable deployments native to your workflow.
The Agent Development Lifecycle Fundamentals guide on the Salesforce Architecture Center lays out the full framework. This post serves as the guide’s hands-on companion, a playbook that shows the real-world impact of going headless across a number of projects. On one such project, we migrated a booking agent from click-configured Agentforce Builder to Agent Script. When we started, it was only passing 14 of our 24 test scenarios. After a fast, headless diagnose-and-refactor, all 24 passed consistently across repeated runs.
The Agent Development Lifecycle: From Conception to Production
Equip yourself with the practical knowledge to use Agentforce pro-code tools to build, deploy, and monitor agents safely and efficiently across the ADLC.
Scale with AI: what headless unlocks
Headless 360 decouples the agent’s capabilities from any single interface. It does not replace the declarative tools or take away the user interface (UI). The key is the AiAuthoringBundle, the canonical representation of your agent’s configuration. Subagents, instructions, actions, and routing logic are all stored as structured metadata. Whether you edit through the browser or a local .agent file written in Agent Script, you are modifying the same bundle, so the declarative Agentforce Builder and your IDE are two lenses on one set of metadata.
Once the agent exists as metadata, you can treat it as code, and the work that gets hard at scale becomes native to the workflow:
- Version control from day one. Pull the bundle from the org with
sf project retrieve startand commit it. From then on, the repository is your single source of truth for the agent, and every change is traceable, diffable, and reversible. - Automated quality gates. Tests run as part of the build loop, not as a manual gate at the end of a sprint. On the booking agent, re-running all 24 scenarios (and more as the suite grew) on every iteration took minutes, not half a day. We caught regressions early, before they became costly and hard to trace.
- Tooling of choice. Design, build, and debug in the tools your team already prefers, whether that is Agentforce Vibes, Claude Code, GitHub Copilot, Codex, Cursor, or VS Code. Open-source MCP connections, such as the Salesforce DX MCP Server, bridge the local IDE straight to your Salesforce sandboxes, so the same skills and guardrails travel across the AI coding tool and underlying model your team chooses.
Once the agent’s logic is inspectable metadata, tools can reach through the CLI and MCP, and AI can work on the agent itself. AI can cluster a hundred scattered failures into root causes, run hundreds of test conversations against the agent unattended, correlate logs and traces across systems to pinpoint the one step that misbehaved, and hand back the evidence. Work that used to take a team days can now be completed in an afternoon.
Map every ADLC phase to a headless workflow
Each ADLC phase has a headless equivalent. The table below sets each phase’s traditional, UI-driven approach beside the headless workflow that replaces it.
| ADLC Phase | Traditional (UI) Workflow | Headless Workflow |
| Design | Manual triage of transcripts and config | CLI export, AI-powered clustering of failures into root-cause categories |
| Development | Manual typing in text boxes | AI-assisted agent building and troubleshooting, with human review, in a local IDE |
| Testing | Manual preview conversations | Automated, repeatable eval runs at scale via the Salesforce CLI |
| Deployment | Manual promotion between orgs | AI-run CLI deploys, correctly sequenced and gated on a passing test suite |
| Monitoring | Manual spot-checks after launch | Live session traces in Data 360, surfaced through Agentforce Observability |
We walk through all five phases below, each a headless practice you can replicate.
Design: Diagnose gaps with AI-assisted analysis
On the booking-agent migration, we started by exporting the agent’s metadata, conversation transcripts, and session-tracing logs, then ran AI-powered local tools to group its failures into root-cause categories and flag where deterministic logic was missing.
That grouped 127 individual issues into 23 candidate root-cause categories in 20 minutes, work that previously meant hours of reading through transcripts and traces. After an architect review with domain knowledge, we consolidated those 23 candidate categories into 15 core logical pathways, representing the distinct booking journeys the agent actually had to handle.
This approach can also reach beyond the agent’s own logic, into the data-retrieval layer it depends on. On a separate project, an agent kept missing a whole class of questions, so instead of guessing, we steered the AI from the command line to run the retriever’s hybrid search and show us the ranking the way the agent sees it. The answer was there but ranked far down, well below the top results the retriever returns to the agent, so we asked the AI to trace why.
It found the cause: each chunk had been indexed without its page title, so it had lost the context that tied it to its topic. On its suggestion, we switched on the search index’s built-in prepend-fields option, carrying the title into every chunk, which raised its relevance ranking and lifted the right content into the top results.
Development: Build and troubleshoot with AI
In a headless workflow, you can let an AI do the building and still stay in control, because every change it makes lands in your IDE as a commit. That is the source control you already use for code, finally applied to the agent itself. A reviewer catches the AI’s small mistakes in the diff, like an action written in plain language where the code needs {!@actions.myAction}.
The same principle holds for big changes too. Take breaking a subagent’s monolithic instruction block into an optimized, testable sequence of gated steps: the AI lays out the refactor in plan mode, you approve it before anything changes, and each step arrives as a reviewed, reversible commit rather than one risky rewrite.
Open-source skills keep the AI grounded in up-to-date platform know-how, so it can navigate Salesforce effectively and follow established patterns. Our workflow leaned on three of them, covering authoring, testing, and observability: the agentforce-generate, agentforce-test, and agentforce-observe skills from Salesforce’s official sf-skills repository.
Built on the open Agent Skills format, they act like context-aware reference libraries that activate on demand inside your AI coding tool, loading the correct CLI command sequence, enforcing the publish-before-activate order, and flagging common errors without you memorizing the documentation.
Headless workflows become especially valuable during troubleshooting. On a recent engagement, an agent’s knowledge retriever kept coming back empty at runtime, even though the same search worked when an admin ran it in the Agentforce Builder preview. The team had spent days on it without a lead, the evidence buried in thousands of lines of telemetry across two separate systems.
We gave the AI a hypothesis and pointed it at both systems. It aligned them on a shared trace ID, cross-referenced our internal engineering channels over the Slack MCP to rule out a couple of false positives, and found the exact line where the results vanished. The retriever had returned all three matching articles, but a post-processor filtered every one out before the agent saw them, because the running service agent’s system user did not have access to the underlying knowledge records, a documented consequence of record-level sharing.
No one was going to crack that manually. In this case, AI did it in minutes because an architect had first grounded it by bringing together the telemetry, logs, and known-issue history over MCP; directing it toward the right signals; and telling it what to rule out.
Testing: Make every test a repeatable, reusable asset
Testing turn-by-turn in a browser preview panel is fine for a demo, but it doesn’t scale. Every path is a manual click, and there is no repeatable way to re-run tests after a change. So, as your subagents multiply, regressions slip through unnoticed.
We used the Agentforce Testing Center to write conversation-level test specs that live in Git alongside the agent they validate. Each case specifies the user’s utterance, the expected sequence of actions, and pass/fail criteria written in plain language. The agentforce-test skill carries the sf agent test commands, so you can run the whole test suite on every change as you work. For a full walk-through of this test-spec workflow, see Master the Agentic Development Lifecycle for Agentforce.
Because those tests run headlessly, you can execute far more of them than anyone could click through by hand. Further, because the testing is AI-assisted, you are not tied to hardcoded scripts: AI can vary the conversation to test a goal from several angles and evaluate each run on plain-language criteria. That matters for agents in particular: adjust one topic and another can start behaving differently. So, run the full set before you stage or ship a major change to catch those regressions first.
Deployment: Publish through the CLI, not the browser
Mature teams run their deployments through continuous integration and continuous delivery (CI/CD) tools, and those increasingly ride on the same Headless 360 APIs and AI to streamline the pipeline. The booking-agent team did not have one, so we deployed from the CLI, describing the intent in natural language and letting the agentforce-generate skill run the sequence in the right order.
The deployment command order is where teams typically trip up. A standard source deploy (sf project deploy start) pushes supporting metadata such as Apex, flows, and permission sets, but not the compiled runtime bundle the agent actually executes. Skip that step, or run the commands out of order, and you risk deployment errors or unknowingly leaving users on the old agent version.
The skill runs sf agent publish authoring-bundle to compile your Agent Script into a new, runnable version of the agent. Publishing does not make it live, though: a separate sf agent activate step promotes that version to the one your users actually see, so you can publish, then test, and only activate after it passes your test suite.
Monitoring: Observe, measure, and improve
When Agentforce Session Tracing is enabled, every conversation in production is captured in Data 360 through the Session Tracing Data Model and surfaced in Agentforce Observability, where the agentforce-observe skill reads them. That turns the agent’s lifecycle into a continuous cycle, feeding insights from production back into development so each version is more reliable and effective than the last. In a recent project, a live quoting agent kept behaving inconsistently: it told users a quote was on the way when it was not, or created the Opportunity but not the Quote.
The customer first tried addressing the behavior through prompting, but the issue persisted. The session traces uncovered why: the model was narrating an action instead of taking it. So we made the flow deterministic instead, chaining the create actions and gating each step with available_when so it could neither run ahead nor announce a step it had not reached. Then we used the test harness to A/B-test different combinations of prompts, variables, and gates, until it behaved reliably.
Start your journey with headless agent development
Headless development loops are far tighter than traditional agile sprints. Because an AI assistant does the diagnosis and runs the evals, with every change source-controlled and CLI-validated as the safety rail, a single design-build-test loop turns over in days rather than the weeks a manual rebuild would take. Work through the three steps below to get started:
- Set up and make your first cut. Authenticate the Salesforce CLI and install the skills into whichever AI coding tool suits you from Salesforce’s official sf-skills repository, which covers both general platform work and the agent lifecycle. Pull your agent’s metadata with
sf project retrieve start, pick your most complex subagent, and get a first cut of its refactored logic into source control. - Refine and test. Tighten the structure and harden the boundaries between conversation and transactional logic. If you are phasing a large subagent, the official Salesforce multi-step workflow recipe shows how to gate each phase with a step variable and
available whenconditions. Validate each change against a growing set of conversation-level tests. - Build the test harness and head into UAT. Formalize your test-spec suite, commit it to Git, run it through the CLI before every deployment, and begin user acceptance testing against a version that already clears your quality bar.
By the end of the week, you’ll be on your way to taking your agent headless and refining it with AI assistance, all under source control, with a CLI-run test suite that catches regressions before they reach production. The Trailhead project below is a great way to put it into practice end to end, from Agent Script authoring to publishing.












