Skip to content
Cisco AI Defense logo
CiscoAI Security

Webhook dispatcher — DefenseClaw

Overview

The webhook dispatcher delivers chat and incident notifications to configured webhooks[] entries. It is separate from audit_sinks[].http_jsonl: webhooks render notification payloads, while HTTP JSONL sinks forward audit events.

Configured in two places

Setup uses the dedicated command group:

defenseclaw setup webhook add slack --name slack-security --url https://hooks.slack.com/services/...
defenseclaw setup webhook add pagerduty --name pd-oncall --url https://events.pagerduty.com/v2/enqueue --secret-env DEFENSECLAW_PD_KEY
defenseclaw setup webhook add webex --name webex-alerts --url https://webexapis.com/v1/messages --secret-env DEFENSECLAW_WEBEX_TOKEN --room-id Y2lzY29z...
defenseclaw setup webhook add generic --name custom-incident --url https://siem.example.com/hook --secret-env DEFENSECLAW_WEBHOOK_SECRET

Each entry becomes a block under webhooks: in ~/.defenseclaw/config.yaml.

Transport

TypeContent-typeAuthRetry
slackapplication/jsonURL (secret)exponential backoff
pagerdutyapplication/jsonrouting-keyexponential backoff
webexapplication/jsonbearerexponential backoff
genericapplication/jsonHMAC-SHA256 in X-Hub-Signature-256 when secret_env is setexponential backoff

The runtime tries up to four HTTP attempts total: the initial request plus three retries. HTTP 5xx, 429, and transport errors are retryable; most 4xx responses are permanent failures.

Runtime filters

Each webhook can declare:

FieldBehavior
min_severityEvents below the configured severity are skipped.
eventsOptional allow-list of event categories: block, scan, guardrail, drift, health.
timeout_secondsPer-delivery request timeout; defaults to 10 seconds.
cooldown_secondsDuplicate target/action suppression window; omitted means 300 seconds, 0 disables cooldown.
webhooks:
  - name: slack-security
    type: slack
    url_env: SLACK_URL
    secret_env: ""
    min_severity: HIGH
    events: [block, guardrail]
    timeout_seconds: 10
    cooldown_seconds: 300

The dispatcher redacts event.Details with redaction.ForSinkReason before formatting payloads.

Test command

defenseclaw setup webhook test slack-security --dry-run
defenseclaw setup webhook test slack-security --timeout 10

The name is a positional argument. --dry-run formats the payload and headers without delivering.

Related