Agentforce deterministic guardrails
These checks cover the Apex code and actions an Agentforce agent can reach, and flag where no guardrail in code stands between the agent and the data.
A guardrail must live in code or configuration, not in the prompt: the model's behaviour is not an authorization control.
Checks
| Rule ID | What it finds | Fix |
|---|---|---|
| SF-AGENT-GUARD-001 | Agent-reachable Apex class whose profile or permission set grants Modify All, View All or Author Apex. | Remove the elevated permission; grant only the object and field access the action needs. |
| SF-AGENT-GUARD-002 | Agent action that queries or changes records with no filter bounding it to the caller's records. | Bound the action by owner, a verified customer ID or an allowlisted filter. |
| SF-AGENT-GUARD-003 | Agent-reachable code path with no with sharing and no explicit authorization check. | Declare with sharing and check the caller's entitlement before acting. |
| SF-AGENT-FLS-001 | Agent-invoked DML (insert, update, delete, upsert) with no CRUD check and no user-mode DML. | Check isCreateable / isUpdateable / isDeletable, or run the DML in user mode. |
| SF-AGENT-FLS-002 | Agent-invoked SOQL with no field-level security (no user-mode read, no Security.stripInaccessible, no per-field check). | Query in user mode or strip inaccessible fields before values reach the agent. |
Run it
vulkro-sf scan ./force-app
See also: Agentforce security checks