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.
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.