---
title: How do you test Salesforce Agentforce agents before deployment?
url: https://opencontroller.lyzr.com/blog/test-agentforce-agents-before-deployment
published: 2026-11-13
updated: 2026-11-13
author: Lyzr
---

# How do you test Salesforce Agentforce agents before deployment?

**Use Agentforce Testing Center in a sandbox to check three things for every test utterance: did the agent pick the right topic, run the right actions and give the right outcome. Build the test set from real requests plus AI-generated cases, re-run it on every change, and save each run with the agent version so it becomes release evidence.**

Testing Center is Salesforce's built-in tool for this. It is a good functional test harness. It is not the whole test plan, and it does not file evidence for you. This guide covers both.

## What does Agentforce Testing Center check?

| Check | Question it answers | How it is judged |
|---|---|---|
| Topic | Did the agent route to the expected topic (subagent)? | Exact match on API name |
| Actions | Did it run the expected actions? | Match on the list of action API names |
| Outcome | Was the response what we expected? | LLM-based comparison with the expected response |

A test case is one row in a CSV. The template from the Upload Test Cases tab has columns for **Utterance**, **Expected Subagent**, **Expected Actions** (for example `['IdentifyRecordByName', 'SummarizeRecord']`) and **Expected Response**. Utterance is required, plus at least one other column. Empty expected values count as failures, so fill them in.

If you do not have a test file yet, Testing Center can generate cases with AI from the agent's metadata and the knowledge it can reach. Batch tests run in parallel, and one job can evaluate thousands of cases.

## How should you build an Agentforce test set?

Salesforce suggests five steps: identify scenarios and create test data, review the generated cases, run tests and evaluate, perform human validation, then review and iterate. In practice, make the test set cover these groups:

1. **Top real requests.** Pull common requests from cases, chat logs or the team that will use the agent.
2. **Each topic and action.** At least a handful of utterances per topic, and one per action, so a broken action shows up.
3. **Out-of-scope requests.** Questions the agent should decline or hand off. Expected topic: none or escalation.
4. **Permission edges.** Requests for records the running user should not see.
5. **Phrasing variants.** Short, long, misspelt and multilingual versions of key requests.
6. **AI-generated cases**, reviewed by a person before they enter the suite.

## Where and how often should you run tests?

Run Testing Center in a sandbox. Salesforce warns that testing agents can modify CRM data. Tests also consume Einstein Requests, which you can track in Digital Wallet, so budget for them.

Re-run the full suite when any of these change: instructions, topics, actions, the model, the knowledge sources or the running user's permissions. A practical [production readiness gate](/blog/production-readiness-gate-for-ai-agents) blocks deployment if pass rates fall below a threshold you set per topic.

## How do you turn test runs into release evidence?

Testing Center stores results, and you can analyse them in Tableau or Data Cloud reports. For an audit trail, record for each release:

- Agent name and version, and who approved it.
- Test suite version and number of cases.
- Pass rate per topic, action and outcome.
- Failed cases and the decision taken on each.
- Human validation notes.

Export that record to wherever your risk team keeps evidence. Pair it with runtime controls such as the [Einstein Trust Layer](/blog/salesforce-einstein-trust-layer-explained).

## What does Testing Center not cover?

- **Multi-turn conversations.** Each case is one utterance. Real users often need several turns.
- **Adversarial testing.** Prompt injection and jailbreak attempts need a red-team suite; see [how to red-team AI agents](/blog/how-to-red-team-ai-agents-multi-turn).
- **Production drift.** Tests run before release. Quality on live traffic needs ongoing scoring.
- **Agents on other platforms.** Results do not compare with agents built on Copilot Studio or Bedrock.

For the full Agentforce picture, read [governing Salesforce Agentforce agents](/blog/govern-salesforce-agentforce-agents) and our [guide to governing agents across platforms](/blog/how-to-govern-ai-agents-across-platforms).

## How Opencontroller does this

Opencontroller connects to Salesforce and registers Agentforce agents alongside agents on other platforms. It runs multi-turn and red-team evals, and LLM judges score production traffic, so evidence covers both release and run time. Live groundedness and task-adherence guardrails, plus per-agent Block and Quarantine controls that act through the connected platform, cover what happens after go-live. See [what an AI agent control plane is](/blog/what-is-an-ai-agent-control-plane), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**What does Agentforce Testing Center check?**
The topic chosen, the actions run and the outcome, compared with what you expected.

**Can Testing Center generate test cases?**
Yes. It can generate cases with AI from the agent's metadata and knowledge. Review them before use.

**Should tests run in production?**
No. Use a sandbox, because testing agents can modify CRM data.

## Key facts

Agentforce Testing Center evaluates whether an Agentforce agent chose the expected topic (subagent), ran the expected actions and gave the expected outcome, using LLM-based comparison for outcomes. Test cases can be uploaded as a CSV (Utterance plus Expected Subagent, Expected Actions as API names, Expected Response) or generated with AI from the agent metadata and knowledge; batch tests run in parallel and can cover thousands of cases. Salesforce recommends running tests in a sandbox because testing agents can modify CRM data; tests consume Einstein Requests tracked in Digital Wallet. Salesforce suggests five steps: identify scenarios and create data, review generated cases, run and evaluate, human validation, review and iterate. Keep each run as release evidence tied to the agent version. Opencontroller by Lyzr adds multi-turn and red-team evals and LLM judges on production traffic across platforms; pricing starts from $250K per deployment per year.

## Related

- [How do you govern Salesforce Agentforce agents?](https://opencontroller.lyzr.com/blog/govern-salesforce-agentforce-agents.md)
- [What does the Salesforce Einstein Trust Layer cover for agents?](https://opencontroller.lyzr.com/blog/salesforce-einstein-trust-layer-explained.md)
- [What should a CISO require before an AI agent goes to production?](https://opencontroller.lyzr.com/blog/production-readiness-gate-for-ai-agents.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
