Section 5 · Testing, Deployment, and Maintenance · 10% of exam
5.3 Deploying Agents from Sandbox to Production
Exam objective
Identify the considerations for moving an Agentforce agent from a sandbox to production and preparing the target org for activation.
Promote a tested version
A sandbox is a safer place to configure and test an agent before it reaches production. Once the intended version is ready, move its metadata through an approved Salesforce deployment process, such as Salesforce CLI and a version-controlled project or another supported release tool. Deployment moves configuration; it does not prove the target org is ready or make every environment-specific dependency work. Keep track of the agent version, deployment method, and API version. Salesforce’s metadata support changes by release. For API version 68.0, the newer AiAgentDefinition metadata types can include associated Flow, Apex, and prompt-template dependencies automatically when both orgs support that API version. Earlier versions use different metadata patterns. Prepare the target org
Before deployment, verify that the target org has the required Agentforce products, licenses, features, and permissions. Create or identify the correct Agent User when the agent type uses one, and grant only the permissions needed by its actions. Confirm that dependent flows, Apex classes, prompt templates, custom objects, fields, permission sets, data sources, and channel components are available in the target. Some values, credentials, external connections, URLs, or channel settings are org-specific and must be configured for production rather than copied blindly from a sandbox. Review current Salesforce deployment documentation for version-specific dependencies and constraints.
Deploy and activate deliberately
An agent can arrive in the target org in an inactive state. Treat deployment and activation as separate steps: deploy the required metadata, review the resulting agent and dependencies, configure target-specific settings, then activate the approved version when ready. If a Flow references an Agent action, deployment sequencing can matter; Salesforce documents cases where the agent must be present and active before the dependent Flow is deployed. Avoid assuming that all related components can always be deployed together. Validate connection setup, agent user, flow versions, data library readiness, and permissions before activation.
Validate production behavior
Test the deployed agent in the target org with representative users and scenarios before broad rollout. Confirm that its actions execute under the expected identity, data access is appropriately limited, sources are available, and channel routing and escalation work. Run a focused regression suite against the deployed version, including failure and access-boundary cases. Verify that an agent response is not merely plausible but reflects actual production data and completed actions. Document activation, rollback, and support ownership. If behavior differs from sandbox, compare licenses, permissions, model settings, connected systems, data readiness, API versions, and configuration rather than assuming the agent metadata alone explains the difference.
TIP: Treat deployment as a dependency and readiness check: agent metadata, action dependencies, permissions, data, connections, and activation all need review in the target org.
Deployment mechanics depend on metadata API version and Salesforce release. For API v68 metadata, both source and target orgs must support v68; earlier targets require the compatible earlier metadata path. Extra concept: A successful deployment means the metadata was moved; activation, target-specific setup, and production validation are still separate lifecycle steps.
Official references:
- Move an Agent to a New Org https://developer.salesforce.com/docs/ai/agentforce/guide/agent-dx-deploy-metadata.html
- Retrieve and Deploy Agent Metadata https://developer.salesforce.com/docs/ai/agentforce/guide/agent-dx-retrieve-deploy.html
- Deployment Strategy for Flows Containing Agent Actions https://help.salesforce.com/s/articleView?id=005384467&language=en_US&type=1
Key takeaways
- Use a supported metadata process and account for API-version differences.
- Prepare target-org licenses, users, permissions, dependencies, data, and channel settings.
- Deploy first, configure and verify the target, then activate and test the production version.
