Home
IT Hub
Salesforce

Agentforce Security in Salesforce: Features, Use Cases & Best Practices

Reco Security Experts
Updated
August 18, 2025
August 18, 2025

Salesforce recently introduced a new AI agent framework - internally referred to as Agentforce - designed to help enterprises automate multi-step processes across sales, service, and internal operations. According to a recent Capgemini report, agentic AI is expected to generate up to $450 billion in economic value over the next three years through revenue gains and cost savings. With 93% of business leaders believing that scaling AI agents will provide a major competitive advantage, securing these systems from the outset becomes critical. Yet only 2% of organizations have fully scaled such systems, and trust in fully autonomous AI fell from 43% to 27% last year, underscoring why robust security measures are vital from day one.

While Agentforce delivers powerful automation and reasoning, it also introduces expanded threat surfaces around data access and execution logic. These new capabilities also create novel threat vectors. Common risks include prompt injection, where an attacker manipulates agent behavior through crafted inputs; data exfiltration via overbroad data access; and misuse of tools through poorly validated API or flow invocations. A clear understanding of these threats is essential before deployment.

Agentforce works deeply with sensitive customer, sales, and operational data, making security a key pillar of every implementation. This article explores the built-in security features, common use cases, and best practices for deploying Agentforce securely.

Built-in Security Features in Agentforce

Layered Agentforce Security Architecture with five stacked security layers from planning to compliance.

The graphic shows five key parts of Agentforce security: planning prompts, trust checks, secure execution, activity monitoring, and meeting compliance rules. These layers work together to keep data safe and follow regulations.

Salesforce has built Agentforce with enterprise-grade security controls. It follows the shared security model already established across Salesforce products, but adds new layers specific to AI agents.

Layered Agentforce architecture showing AI agents interfacing with Data Cloud, Einstein Trust Layer, and Flow/Apex execution

The diagram explains how AI agents in Agentforce work with the Data Cloud, use the Einstein Trust Layer for safety checks, and run tasks through Flow or Apex to keep processes secure and compliant.

Attribute-Based Access Control (ABAC)

Agentforce supports attribute-based policies in addition to the usual Salesforce RBAC model. This allows for fine-grained access rules like:

  • "Only sales agents in the EU can trigger pricing workflows."
  • "Agents can’t access healthcare data unless the compliance flag is true."
A chart with “User Attributes” on rows and “Agent Permissions” on columns, showing checkmarks where access is granted.

The chart matches different user details with what actions they can do, using checkmarks to show where access is allowed. It helps explain how permissions are decided.

Guardrails and Grounding

Each Agentforce bot uses instructions, topic boundaries, and structured grounding to avoid hallucinations and unauthorized behavior. Admins can:

  • Restrict the topics an agent can respond to
  • Limit actions to only pre-defined flows or APIs
  • Configure rejection messages when prompts cross boundaries

Tool Execution Controls

A horizontal flowchart in Agentforce showing the secure lifecycle of an agent request.

A flowchart shows the secure lifecycle of an agent request in Agentforce, starting from instructions and boundary checks to executing approved actions and safely delivering responses.


Agentforce deployments can be further hardened using Salesforce-native tools like Shield Event Monitoring for real-time observability, Field Audit Trail for long-term change tracking, and Platform Encryption to safeguard sensitive data at rest and in transit. These enterprise-grade features complement Agentforce’s built-in controls and help meet rigorous internal security and compliance standards.

Agent-triggered flows, Apex classes, or third-party APIs are executed securely with token-based authentication, validation, and logging mechanisms. Security for this includes:

  • Token-based authentication
  • Input validation before execution
  • Execution logs and visibility into result paths
Agentforce secure agent lifecycle overview.

This flowchart outlines the Agentforce agent lifecycle stages, including planning, tool invocation, validation, logging, grounding, and escalation, ensuring secure and compliant execution.

Data Cloud Integration

Agentforce connects to real-time data via Salesforce Data Cloud. This connection is secured by:

  • Row-level and field-level security enforcement
  • Dynamic consent and preference management
  • Data residency and region-aware compliance support

Einstein Trust Layer

Designed to detect potentially harmful prompts or anomalous agent behavior, the Einstein Trust Layer offers early-stage protection against prompt injection. It helps enforce privacy and control when using AI across Salesforce. For Agentforce, it ensures:

  • Zero data retention for LLM prompts/responses
  • Data masking for PII before sending prompts
  • Toxicity and prompt injection detection
  • Audit trails for each agent action
Agentforce AI prompt flow: prompt → similarity search → Trust Layer → LLM → response → action.

The process integrates prompt input, similarity search, trust enforcement, language model response, and subsequent action within Agentforce for safe and efficient AI operations.

Use Cases Where Security Matters

Agentforce agents are capable of reasoning, planning, and executing workflows. These capabilities span various departments and require security tailoring to the use case.

Customer Support Agents

Agents that automate case handling must:

  • Avoid data leakage across customers
  • Escalate only to authorized support queues
  • Obey SLAs and compliance constraints

Sales Development Reps (SDRs)

AI SDR agents can book meetings, draft emails, and update records. Key controls include:

  • Preventing accidental outreach to restricted leads
  • Logging all communications for audit
  • Avoiding over-disclosure of pricing or strategy

Internal Employee Agents

Agents that answer HR or IT questions in Slack or Salesforce must:

  • Respect department-level access
  • Limit visibility of sensitive HR documents
  • Authenticate users before sensitive actions

Industry-Specific Agents

For industries under regulatory oversight, such as finance and healthcare, Agentforce can be configured to support compliance frameworks like HIPAA, GDPR, and SOX. For example, ABAC policies help enforce GDPR’s data minimization principle by limiting access to only what's strictly necessary per role or context.

In regulated industries like healthcare and finance:

  • Agents must recognize compliance flags
  • Access must be logged and reportable
  • Any PHI/PII must be redacted before prompt submission

Best Practices for Agentforce Security

Security for Agentforce should follow a layered approach. Here are key practices that go beyond default configurations.

Best Practice Description Benefit
Define Clear Boundaries per Agent Assign each agent a specific set of topics and actions. Avoid general-purpose agents unless absolutely necessary. Prevents unintended access or overreach; keeps agent scope clear and controlled.
Use Prompt Templates with Guardrails Create structured prompt templates with system instructions like "Do not respond to pricing questions." Regularly review and update them. Reduces LLM unpredictability and enforces business constraints.
Enforce Authentication for All Actions Validate the user's identity and permissions before executing any flow, API call, or database change. Don't rely solely on the agent's identity. Ensures actions are traceable to real users; avoids unauthorized changes.
Monitor Agent Logs and Tool Invocations Log every agent action, including reasoning steps, API calls, and tool usage. Use Salesforce Event Monitoring with a SIEM for real-time observability. Enables auditing, alerting, and forensic investigation.
Leverage Salesforce Shield Use Salesforce Shield in conjunction with Agentforce to track platform events, monitor data access patterns, and detect anomalies across agents. Adds another layer of visibility and compliance-grade audit trails, especially for sensitive workflows.
Use Separate Agents for Separate Roles Build individual agents for specific roles (e.g., support, sales) with different identities and access levels. Simplifies access control and auditing; reduces complexity.
Align with Data Classification Policies Make sure agents follow organizational data classification policies (e.g., confidential, internal). Block high-sensitivity data from prompts or tool outputs. Prevents data leakage and ensures compliance with internal governance.

In addition to implementing controls, teams should monitor performance using security-specific KPIs. These may include metrics like unauthorized action attempts, prompt rejection rate, agent fallback frequency, and flow validation failures. Tracking these indicators over time provides insight into agent risk posture and helps validate ongoing effectiveness.

Agent Behavior Monitoring and Tuning

Proactive oversight helps teams identify missteps, misfires, or edge-case failures before they escalate. Salesforce teams should regularly monitor how Agentforce agents behave in real-world conditions and adjust configurations accordingly. This includes:

  • Using the Plan Tracer to simulate how agents interpret prompts, select tools, and generate responses.
  • Reviewing execution logs to understand agent reasoning steps, failed flows, or risky tool invocations.
  • Testing with edge-case prompts (e.g., ambiguous, malformed, or policy-violating inputs) to verify guardrail performance.
  • Tuning system instructions to reduce hallucinations and re-align agent tone, permissions, or escalation logic.

This feedback loop enables continuous refinement of agent behavior and increases organizational confidence in automation outcomes.

Insight by
Dr. Tal Shapira
Cofounder & CTO at Reco

Tal is the Cofounder & CTO of Reco. Tal has a Ph.D. from Tel Aviv University with a focus on deep learning, computer networks, and cybersecurity and he is the former head of the cybersecurity R&D group within the Israeli Prime Minister's Office. Tal is a member of the AI Controls Security Working Group with CSA.

Expert Insight:


This section highlights practical, field-tested tips used by advanced teams to reinforce protection without reducing agent utility.

  • Use Declarative Guardrails: Rely on topic boundaries and agent instructions rather than trying to suppress behavior post-response.
  • Audit Flows Triggered by Agents: Implement a naming or tagging convention to identify flows triggered by agents and review them regularly for exposure risks.
  • Prompt Review Process: Introduce peer review or automated checks for prompt templates, especially if they include sensitive topics.
  • Isolate High-Risk Agents: Run agents that interact with financial, legal, or HR data in sandboxed orgs or restricted environments.
  • Use a Multi-Org Strategy: For especially sensitive use cases, deploy agents in separate Salesforce orgs to isolate data, limit blast radius, and comply with least privilege principles. This strategy aligns with Salesforce guidance on secure agent development using sandbox environments.
  • Test Agent Behavior with Simulated Prompts: Regularly test how agents handle edge cases, misdirection, or policy violations using simulated prompts and the Plan Tracer.
  • Limit External Calls: Only allow agents to access external APIs via a proxy that can filter, log, and throttle requests as needed.
  • Auto-Rotate Keys and Tokens: If your agent tools use bearer tokens, enforce short TTLs and rotate keys periodically.
  • Human Escalation Paths: Always provide an agent fallback to human interaction, especially when confidence scores are low or data is ambiguous.

Agentforce Security Readiness Checklist

Use this quick checklist to validate readiness before deploying Agentforce agents into production:

Item Description
Access Control Have you defined role-based or attribute-based access for each agent?
Prompt Review Have all prompts and instructions been peer-reviewed and approved?
Logging Enabled Are all agent actions and tool calls being logged and reviewed?
In-Field Testing Have you run simulated prompts to validate agent responses?
Escalation Paths Are fallback and human escalation paths clearly defined?
Abuse Detection Do you have monitoring for anomalous or excessive activity?
Data Classification Are data types flagged for masking or redaction in prompts?

This pre-launch checklist ensures security, governance, and operational alignment.

Conclusion

Agentforce brings in powerful automation and reasoning into enterprise workflows, yet these capabilities pose a new set of security risks. When these trust features are invoked appropriately layer-wise, organizations can confidently push AI agents. In essence, treat each agent as a new identity in your system, granting appropriate access, continuous monitoring, and strict boundaries.

Another important recommendation for enterprises would be to engage cross-functional stakeholders such as security, compliance, owners of the business, and technical teams early on in Agentforce planning and deployment. This ensures that agents will meet internal controls and specific industry requirements starting from day one. Parallel to that, it is very important to apply out-in-field testing to agent behavior to ensure there is no data leakage or policy violation before setting them into production.

FAQs

Can Agentforce agents take autonomous actions without human approval?

Agentforce supports both autonomous and human-in-the-loop actions. You can configure flows to require approvals or escalation paths based on risk, context, or sensitivity.

How does Agentforce differ from regular Salesforce Flows or Bots?

Unlike standard automation tools, Agentforce introduces reasoning, dynamic planning, and natural language prompt handling, adding complexity and requiring new security layers.

Does Agentforce retain any customer data during prompt execution?

No. With the Einstein Trust Layer, prompts and responses are processed with zero retention, and sensitive fields can be masked before reaching the LLM.

What’s the difference between ABAC and RBAC in Agentforce?

RBAC assigns access based on roles; ABAC adds contextual checks like geography, department, or compliance status, enabling more granular policies for agents.

Is Agentforce suitable for highly regulated industries?

Yes, with appropriate guardrails. Features like data masking, audit logging, ABAC, and flow isolation support use in industries with GDPR, HIPAA, or SOX requirements.

EXPERIENCE RECO 1:1 - BOOK A DEMO

Discover How Reco Can Help You Protect Your Salesforce Environment

“I’ve looked at other tools in this space and Reco is the best choice based on use cases I had and their dedication to success of our program. I always recommend Reco to my friends and associates, and would recommend it to anyone looking to get their arms around shadow IT and implement effective SaaS security.”
Mike D'Arezzo
Executive Director of Security
“We decided to invest in SaaS Security over other more traditional types of security because of the growth of SaaS that empowers our business to be able to operate the way that it does. It’s just something that can’t be ignored anymore or put off.”
Aaron Ansari
CISO
“With Reco, our posture score has gone from 55% to 67% in 30 days and more improvements to come in 7-10 days. We are having a separate internal session with our ServiceNow admin to address these posture checks.”
Jen Langford
Information Security & Compliance Analyst
“That's a huge differentiator compared to the rest of the players in the space. And because most of the time when you ask for integrations for a solution, they'll say we'll add it to our roadmap, maybe next year. Whereas Reco is very adaptable. They add new integrations quickly, including integrations we've requested.”
Kyle Kurdziolek
Head of Security

Explore More

Ready for SaaS Security
that can keep up?

Request a demo