The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Must-read

Overriding Agentforce safety classifications with named Agent Script subagents (opens in a new tab)

You will learn how Agentforce screens messages before the LLM runs, how repeated violations escalate, and how to override a built-in safety classification by naming a subagent exactly as the classification.

Why read this

The article also gives a full sample script and test utterances.

  1. User sends a message
  2. Safety classification matched?
  3. Turn halted, refusal returned
  4. Third violation escalates to rep
  5. Clearly safe: business subagent runs
How Agentforce handles a user message against safety classifications

Agentforce checks every user message against built-in safety classifications before the agent’s reasoning runs. If a message matches, the agent halts the turn and returns a refusal without calling the downstream LLM, so unsafe input never reaches your logic. A counter tracks violations within a session, and on the third the turn escalates to a human rep, but only if an escalation path is configured.

To change a classification’s behavior, you add a subagent whose name exactly matches the classification, such as Prompt_Injection, and give it a description that governs when it applies. The name ties the override to the classification, while the description tells the agent both when to use the subagent and when not to. The article’s sample Employee Agent overrides three classifications this way and routes safe requests to an Event_Management subagent, with the router instructed to check safety subagents first.

Each safety subagent in the sample pairs a “use for” description with a “Do NOT use for” list of ordinary business phrases to reduce false positives, and carries reasoning instructions that set a polite, non-echoing refusal tone. The Event_Management action is gated with an available-when condition on currentRecordId, with a fallback asking the user to navigate to a record. The article closes with test utterances for each override and best practices such as configuring an escalation path and routing distress cases to HR or a manager.

Read the original at InfallibleTechie (opens in a new tab)

Worth reading?

Recommended

Testing least-privilege write access for a Salesforce AI agent in five layers (opens in a new tab)

You will learn a five-layer test plan for checking what a Salesforce AI agent can write, including negative tests and a prompt-injection scenario.

Why read this

You will also see why authorization must be enforced in the action rather than in the model prompt.

  1. Load Case as the agent user
  2. Check verified contact and status
  3. Reject if any check fails
  4. Update Case only when all pass
Each write must pass server-side checks before Salesforce data changes

The article opens with the SalesBleed research, in which a poisoned lead manipulated Agentforce. It argues that giving an AI agent write access creates a new security boundary between natural-language instructions and business data, and that a valid Permission Set does not authorize every change. It proposes testing five layers: identity, actions, fields, records and execution.

It then sets out a reference least-privilege matrix for a support agent that may move Cases from New to Working. The agent should run as a dedicated user with object and field limits, change only the Status field, act only on records linked to a verified customer, and be denied uncontrolled system-mode writes. The author labels this an illustrative test asset rather than measured results.

Six pre-production tests follow: verifying the runtime identity, auditing every write path including Apex, Flows and OAuth scopes, confirming field and record restrictions, validating business rules, and comparing record state before and after each test. The article suggests release criteria such as zero unauthorized CRM writes across negative tests and traceable authorization for every successful write.

The adversarial section simulates a lead carrying fake administrator instructions. The article argues that prompt injection must be blocked at the action boundary by checking identity, target record, fields and transitions server-side. A short pseudocode example shows a policy check using a verified contact ID. The piece closes with notes on Summer ’26 user-mode defaults for Apex database operations and a final checklist.

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

Worth reading?

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?