Risk alerts
When risk crosses a threshold, a person hears about it.
Elevated or critical risk fires a signed safety.flagged webhook from both observe() and process(), whether or not a gate also acted. Send it to your own endpoint, Slack or Discord, and on to a human takeover.
Alerts · live
- safety.flaggedcriticaluser_88 · flags: self_harm→ Webhook · Slack
- safety.holdholduser_42 · reply held for review→ Webhook
- anomaly.detectedwarninguser_17 · engagement_drop→ Webhook
- proactive.mood_droptriggeruser_05 · mood below 0.30→ Discord
Alerts that leave the API response
A risk level in a response only helps if someone reads it. Humane sends the alert out as a signed webhook with the user's id, the risk level, the flags and the call it came from, so your team can act without building the alerting themselves.
- safety.flagged on elevated and critical risk
- safety.hold and safety.blocked when a gate acts
- anomaly.detected and proactive events for slower-moving risk
- Slack and Discord connectors format the same events for a channel
Webhook delivery
POST /hooks/humane
X-Humane-Event: safety.flagged
X-Humane-Delivery-Attempt: 1
X-Humane-Signature: t=1762000000,v1=5f2c…9ab1
{"event":"safety.flagged",
"data":{"user_id":"user_88","risk_level":"critical",
"flags":["self_harm"],"source":"observe"}}Retried on failure · dead-letter queue · manual retry
Verify, then page someone
import json, os
from fastapi import FastAPI, HTTPException, Request
from humane_ai import verify_webhook_signature
app = FastAPI()
SECRET = os.environ["HUMANE_WEBHOOK_SECRET"]
@app.post("/hooks/humane")
async def humane_hook(request: Request):
raw = await request.body()
sig = request.headers.get("X-Humane-Signature")
if not verify_webhook_signature(SECRET, raw, sig): # also rejects replays
raise HTTPException(401, "invalid signature")
event = json.loads(raw) # {"event": ..., "timestamp": ..., "data": {...}}
if event["event"] == "safety.flagged":
d = event["data"]
page_on_call(d["user_id"], d["risk_level"], d["flags"], d["source"])
return {"ok": True}Wire it up in an afternoon
- 1
Add an endpoint
Verify the X-Humane-Signature header with the SDK helper.
- 2
Subscribe
Choose safety.flagged, safety.hold and safety.blocked, or everything with *.
- 3
Route to a person
Page your on-call rota, post to a channel, or open a takeover for that user.
Humane is not an emergency service
Alerts help your team notice risk sooner. They don't replace your own crisis procedures, staffing or local emergency services, and automated detection can miss things. Plan the human response before you rely on it.
Alert questions
Something else? Ask us.
Works well with
Observe mode
observe() reads a turn your own model already produced and returns the user's state and a risk level. It needs no model configuration, generates nothing and never sits in front of your reply.
ExploreWebhooks and events
Humane posts events to your endpoints as things happen: safety flags, holds and blocks, proactive triggers, takeovers, anomalies and more. Every delivery is signed with HMAC-SHA256, retried on failure and parked in a dead-letter queue if it keeps failing.
ExploreHuman takeover
When the signals say someone needs a person, an operator opens a takeover for that user. The AI pauses, the operator's messages reach the user in the same conversation, and the AI resumes when the operator releases it or goes idle.
ExploreEvery AI should know who it's talking to.
The safety and human-oversight layer for emotional AI: user state across sessions, risk alerts, safety gates and human takeover, with every decision explained.
