Scan agent permissions with theauth.analyzer to surface over-privileged identities, unused scopes, wildcard risks, and stale agents across your deployment.
The privilege analyzer scans agent permissions to find over-privileged agents, unused permissions, and potential security issues.
analyzeAgent(agentId, { since }) compares the agent’s permissions against audit log entries since since (default: the last 30 days). If the agent does not exist, it returns an "appropriate" result with agentName: "unknown" and no findings.
analyzeAll covers agents whose status is active. There is no scanAll method.
Finding types
Type
Severity
Description
wildcard_permission
critical
The resource is * or ends in :* or /*, or the actions include *
unused_permission
warning
The resource does not appear in the audit log within the lookback window
overly_broad
warning
A namespace permission where only one or two specific sub-resources were used
no_constraints
info
No maxCallsPerHour, timeWindow, requireApproval, or ipAllowlist on the permission
no_expiry
info
The agent has no expiration date set
Score
Score
When
wildcard-heavy
Any critical finding, or two or more wildcard findings
over-permissioned
One wildcard finding, or two or more warnings
minimal
No findings
appropriate
Only info-level findings, or a single warning
Configuration
The analyzer has no configuration options. The lookback window is 30 days by default and can be overridden per call with since.
The analyzer reads from the audit trail. Keep agents.auditAll enabled (the default) so that permission usage is recorded; otherwise every permission looks unused.