Agentforce testing and governance
Test scenarios, guardrails, human handoff, monitoring and change control for Agentforce agents, using the tools and statuses Salesforce publishes.

An agent that passed a demo can still fail in production. It might answer outside its scope, miss an escalation or drift after a prompt change. Our Agentforce testing and governance service gives you repeatable tests, clear guardrails, a safe handoff to people and a routine for monitoring and changing agents after launch.
For the testing techniques themselves, read Agentforce agent testing and guardrails. To build agents, see Agentforce and AI automation.
What's included
| Area | What we set up | Salesforce tooling and status |
|---|---|---|
| Test design | Scenario sets for normal requests, edge cases, refusals and escalations | Agentforce Builder, where Salesforce says agents are built, tested and monitored |
| Scoring | Custom measures of answer quality | Custom Scorers: API GA, UI Beta |
| Prompt testing | Batch tests of prompt templates | Prompt Builder batch prompt testing: Beta |
| Voice | Tests for voice conversations | Voice and Conversation Testing: Beta; Voice Observability: GA |
| Experiments | A/B tests between agent versions | A/B Experimentation for agents: Beta |
| Guardrails | Scope, data masking, toxicity checks and permissions | Einstein Trust Layer |
| Monitoring | Health dashboards and conversation review | Agent Health Monitoring: GA; Agentforce Observability |
| Optimisation | Regular review of failing conversations | Agent Optimizer: GA announced for October 2026 |
How we work
- 01
Discovery
Review each agent's purpose, topics, actions, data access and current test coverage.
- 02
Design
Write test scenarios and pass criteria, define guardrails and escalation rules, and agree owners.
- 03
Build
Set up test sets, scorers, monitoring and the review routine, and document the release process.
- 04
Test
Run the full test set, fix gaps, and re-run before any change goes live.
- 05
Launch
Release in stages, with monitoring and a clear rollback path.
- 06
Support
Review conversations and scores regularly, update tests as topics change, and report to owners.
Human handoff
Agent Script, used by the new Agentforce Builder, includes an escalate instruction, so handoff can be designed into the agent's logic rather than added later. We define when an agent must hand over, what context passes to the person, and how that is tested. For a worked service example, see the service agent with human handoff.
Governance
Good governance is mostly ownership and routine. Each agent needs a named owner, an approval step for changes, a test run before every release and a regular review of conversations. Lifecycle Center (formerly DevOps Center) adds governance for agent-generated code, which Salesforce describes as GA. Observability Center in Salesforce Guardian is in Beta. Our responsible AI page explains how we approach this work.
Prerequisites and licences
You need Agentforce enabled in your org and users with the Manage AI Agents permission to work in Agentforce Studio. Some monitoring and security tools are separate add-ons, so we confirm what your licences include.
Common mistakes
- Testing only the happy path.
- Changing prompts or topics in production without re-running tests.
- No owner after launch, so nobody reads the conversations.
Workflow diagram
Explore how the pieces fit together. Select a step to read what happens there.
Select any step in the diagram, or use Step through, to see what happens at that point and why.
Text version: every step in order
- Action proposed AgentforceReply or record change
The agent prepares an action but does not run it yet. The proposal includes the inputs and the evidence the agent used.
Next: Check risk
- Check risk Policy checkConfidence, impact, data
Rules look at the action type, the amount or impact, the data involved and how certain the agent is. Business owners, not developers alone, set the thresholds.
Next: Safe to auto-run?
- Safe to auto-run? Policy check
Only low-risk, reversible actions with high confidence should run without a person. Start with more reviews and relax them as evidence builds.
Next: Yes: Auto-approved; No: Human review
- Auto-approved AgentforceRule used is logged
The action is cleared to run without a person. Log which rule allowed it, so auto-approvals can be sampled and the rule tightened if needed.
Next: Action runs
- Human review Human reviewerDraft, evidence, context
The reviewer sees the proposed action, the reasons and the source data in one place, so a decision takes seconds rather than a fresh investigation.
Next: Reviewer approves?
- Action runs AgentforceResult shown to the user
The approved action runs with defined permissions, and the user sees the outcome.
Next: Audit trail
- Reviewer approves? Human reviewer
The reviewer approves, edits and approves, or does not approve. Their choices are useful test cases for improving the agent.
Next: Yes: Action runs; No: Escalate, decline
- Audit trail Audit trailWho, what, when
Every outcome is logged with the proposal, the decision, who made it and when. Regular review of the log shows where rules or the agent need changing.
End of the flow.
- Escalate, decline EscalationSpecialist decides, reason kept
Unclear or high-impact cases go to a specialist or team lead; clear refusals are declined with a reason the user can understand.
Next: Audit trail
Related services
Salesforce AI readiness assessment
Check data, process and licence readiness first
→Salesforce testing and QA
Testing across the wider org
→Salesforce security and governance
Permissions, access and platform controls
→Questions we hear
Can we test agents before customers see them?
How many test scenarios do we need?
Should we rely on Beta testing features?
Who should own an agent after launch?
Sources
Make your agents testable
Tell us which agents you run or plan to launch. We'll suggest a test and governance setup that fits.




