Guide · Verified October 31, 2026
Trigger AI agents from webhooks
Short answer: Point the provider's webhook at a Hooks endpoint, add one destination per agent target with filters and a task template, and every matching event becomes an agent task with retries and a delivery log.
This page is the five-minute path from a raw webhook to a running agent: one endpoint receives and verifies the event, per-target filters decide whether it matters, a payload template reshapes it into a task, and the delivery log shows what each agent received and what it answered.
1. Receive and verify the event
Create an endpoint for the source (GitHub, Stripe, Slack, Linear, or any generic HMAC-SHA256 sender; Sentry is planned). Hooks checks the provider's own signature scheme, stores the raw payload and headers, and normalizes the event into one shape with id, type, actor, subject, and repo or project. Unverified requests never reach your agents.
2. Filter to the events that matter
Each destination carries its own filter rules, evaluated before delivery. Only matching events fan out — an issue labeled bug goes to triage, a @mention goes to the on-call agent, everything else stays in the log without a delivery. Until sender allowlists land, scope filters tightly and review the log for unexpected matches.
Filter: only labeled issues
{
"all": [
{ "field": "event.type", "op": "eq", "value": "issue.labeled" },
{ "field": "event.subject.labels", "op": "contains", "value": "bug" }
]
}3. Reshape the payload into a task
Declarative templates render per destination against the normalized event: field paths, defaults, and filters. The same GitHub issue becomes a terse triage prompt for one agent and a full-context brief for another, without touching the source event.
Template: Grok Bot task
{
"routineUrl": "https://grok.example.com/routines/abc123",
"key": "{{secret.GROKBOT_KEY}}",
"task": "{{event.subject.title}}\n\n{{event.subject.body | truncate:2000}}\n{{event.subject.url}}",
"repo": "acme/app"
}4. Deliver with retries and watch the log
Every target gets its own retry schedule: 408, 425, 429, and 5xx responses retry with backoff honoring Retry-After; other 4xx fail permanently with a named code. A 2xx from an agent target means the task was queued, not finished — the delivery log keeps per-attempt status, the rendered request, and the target response, and failed deliveries replay from the original stored event.
5. Keep secrets and payloads safe
Credentials live in project secrets and enter configs only as {{secret.NAME}} references; literal keys are rejected and the authorization header is recorded as [redacted]. Treat the ingress URL itself as a secret, verify signatures before trusting anything, and remember agent targets execute whatever the template renders — filter first, template second.
Frequently asked questions
Which sources can trigger agents today?
GitHub, Stripe, Slack, and Linear, plus any generic source that signs with HMAC-SHA256. Sentry support is planned. Each adapter verifies the provider's own scheme and normalizes events before filtering.
Which agent targets are supported?
Grok Bot routine webhooks, T3 Code scheduled tasks with webhook triggers, Paseo Hub manual runs, Slack, and plain HTTP webhooks. Full per-target guides live under /targets.
Does a 200 from the agent mean the job finished?
No. A 2xx means the task was accepted and queued; the agent runs asynchronously. Hooks records the run id when the target returns one (for example Paseo's triggerRunId) so you can correlate deliveries with runs.
How do I avoid prompt injection from webhook content?
Filter to trusted events, keep templates minimal (title plus URL rather than full bodies where possible), and never render secrets into tasks. Sender allowlists with default-deny for agent targets are on the roadmap; until then, tight filters plus log review are the control.
Reference
- For AI agentshttps://hooks.events/docs/agents.md
- Payload templateshttps://hooks.events/docs/templates.md
- Retries & idempotencyhttps://hooks.events/docs/retries.md
- Secrets & rotationhttps://hooks.events/docs/secrets.md
- Destinationshttps://hooks.events/docs/destinations.md