Loading...
Loading...
Subscribe to governance events and receive HMAC-signed webhook deliveries in real-time.
Every action in DRD generates an event that is added to the hash-chained audit log. Events are the foundation of the reputation system and enforcement triggers.
| Event | Description |
|---|---|
| agent.registered | New agent registered |
| policy.evaluated | Policy check completed |
| policy.denied | Action blocked by policy |
| enforcement.created | Enforcement action applied |
| enforcement.appealed | Agent appealed enforcement |
| approval.requested | Operator approval needed |
| approval.decided | Approval approved/denied |
| reputation.updated | Agent reputation recalculated |
| badge.earned | Trust badge awarded |
| badge.revoked | Trust badge removed |
Each event stores a chain hash for tamper-evident auditing. Every event links to the previous, creating an immutable chain. Hash chain integrity is verified every 6 hours automatically.
Event N-2
SHA-256
Event N-1
SHA-256
Event N
SHA-256
chainHash = SHA-256(previousHash + eventType + data + timestamp)
// Each event links to the previous, creating an immutable chain
// Hash chain integrity is verified every 6 hours automaticallyThe dashboard uses SSE for real-time event streaming. You can also consume the stream directly.
const eventSource = new EventSource(
'https://api.drd.io/api/v1/events/stream',
{ headers: { 'Authorization': 'Bearer drd_live_sk_...' } }
);
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data.type, data.payload);
};Register a webhook endpoint to receive events via HTTP POST.
POST /api/v1/webhooks
{
"url": "https://your-server.com/drd-webhook",
"events": ["enforcement.created", "approval.requested"],
"secret": "whsec_..." // Optional: auto-generated if omitted
}All webhook deliveries are signed with HMAC-SHA256. Verify the signature to ensure the payload is authentic.
import crypto from 'crypto';
function verifyWebhook(payload: string, signature: string, secret: string) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
// In your webhook handler:
app.post('/drd-webhook', (req, res) => {
const signature = req.headers['x-drd-signature'];
if (!verifyWebhook(req.rawBody, signature, WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}
// Process the event...
});5 attempts
Exponential (1s, 2s, 4s, 8s, 16s)
10 seconds per delivery
Any 2xx response code
After 5 failed attempts, webhook is disabled