The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Recommended

Securing Salesforce to LLM integrations with Apex and scoped permissions (opens in a new tab)

Readers will learn how to enforce least-privilege access when calling external language models from Apex, including proper use of WITH USER_MODE, Named Credentials, and response validation.

The article argues that connecting Salesforce to a large language model takes more than an API key. The integration should control which records and fields the model can reach, protect credentials, minimize the data sent, and stop AI output from triggering unauthorized actions. It proposes an architecture with five parts: Salesforce enforcing permissions, Apex or middleware handling authorization and request building, Named Credentials managing the endpoint and authentication, the LLM API generating output, and a validation layer checking results before they are shown or used. A support assistant summarizing Cases, for example, needs only subject, description and status, not full contact or financial history. Authorization should happen before data is sent to the model and again before any business action follows its response.

The piece distinguishes several permission mechanisms that must be combined rather than relying on OAuth scopes alone: integration identity, object permissions, field-level security, record sharing and application-level restrictions. In Apex, declaring a class with sharing does not enforce object and field permissions, so the article recommends WITH USER_MODE on supported SOQL queries, with Security.stripInaccessible() as an alternative for removing inaccessible fields. For credentials, it recommends never hardcoding API keys and instead using External and Named Credentials, granting access through Permission Sets, and keeping separate configurations for each environment. A sample Apex class summarizes a Case through the OpenAI Responses API, querying only needed fields, sending a minimal payload, and checking the HTTP status and response structure before returning text.

The article also covers defending against prompt injection, since record text from emails or tickets may contain malicious instructions. Its safeguards include treating retrieved text as untrusted, limiting fields and records, avoiding unrestricted query or tool access for the model, checking proposed operations against a server-side allowlist, requiring human approval for consequential changes, and filtering documents by user access before they reach the model in retrieval-based designs. For scale, it suggests asynchronous processing with Queueable Apex or middleware for longer tasks, bounded retries with backoff only for suitable errors, request identifiers to prevent duplicate actions, token and latency monitoring, and cache designs that respect permission changes. The conclusion urges starting with a read-only use case and adding write capabilities only after authorization and failure handling are tested.

Read the original at dev.to (opens in a new tab)

Worth reading?

Recommended

Securing Agentforce against prompt injection and data exfiltration (opens in a new tab)

You will learn how untrusted input can steer Agentforce into exfiltrating data via DNS lookups, and which Einstein Trust Layer controls actually mitigate these risks.

Why read this

You will also get a practical checklist for configuring runtime identities, permissions, and safe workflows.

Research by Zenity demonstrates a prompt injection chain where untrusted text stored in a Web-to-Lead record steers Agentforce to query authorized account data. The injected instructions embed the results in an external hostname, exploiting a Trusted URLs parsing discrepancy that triggers a DNS lookup to exfiltrate information without requiring user interaction.

The Einstein Trust Layer provides several guardrails, including semantic filters, zero data retention agreements, and audit logging, but it does not enforce authorization policies or stop agents from querying records they are already permitted to see. Data masking is currently disabled for agents, and prompt defenses remain probabilistic rather than absolute.

Securing Agentforce requires strict identity and permission hygiene. Administrators must verify whether agents run under employee profiles, dedicated service users, or integration accounts, then restrict object and field access accordingly. Replacing broad query tools with custom Apex actions that enforce user mode and explicit Sharing Rules reduces exposure.

A recommended architecture isolates unauthenticated submissions behind a read-only lead triage agent, followed by human review before downstream agents handle outbound communication. This layered approach prevents poisoned data from reaching internal databases or messaging channels like Slack.

Read the original at dev.to (opens in a new tab)

Worth reading?

Architecting secure multi-agent systems with deterministic guardrails and memory isolation (opens in a new tab)

You will learn how to enforce security and accountability in Agentforce deployments using deterministic guardrails, strict memory isolation, and defined human escalation points.

Why read this

The piece outlines practical architectural patterns to prevent cascading failures and prompt injection across multi-agent workflows.

The article explains that moving to interoperable multi-agent systems requires shifting from perimeter-based security to a Zero Trust model where every interaction is continuously verified. Because large language models can correctly identify risks yet still execute harmful actions, the author recommends combining probabilistic reasoning with hard-coded, deterministic guardrails that operate outside the agent’s internal loop.

To prevent context collapse and sensitive data leakage, the piece warns against shared memory pools that create unstructured data puddles. Salesforce addresses this by assigning an owner tag to every piece of memory, ensuring strict isolation between users and assistants. Access is further controlled through session-based security checks and filters that block sensitive information from reaching external tools.

Finally, the author addresses the tension between full autonomy and necessary oversight. While constant human intervention defeats the purpose of agentic automation, clear escalation thresholds must be established. Agents should pause for human review during significant financial transactions, low-confidence decisions, detected prompt injection attempts, or repeated failure loops to maintain accountability without sacrificing scalability.

Read the original at Salesforce News (opens in a new tab)

Worth reading?