DET-195 · agent · confidence Medium

Granted but Unused Agent Scopes

Compare the permissions an agent identity holds with the ones it actually uses.

Over-scoped agent credentials are a reach problem you can measure. Cloud access advisors, IAM last-accessed data, and token scope fields in SaaS audit logs show which permissions an identity has used. For agent identities, any high-risk permission unused for 30 days should be removed, and any first use of one should alert.

This also sizes the blast radius before an incident. If an agent is ever injected, the gap between granted and used permissions is what an attacker or a confused agent can reach.

Data sources
IAM Access Advisor or last-accessed dataGitHub audit logEntra service principal sign-in logsAgent platform logs
Platforms
AWSAzureGCPSaaSAI PlatformIdentity

Logic

1. Tag agent identities (`agent=true`).
2. Pull `GenerateServiceLastAccessedDetails` for each agent role; list services granted but not used in 30 days.
3. Alert on the first call by an agent role to any service in that list.
4. For GitHub tokens used by agents, flag scopes such as `admin:org`, `delete_repo` or `workflow`.

False positives

Agents that use some permissions only during rare tasks such as quarterly reports.

Catches 2 techniques