Teams ChatOps Authorization & RBAC Layer Prompt
Design an authorization layer that decides who can run which ChatOps commands from Teams, mapping Entra groups and roles to command scopes with audit logging.
- Target user
- Platform engineers securing a Teams ChatOps bot's command surface
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform-security engineer who treats a ChatOps bot as a privileged automation gateway, not a toy, and gates every command accordingly. I will provide: - The commands my Teams bot exposes and their blast radius (read-only, deploy, restart prod, rotate secret) - My identity source (Entra ID groups, on-call schedule, PIM roles) and how the bot resolves the caller - Compliance requirements (approvals, audit retention) Your job: 1. **Resolve the caller** — use the verified Teams `from.aadObjectId` (never the display name) and confirm tenant; reject if identity cannot be established. 2. **Define a policy model** — map commands to required scopes, then bind scopes to Entra groups or roles; support per-channel and per-environment overrides so a command allowed in staging is blocked in prod. 3. **Enforce least privilege** — default-deny unknown commands; require step-up (a second approver via an Adaptive Card `Action.Execute`) for destructive actions. 4. **Check freshness** — honor on-call status or PIM-activated roles so standing access isn't assumed; expire elevated grants. 5. **Audit everything** — emit a structured, immutable log line per attempt (who, command, args, channel, allow/deny, correlation ID) to your SIEM. 6. **Fail safe** — on policy-service outage, deny privileged commands rather than fall open. Output as: (a) the policy schema, (b) the authorization-check pseudocode wired into the message handler, (c) the audit event format. Never trust client-supplied identity fields, redact secret arguments in logs, and make destructive commands require explicit confirmation.
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
-
Teams Alert Silence and Mute ChatOps Prompt
Build a ChatOps capability in Microsoft Teams that lets on-call engineers silence, mute, or snooze monitoring alerts from chat — with scoping, expiry, audit, and auto-unsilence.
-
Adaptive Card Optimistic UI for Long-Running Actions Prompt
Design an Adaptive Card pattern that shows immediate optimistic feedback (disabled buttons, in-progress state, fallback timeout copy) while a slow backend action runs, so responders never double-click a deploy or approval.
-
Bot Card Update vs New Message Strategy for Channel Noise Prompt
Decide, per ChatOps interaction, whether a Teams bot should update an existing activity in place or post a new message — keeping incident channels readable instead of drowning responders in a wall of bot cards.
-
Teams AI Library Action Planner for Ops Bot Prompt
Design a Teams AI Library bot that uses the Action Planner, prompt templates, and a registered action set to turn natural-language ops requests into safe, confirmed tool calls.
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams 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.