Skip to main content
Cognisafe supports three forwarding methods with different latency and fidelity trade-offs:

Outbound Webhooks

Sub-second delivery of structured JSON. Recommended for real-time SOC alerting.

Log Shipping

Fluentd or Vector tail API pod stdout. Works with any SIEM that has a log collector agent.

PostgreSQL Direct

Point your SIEM’s JDBC/ODBC connector or a scheduled ETL at the safety_scores table.

Configure in the Dashboard

1

Open Webhook Settings

Navigate to Settings → Webhooks → Add Endpoint.
2

Enter Target URL

Provide the HTTPS URL your SIEM or middleware exposes as a receiver. The URL must return HTTP 2xx within 10 seconds.
3

Select Event Types

Choose one or more: threat_detected, usage_alert, redteam_complete.
4

Copy the Signing Secret

After saving, copy the webhook signing secret. You will use it to verify the X-Cognisafe-Signature header on every delivery.

Event Types and Payload Schemas

threat_detected

Fired whenever a safety scorer produces a score_label of fail for any request.

usage_alert

Fired when a project exceeds its monthly request quota or a cost threshold you configure.

redteam_complete

Fired when an automated red-team run finishes.

Signature Verification

Every delivery includes an X-Cognisafe-Signature header containing an HMAC-SHA256 digest of the raw request body, hex-encoded, prefixed with sha256=. Verification — Python:
Verification — Node.js:
Verification — Go:

Retry Behaviour

If your endpoint returns a non-2xx status or times out (>10s), Cognisafe retries with exponential backoff: After three failures the event is marked failed in the webhook delivery log (Settings → Webhooks → Delivery Log). You can manually replay any delivery from that log.

Test a Delivery with curl

Use the Send Test Event button in Settings → Webhooks to trigger a real delivery from Cognisafe’s servers (signed with your actual secret).

Method 2: Log Shipping via Fluentd or Vector

Cognisafe’s API and proxy write structured JSON to stdout. Every log line for a scored request includes:

Fluentd: Forward to Splunk HEC

Fluentd: Forward to Elasticsearch

Vector.dev Alternative

Vector is lower-overhead than Fluentd and handles backpressure better under burst traffic.

Method 3: PostgreSQL Direct Query

For batch ETL or SIEM connectors that poll a database, point them at a read replica of the Cognisafe PostgreSQL instance.

Sample Security Dashboard Query


Filtering Events

Webhooks

In Settings → Webhooks → Filters, apply CEL expressions:

Fluentd / Vector

Filter in the pipeline before the sink (shown in the Vector example above). This reduces egress costs and SIEM ingest volume.

PostgreSQL

Use a view to expose only the rows your SIEM user should see: