Skip to main content

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โ€‹

FieldValue
Rule IDAGENTFORCE-26.4
SeverityHigh
CategoryBroken Access Control
ComplianceSOC2_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.

See Alsoโ€‹