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.
- Load Case as the agent user
- Check verified contact and status
- Reject if any check fails
- Update Case only when all pass
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)