AGENTFORCE-26.4: Agent-Called Apex Without Sharing or Permission Checks
๐ด High ยท Broken Access Control
Follows agent actions into the Apex they call (helpers included) and reports code that runs without sharing (declared, or inherited from an entry class with no keyword) while it writes without CRUD/FLS checks or reads / changes records by an id from the action input with no ownership check, and code that falls back to system context (a catch block or failed permission check that retries in SYSTEM_MODE or a without-sharing class).
Detailsโ
| Field | Value |
|---|---|
| Rule ID | AGENTFORCE-26.4 |
| Severity | High |
| Category | Broken Access Control |
| Compliance | SOC2_CC6, HIPAA |
Remediationโ
Declare the class 'with sharing' (or 'inherited sharing' for helpers), run queries and DML in USER_MODE (or Security.stripInaccessible), check that records named by the action input belong to the user (OwnerId / UserRecordAccess) and, when a user-mode operation fails, return the error instead of retrying in system context.