Skip to content

commandSecurity

Review Permissions

Reviews roles, scopes and access lists in a config or manifest and proposes a trimmed version that keeps only what is used.

npx workspacetemplates add review-permissions --tool claude-code

Writes 1 file to .claude/commands/

.claude/commands/review-permissions.md15 lines · 1.1 KBFile
---
description: Reviews roles, scopes and access lists in a config or manifest and proposes a trimmed version that keeps only what is used.
argument-hint: "[policy, manifest or config path]"
---

Review the permissions in: $ARGUMENTS

1. Read the file and list every grant: IAM actions and resources, Kubernetes verbs and resources, OAuth scopes, GitHub Actions `permissions:`, Android or extension manifest permissions, database roles.
2. Flag wildcards (`*`), admin-level grants, broad resources, long-lived tokens, and anything that allows writing where reading would do.
3. Search the code and scripts for what each grant is used for. Mark each as used, unused or unclear.
4. Propose a minimal replacement: narrower actions, specific resources, read-only where possible, short-lived credentials. Keep the original format.
5. For every removal, state what could break and how to test it.
6. Do not apply anything, and never run commands that change live cloud or cluster state.

Report a table: grant, used, risk, proposed change. Show the trimmed file as a diff. Then ask whether to write it to disk.

What it does

Permissions grow by accident: a wildcard added to get past an error, a scope nobody remembers asking for. This command reads the file you point at and compares what is granted with what the code actually needs.

You get a before-and-after proposal with the risk of each removal, so you can cut access without breaking the app.

Example

you › /review-permissions infra/iam/ci-role.json

agent › 14 grants reviewed. s3:* on * (unused beyond s3:PutObject on the artifacts bucket) -> narrowed. iam:PassRole removed, no code path uses it.
Two grants unclear: ec2:Describe*. Test by running the deploy job in staging.
Write the trimmed policy to disk?

Questions

What formats does it handle?
Any readable text config: JSON and YAML policies, manifests, Terraform files and workflow files.
Will it apply changes to the cloud?
Never. It edits a local file at most, and only on your yes.
  • Audit Dependencies

    CommandSecurity

    Free
  • Check Auth

    CommandSecurity

    Free
  • Find Secrets

    CommandSecurity

    Free
  • Harden Input

    CommandSecurity

    Free