Slack Bot Permission Scopes Least-Privilege Audit Prompt
Audit a Slack app's requested OAuth scopes against what its code actually calls, strip over-broad permissions, and produce a least-privilege manifest your security team will approve.
- Target user
- Engineers building Slack ChatOps and bots who need workspace-admin sign-off
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who reviews Slack app installs for security teams and has had bots rejected for asking for admin.* scopes they never use. I will provide: - The app's current requested bot and user scopes (from the manifest or OAuth config) - A list (or snippet) of the Slack Web API methods the code actually calls - Whether the app is for one workspace, distributed, or Enterprise Grid Your job: 1. **Map scopes to methods** — for each requested scope, list which of MY actual API calls require it; flag any scope with zero corresponding calls. 2. **Find the minimum set** — for each method I call, name the narrowest scope that satisfies it (prefer `chat:write` over broad write scopes, granular `channels:read` over `groups:`/`im:`/`mpim:` unless needed). 3. **Flag dangerous scopes** — call out `admin.*`, `users:read.email`, `files:read`, and any token-theft-amplifying scope; require explicit justification or removal. 4. **Bot vs user token** — decide which actions truly need a user token vs the bot token, and minimize user-token scope since it impersonates a person. 5. **Write the trimmed manifest** — produce the corrected `oauth_config.scopes` block plus a one-line rationale per remaining scope. 6. **Reinstall & migration note** — explain that scope changes force re-authorization, and how to roll it out without breaking live installs. Output as: (a) a scope-to-method table with KEEP/REMOVE/NARROW verdicts, (b) the trimmed manifest scopes block, (c) a justification line per kept scope, (d) a reinstall/rollout checklist. Default to removing any scope you cannot tie to a concrete, in-code API call; absent scopes are easy to add later, over-broad ones are a standing liability.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Slack App Manifest & Permission Scope Review Prompt
Review a Slack app manifest YAML for over-scoped permissions, missing rate limiting, weak event subscriptions, and least-privilege violations.
-
Slack OAuth Token Security & Rotation Prompt
Audit, secure, and rotate Slack OAuth tokens (bot, user, granular) across services — inventory, threat model, rotation cadence, secret manager integration, and dual-active migration.
-
Slack App Rate-Limit Tier & Capacity Planning Prompt
Model a Slack app's request budget across method tiers, size fan-out and polling under per-workspace limits, and design a token-bucket schedule that never trips 429s.
-
Slack Block Kit Modal Input Validation & Error Display Prompt
Design server-side validation for Block Kit modals — response_action errors, per-input error keying, cross-field rules, and re-render UX that never loses user input.
More Slack prompts & error guides
Browse every Slack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.