Install
openclaw skills install @zkeviny/token-safe-webhook-senderSecure webhook token management using MGC Blackbox. Supports DingTalk, WeCom, Feishu, Telegram, Slack and more. Store webhook tokens locally in encrypted form, retrieve at runtime without exposing to AI models.
openclaw skills install @zkeviny/token-safe-webhook-senderWebhook Token Security is a documentation skill that teaches how to manage webhook tokens securely using MGC Blackbox. Supports multiple platforms including DingTalk, WeCom (Enterprise WeChat), Feishu (Lark), Telegram, and Slack. It enables AI agents to send notifications without ever exposing webhook tokens to the AI model.
This skill contains no executable code and is safe for automatic approval.
After reading this documentation, an AI agent will understand how to:
mgc_run (Mode B, full zero-exposure)ext02 parameterpip install mgc-blackbox (recommended 1.4.9+)mgc (WebUI: http://127.0.0.1:57218, API: http://127.0.0.1:57219)mgc_save, mgc_run, mgc_list, mgc_open_webui, mgc_seal) for token & script managementImportant:
mgc_getreturns plaintext and is for human/debug use only — it breaks zero-exposure. Prefermgc_runfor AI-driven sending.
Sandbox mode (Trae Work / Workbuddy): After installing MGC, open the WebUI to view and install the main MGC skill documentation. Run
mgc --statusto check status and sandbox mode.
| Platform | Token Type | Storage Format | API Endpoint |
|---|---|---|---|
| DingTalk | access_token + secret | JSON | https://oapi.dingtalk.com/robot/send |
| WeCom | webhook key | Plain text | https://qyapi.weixin.qq.com/cgi-bin/webhook/send |
| Feishu | webhook_url | Plain text | Custom webhook URL |
| Telegram | bot_token | Plain text | https://api.telegram.org/bot{token}/sendMessage |
| Slack | webhook_url / bot_token | JSON | Incoming Webhook or Web API |
Requires both access_token and secret for signature verification.
{
"access_token": "your_access_token",
"secret": "your_secret",
"webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxx"
}
Storage key: info_type=config, info_owner=dingtalk_myapp
Requires only the webhook key from the custom robot configuration.
{
"webhook_key": "your_webhook_key",
"webhook_url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx"
}
Storage key: info_type=config, info_owner=wecom_myapp
Requires the webhook URL from the custom bot configuration.
{
"webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx"
}
Storage key: info_type=config, info_owner=feishu_myapp
Requires bot_token and optionally chat_id.
{
"bot_token": "your_bot_token",
"chat_id": "your_chat_id"
}
Storage key: info_type=config, info_owner=telegram_mybot
Can use either incoming webhook URL or bot token.
{
"webhook_url": "https://hooks.slack.com/services/xxx",
"bot_token": "xoxb-xxx",
"channel": "#my-channel"
}
Storage key: info_type=config, info_owner=slack_myapp
Create a JSON file containing your webhook token details (see Platform-Specific Storage above).
Important: Tokens should be stored by humans via WebUI to avoid AI directly handling sensitive values. AI may call
mgc_open_webuito open the page for the user.
Recommended: WebUI (for human operators)
config, info_owner: your_webhook_nameAlternative: MCP (for AI agents, when user-authorized)
mgc_save(info_type="config", info_owner="...", content=...)mgc_list(info_type="config")Script runs locally and reads the token from MGC via HTTP API at runtime. The token never appears in code, but the script source is visible to whoever runs it.
info_type=config)Suitable for: one-off or debug tasks where you control the host.
Script is stored (and optionally sealed) inside MGC. AI calls mgc_run to execute; MGC returns only the execution result. AI never sees the token, the script source, or stdout.
mgc_save(info_type="config", info_owner="dingtalk_myapp", content=...)mgc_save(info_type="script", info_owner="webhook_send_dingtalk_v1", ext01="python", content=...)mgc_seal(info_owner="webhook_send_dingtalk_v1") — sealed scripts can only run inside MGC, cannot be decryptedmgc_run(info_owner="webhook_send_dingtalk_v1", ext02=json.dumps({"message": "deploy ok"}))Suitable for: production, multi-agent collaboration, any case where AI must not touch the token.
Note:
mgc_runreturns only the execution result, not script stdout. For sending tasks, have the script return a status JSON as the result; if detailed output is needed, write to a file and return the path.
ext02 carries runtime params to the script. It MUST be a JSON string (use json.dumps()). Some MCP clients mis-serialize dict values and return HTTP 422.
import json
ext02 = json.dumps({"title": "Alert", "message": "Deploy succeeded"})
result = mgc_run(info_owner="webhook_send_dingtalk_v1", ext02=ext02)
The script reads ext02 from its input, fetches the token from MGC internally, and sends. Token and script source stay inside MGC.
Endpoint: /api/mgc/sensitive/get Method: POST Headers:
Body fields:
Response fields:
Endpoint: /api/mgc/sensitive/save Method: POST Headers: same as above
Body fields:
Endpoint: /api/mgc/sensitive/run Method: POST Headers: same as above
Body fields:
Response: execution result only (non-blocking since 1.4.5, may return PID immediately). mgc_get action=run is retained for backward compatibility.
Want to learn more about MGC Blackbox?
MIT