analyze_secrets
Cross-reference secrets with recent audit events to identify unused and unrotated keys, producing a usage profile with rotation and retirement suggestions. Use as a quarterly hygiene check to clean up stale secrets.
Instructions
[agent] Cross-reference the secrets in scope with recent audit events to produce a usage profile and rotation/retirement suggestions. Use as a quarterly hygiene check or as input to a planner that decides what to rotate or delete; prefer health_check for decay-only triage and audit_log to inspect access timelines for one key. Read-only; uses the most recent ~500 audit events. Returns JSON { total, expired, stale, neverAccessed: [...], noRotationFormat: [...], mostAccessed: [{ key, reads }] }. neverAccessed and noRotationFormat are good candidates for cleanup or for adding rotation hints.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | Where the secret lives. 'global' = user keyring (default if omitted on reads), 'project' = scoped to projectPath, 'team' = team-shared (needs teamId), 'org' = org-shared (needs orgId). | |
| projectPath | No | Absolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted. | |
| teamId | No | Team identifier for team-scoped secrets. Required only when scope='team'. Example: 'acme-platform'. | |
| orgId | No | Organization identifier for org-scoped secrets. Required only when scope='org'. Example: 'acme-corp'. |