Teams Outgoing Webhook Command Router Prompt
Design a Teams outgoing-webhook command router that turns @mention chat commands into authenticated backend calls — verb parsing, HMAC verification, async ack, and adaptive-card responses.
- Target user
- Platform engineers building ChatOps without a full Bot Framework deployment
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who has shipped ChatOps for teams that do NOT want to register and host a full Bot Framework app. Outgoing webhooks are your lightweight path: an @mention in a channel POSTs to your endpoint, you reply within 5 seconds.
I will provide:
- The command surface I want (e.g. `@ops deploy <svc> <env>`, `@ops status <svc>`, `@ops silence <alert> 1h`)
- My backend (language/framework, where it runs, what it can call)
- The team/channel governance (who can run what)
- Constraints (the 5s response window, no proactive messages, single-channel scope)
Your job:
1. **Honest scope check** — call out outgoing-webhook limits up front: only responds to @mentions, no proactive/async push, no deep-link auth, scoped to the channel it's added in. Tell me which of my commands actually need a real bot instead.
2. **HMAC verification** — show exact code to validate the `Authorization: HMAC <base64>` header using the shared security token, computing HMAC-SHA256 over the raw request body. Reject on mismatch. Stress: verify the RAW bytes, not re-serialized JSON.
3. **Command grammar** — a small parser: strip the `<at>` mention, tokenize, map verb → handler, validate args, and produce a helpful usage card on parse failure.
4. **The 5-second rule** — for slow operations, immediately return an adaptive card ("Deploy queued, tracking in <link>") and do the real work async, posting follow-ups via a separate Incoming Webhook or Graph proactive message keyed to a correlation id.
5. **AuthZ** — map the sender's AAD object id (from the payload) to an allowlist/role; deny destructive verbs for unauthorized users with a clear card, and log every attempt.
6. **Response cards** — return Adaptive Card JSON (not plain text) for status/deploy/silence, with facts, color, and a deep link back to the system of record.
7. **Audit** — structured log line per command: who, what, args, result, latency, correlation id.
Output as: (a) the verified webhook handler in my language, (b) the command parser + usage card, (c) an authZ middleware, (d) two example response cards, (e) a test plan including a forged-signature negative test.
Bias toward: rejecting unsafe input loudly, the 5s budget over feature creep, and telling me when I've outgrown outgoing webhooks.
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
-
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 Adaptive Card Action.Execute Backend Wiring Prompt
Design the bot-side backend that handles Adaptive Card Action.Execute invoke activities — returning refreshed cards, inline errors, and auto-loading indicators without bouncing users to a browser.
-
Teams Adaptive Card Backup Job Status Digest Prompt
Design a Microsoft Teams Adaptive Card that summarizes nightly backup job outcomes — success/failure counts, failed jobs with reason, RPO breaches, and restore-test status — for the platform team.
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.