Skip to main content
Real-time HTTP POST notifications for integrity and alignment events. Pipe violations, drift alerts, conscience escalations, alignment traces, and billing events into PagerDuty, Slack, Datadog, or any HTTP endpoint. Instead of polling the API, configure webhook endpoints to receive events as they happen. Mnemom signs every payload with HMAC-SHA256 so your server can verify authenticity before acting on it. Mnemom emits two categories of webhook events:
  • Integrity Events (AIP) — per-turn checkpoint verdicts from the gateway (violations, drift, conscience)
  • Alignment Trace Events (AAP) — post-hoc trace analysis from the observer (verification, escalation, policy)
Both use the same registration endpoint and table. A single webhook endpoint can subscribe to events from both systems.
Webhook notifications are available on the Enterprise plan. Contact sales to enable this feature.

Quick start

Get your first webhook firing in under 5 minutes: 1. Create an endpoint in your organization settings, or via the API:
This example subscribes to AIP integrity violations, drift alerts, and AAP trace failures — all at one endpoint. 2. Copy the signing secret from the response — it’s shown only once:
Copy the signing_secret immediately. It is not retrievable after creation. If you lose it, use the rotate secret endpoint to generate a new one.
3. Send a test event to verify connectivity:
4. Verify the signature on your server (see Signature Verification below).

Event catalog

Mnemom emits 28 event types across two systems: AIP (integrity checkpoints from the gateway) and AAP (alignment traces from the observer), plus platform events for drift, reputation, teams, and billing.

Integrity events (AIP)

These events fire from the gateway as it processes each request. AIP webhook payloads are signed with X-AIP-Signature and include X-AIP-Version.

Alignment trace events (AAP)

These events fire from the observer after post-hoc trace analysis. AAP webhook payloads are signed with X-AAP-Signature and include X-AAP-Version. Use the trace.* wildcard to subscribe to all trace events, or * for everything.
A single registration can subscribe to both AIP and AAP events. For example, event_types: ["integrity.violation", "trace.failed"] will receive gateway violations and observer trace failures at the same endpoint. The signature header (X-AIP-Signature vs X-AAP-Signature) tells you which system sent the event.

Platform events

Subscribe to specific event types when creating an endpoint, or leave event_types empty to receive all events.

Payload envelope

Every webhook delivery uses the same envelope structure:

Example payloads

AAP trace event payloads

AAP trace events use a different payload structure from AIP events. The envelope includes event (most specific event type), all_events (all applicable types for this trace), and a trace object with verification and policy results.
AAP events are signed with X-AAP-Signature (not X-AIP-Signature). The HMAC-SHA256 algorithm is identical — only the header name differs. Use the header name to distinguish which system sent the webhook.

Security

HMAC-SHA256 signing

Every webhook delivery includes three headers for signature verification: The signature is computed over the string {timestamp}.{raw_body} using your endpoint’s signing secret as the HMAC key. This follows the Stripe webhook signing convention.

Replay protection

Always verify that the timestamp is within an acceptable window (recommended: 5 minutes) to prevent replay attacks. Reject any delivery where X-Webhook-Timestamp is more than 300 seconds from your server’s current time.

Constant-time comparison

Use a constant-time comparison function when verifying signatures to prevent timing attacks. All standard libraries provide one — see the verification examples below.

Signature verification

Verify webhook signatures in your endpoint handler to ensure payloads are authentic and untampered. Below are examples in four languages.
Always verify signatures against the raw request body (the exact bytes received), not a re-serialized JSON object. JSON serialization can alter key ordering, whitespace, or Unicode escaping, which will cause signature mismatches.

Delivery & retries

First delivery

Mnemom attempts inline delivery immediately when an event is emitted. Most webhooks arrive within seconds of the triggering event. The first delivery attempt includes up to 4 rapid retries (at 1s, 5s, and 15s intervals). If all inline attempts fail, the event enters the dead-letter queue (DLQ) for persistent retry.

Retry schedule

Failed deliveries are retried in two phases: Phase 1: Inline (immediate) Phase 2: DLQ (persistent, exponential backoff) After 10 total attempts, the delivery is marked as dead (permanently failed). Platform alerts fire when a delivery is dead-lettered. You can redeliver dead events manually via the API.

Permanent vs. retryable failures

Auto-disable

If an endpoint accumulates 100 consecutive failures, it is automatically disabled. The account owner receives an email notification. To resume deliveries:
  1. Fix the underlying issue with your endpoint
  2. Re-enable the endpoint in organization settings (or via PATCH with is_active: true)
  3. The failure counter resets when you re-enable

Idempotency

Use the id field in the payload envelope as an idempotency key. The same event may be delivered more than once (e.g., after a redeliver request). Your handler should deduplicate using the event ID.

Ordering

Webhook deliveries are best-effort ordered by creation time. Due to retries and network variance, events may arrive out of order. Use the created_at timestamp for ordering if your use case requires it.

Testing

Test delivery button

Every endpoint has a “Test” action that sends a synthetic webhook.test event with a test payload. Use this to verify connectivity and signature verification without triggering a real integrity event.
Response:

Development tools

For local development, use webhook.site or ngrok to expose a local endpoint:

Delivery log

View the delivery history for any endpoint to debug issues:
Each delivery record includes: status, HTTP response code, attempt count, latency, and error details.

Redelivery

Redeliver a failed event to retry with the same payload:

Integration examples

PagerDuty

Route integrity violations to PagerDuty as incidents:

Slack

Post alerts to a Slack channel via incoming webhook:

Datadog

Send custom events to Datadog:

Troubleshooting

  • Ensure you’re verifying against the raw request body, not re-serialized JSON
  • Check that your signing secret is correct — it was only shown once at creation time. If lost, rotate the secret.
  • Verify the timestamp header is being read correctly (it’s in Unix seconds, not milliseconds)
Webhook endpoints must use HTTPS. HTTP URLs are rejected at creation time. For local development, use ngrok or a similar tunneling tool.
Your endpoint must respond within 10 seconds. If processing takes longer, return 200 immediately and process the event asynchronously (e.g., via a background job queue).
HTTP 4xx responses (except 429) are treated as permanent failures and are not retried. Common causes:
  • 401/403 — Your auth middleware is blocking the request. Mnemom webhooks don’t include bearer tokens.
  • 404 — The endpoint URL path is incorrect.
  • 400 — Your request validation is rejecting the payload format.
After 100 consecutive delivery failures, the endpoint is automatically disabled. Fix the underlying issue, then re-enable the endpoint. The failure counter resets on re-enable.
  • Verify the endpoint is active (is_active: true)
  • Check that the event type is included in the endpoint’s event_types (or that event_types is empty for all events)
  • Confirm the triggering action occurred on an agent linked to an Enterprise billing account
  • Check the delivery log for failed attempts

FAQ

Mnemom does not impose explicit rate limits on outbound deliveries. However, if your endpoint returns 429 (Too Many Requests), we respect that signal and back off for at least 60 seconds before retrying.
Events are delivered in best-effort order. Due to retries and network conditions, events may arrive out of order. Use the created_at field for sequencing.
Webhook payloads are typically under 4 KB. The maximum payload size is 64 KB.
Use the rotate secret endpoint: POST /v1/orgs/{org_id}/webhooks/{endpoint_id}/rotate-secret. The new secret is returned once. Update your verification code before new deliveries arrive.
Yes, up to 5 endpoints per organization. Each endpoint can subscribe to different event types.
Delivery records are retained for 30 days. Older records are automatically purged.
Events are queued and retried according to the backoff schedule. If your endpoint recovers within the retry window (~1 hour), all events will be delivered. Beyond that, they are marked as failed but remain in the delivery log for redelivery.

API reference