Skip to content

Commit 400fca1

Browse files
gouravjshahclaude
andcommitted
docs: Add multi-platform approval workflow and WhatsApp support documentation
- Add platform-specific approval methods table (Slack, Discord, Telegram, Teams, WhatsApp) - Add detailed WhatsApp Business API approval flow with interactive buttons example - Restore global spec.approval configuration section (marked as planned) - Update User ID Resolution table with status indicators - Add status column to Coming Soon table - Update CHANGELOG with platform-agnostic design notes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent dd45c91 commit 400fca1

File tree

3 files changed

+92
-27
lines changed

3 files changed

+92
-27
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
- **Approval User Whitelist** - Configure which users can approve destructive commands
12-
- New `approval_allowed_users` field in daemon config
13-
- Platform-agnostic ID format support: `U12345678`, `slack:U12345678`, `email:[email protected]`
12+
- New `approval_allowed_users` field in platform config (Slack implemented)
13+
- Platform-agnostic design: supports `U12345678`, `slack:U12345678`, `email:[email protected]` formats
14+
- Currently implemented: Raw Slack user IDs (e.g., `U015VBH1GTZ`)
15+
- Planned: Global `spec.approval.allowed_users` for multi-platform deployments
1416
- If not configured, anyone can approve (backward compatible)
1517
- Documentation and example config updated
1618

19+
### Notes
20+
- Config changes to `approval_allowed_users` require server restart (hot-reload coming in [Issue #22](https://github.com/agenticdevops/aof/issues/22))
21+
1722
## [0.1.15] - 2025-12-18
1823

1924
### Added

docs/guides/approval-workflow.md

Lines changed: 81 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,60 @@ To add approval support for a new platform:
3232
2. Handle approval events (reactions, button clicks, etc.)
3333
3. Call the shared `handle_approval` method on `TriggerHandler`
3434

35+
### Platform-Specific Approval Methods (Planned)
36+
37+
Each platform uses its native interaction mechanism for approvals:
38+
39+
| Platform | Mechanism | API | Notes |
40+
|----------|-----------|-----|-------|
41+
| **Slack** | Reactions | Events API | ✅ Implemented - `reaction_added` events |
42+
| **Discord** | Reactions | Gateway API | Similar to Slack, use emoji reactions |
43+
| **Telegram** | Inline Keyboards | Bot API | Interactive buttons below message |
44+
| **Microsoft Teams** | Adaptive Cards | Bot Framework | Rich card with action buttons |
45+
| **WhatsApp** | Interactive Buttons | Cloud API | Up to 3 buttons per message |
46+
47+
#### WhatsApp Business API (Planned)
48+
49+
WhatsApp Business API supports [Interactive Messages](https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-messages) with button replies - perfect for approval workflows:
50+
51+
```json
52+
{
53+
"type": "interactive",
54+
"interactive": {
55+
"type": "button",
56+
"header": { "type": "text", "text": "⚠️ Approval Required" },
57+
"body": { "text": "kubectl create deployment nginx --image=nginx" },
58+
"action": {
59+
"buttons": [
60+
{ "type": "reply", "reply": { "id": "approve", "title": "✅ Approve" } },
61+
{ "type": "reply", "reply": { "id": "deny", "title": "❌ Deny" } }
62+
]
63+
}
64+
}
65+
}
66+
```
67+
68+
**Requirements:**
69+
- WhatsApp Business Account
70+
- Cloud API access (Meta Developer Portal)
71+
- Verified business phone number
72+
- Webhook endpoint for button click callbacks
73+
74+
**Planned Config:**
75+
```yaml
76+
platforms:
77+
whatsapp:
78+
enabled: true
79+
access_token_env: WHATSAPP_ACCESS_TOKEN
80+
verify_token_env: WHATSAPP_VERIFY_TOKEN
81+
phone_number_id_env: WHATSAPP_PHONE_NUMBER_ID
82+
83+
# Approval whitelist (phone numbers)
84+
approval_allowed_users:
85+
- "+1234567890"
86+
- "+0987654321"
87+
```
88+
3589
## How It Works
3690
3791
### 1. Agent Returns Approval Request
@@ -243,7 +297,9 @@ AOF supports two levels of approval configuration:
243297
1. **Global Configuration** (Platform-Agnostic) - Applies to all platforms
244298
2. **Platform-Specific Configuration** - Overrides global for a specific platform
245299
246-
#### Global Configuration (Recommended)
300+
#### Global Configuration (Planned)
301+
302+
> **Status:** 🔄 Coming Soon - This feature is planned for a future release.
247303
248304
```yaml
249305
apiVersion: aof.dev/v1
@@ -276,7 +332,6 @@ spec:
276332
enabled: true
277333
bot_token_env: SLACK_BOT_TOKEN
278334
signing_secret_env: SLACK_SIGNING_SECRET
279-
bot_user_id: U12345678
280335
281336
discord:
282337
enabled: true
@@ -288,7 +343,7 @@ spec:
288343
app_secret_env: TEAMS_APP_SECRET
289344
```
290345

291-
#### Platform-Specific Configuration (Overrides Global)
346+
#### Platform-Specific Configuration (Current Implementation)
292347

293348
For Slack-only deployments or when you need platform-specific overrides:
294349

@@ -298,7 +353,6 @@ platforms:
298353
enabled: true
299354
bot_token_env: SLACK_BOT_TOKEN
300355
signing_secret_env: SLACK_SIGNING_SECRET
301-
bot_user_id: U12345678 # Your bot's user ID
302356

303357
# Platform-specific: Overrides global approval.allowed_users for Slack
304358
approval_allowed_users:
@@ -307,23 +361,33 @@ platforms:
307361
- U33333333 # Team Lead
308362
```
309363
364+
> **Important:** After changing `approval_allowed_users`, you must restart the server for changes to take effect. Hot-reload is planned for a future release (see [GitHub Issue #22](https://github.com/agenticdevops/aof/issues/22)).
365+
366+
### Finding Your Slack User ID
367+
368+
1. In Slack, click on a user's profile
369+
2. Click the "..." (More) button
370+
3. Select "Copy member ID"
371+
4. The ID looks like `U015VBH1GTZ`
372+
310373
### User ID Resolution
311374

312375
The approval system resolves user identities across platforms:
313376

314-
| ID Format | Example | Platforms |
315-
|-----------|---------|-----------|
316-
| `email:[email protected]` | Universal | All (requires identity mapping) |
317-
| `slack:U12345678` | Slack user ID | Slack only |
318-
| `discord:123456789` | Discord user ID | Discord only |
319-
| `teams:[email protected]` | Teams UPN | Teams only |
320-
| `telegram:123456789` | Telegram user ID | Telegram only |
321-
| Raw ID (legacy) | `U12345678` | Platform-specific |
377+
| ID Format | Example | Status |
378+
|-----------|---------|--------|
379+
| Raw ID | `U12345678` | ✅ Implemented (Slack) |
380+
| `slack:U12345678` | Slack user ID | 🔄 Planned |
381+
| `discord:123456789` | Discord user ID | 🔄 Planned |
382+
| `teams:[email protected]` | Teams UPN | 🔄 Planned |
383+
| `telegram:123456789` | Telegram user ID | 🔄 Planned |
384+
| `whatsapp:+1234567890` | WhatsApp phone number | 🔄 Planned |
385+
| `email:[email protected]` | Universal | 🔄 Planned (requires identity mapping) |
322386

323387
### Behavior
324388

325389
- **No whitelist configured**: Anyone can approve (default)
326-
- **Global whitelist only**: Applies to all platforms
390+
- **Global whitelist only**: Applies to all platforms (planned)
327391
- **Platform-specific whitelist**: Overrides global for that platform
328392
- **Unauthorized approval attempt**: User sees "⚠️ @user is not authorized to approve commands"
329393

@@ -415,7 +479,9 @@ Approvals are keyed by message timestamp. If the bot restarts, pending approvals
415479
416480
| Feature | Status | Platform |
417481
|---------|--------|----------|
418-
| Platform-specific `approval_allowed_users` | ✅ Complete | Slack (v0.1.16+) |
482+
| Global `spec.approval.allowed_users` | 🔄 Planned | All platforms |
483+
| Config hot-reload (`aofctl serve --reload`) | 🔄 [Issue #22](https://github.com/agenticdevops/aof/issues/22) | All |
484+
| Platform-prefixed IDs (`slack:U123`, `discord:123`) | 🔄 Planned | All platforms |
419485
| Discord approval (reactions) | 🔄 Planned | Discord |
420486
| Teams approval (Adaptive Cards) | 🔄 Planned | Microsoft Teams |
421487
| Telegram approval (inline buttons) | 🔄 Planned | Telegram |
@@ -424,6 +490,7 @@ Approvals are keyed by message timestamp. If the bot restarts, pending approvals
424490
425491
## Future Enhancements
426492
493+
- [ ] Config hot-reload without server restart ([Issue #22](https://github.com/agenticdevops/aof/issues/22))
427494
- [ ] Approval timeout/expiration
428495
- [ ] Multi-party approval (require 2+ approvals)
429496
- [ ] Global platform-agnostic RBAC (spec.approval.allowed_users)

examples/config/slack-daemon.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,11 @@ spec:
4242
bot_token_env: SLACK_BOT_TOKEN
4343
signing_secret_env: SLACK_SIGNING_SECRET
4444

45-
# Approval Whitelist (optional)
46-
# Restrict who can approve destructive commands (delete, scale, apply, etc.)
47-
# If not set, anyone can approve. Supports:
48-
# - Raw Slack user IDs: "U12345678"
49-
# - Platform-prefixed: "slack:U12345678" (for future multi-platform support)
50-
# - Email format (future): "email:[email protected]"
51-
#
52-
# Example:
45+
# Approval Whitelist - Only these users can approve destructive commands
46+
# Leave empty or omit to allow anyone to approve (default behavior)
5347
# approval_allowed_users:
54-
# - U12345678 # Slack user ID (find in Slack profile)
55-
# - UABCDEFGH # Another team member
56-
# - slack:U98765432 # Platform-prefixed format
48+
# - U12345678 # Replace with actual Slack user IDs
49+
# - U87654321 # Multiple users can be whitelisted
5750

5851
agents:
5952
directory: ./examples/agents/

0 commit comments

Comments
 (0)