The pattern here generalizes to any lightweight external side effect you want an agent to trigger safely — Slack, email, PagerDuty, a Discord webhook: one required string parameter for the payload, one secret-typed credential that’s masked everywhere (CLI output, audit logs), and risk_level: low since posting a message is easy to reverse and hard to abuse. Swap the curl line for sendmail/aws ses send-email/whatever your mail provider’s CLI is and this becomes the “mail tool for agents” version of the same idea.
version: v1
tasks:
notify:
description: "Post a message to a Slack channel via webhook"
agent:
risk_level: low
env:
MESSAGE:
type: string
required: true
SLACK_WEBHOOK_URL:
type: secret
required: true
cmds:
- 'curl -s -X POST -H "Content-type: application/json" --data "{\"text\":\"${MESSAGE}\"}" $SLACK_WEBHOOK_URL'
Call it:
meriadoc task notify --env MESSAGE="Deploy finished" --env SLACK_WEBHOOK_URL=https://hooks.slack.com/...