> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Security logs

> Every security event is kept in the workspace's audit log and can also be sent to Splunk, Datadog, Microsoft Sentinel, Elastic, Sumo Logic or any HTTPS collector.

Sign-ins, permission changes, credential changes, blocked calls and agent
actions are all security events. EvalGate records every one in the workspace's
audit log and can also send them to your own security tools.

Only a workspace admin can manage security logs. Through the API and CLI that
means an admin credential with the `admin:workspace` scope.

> [!WARNING]
>
> None of the six destinations has been checked against a live vendor
> endpoint yet. The request shapes follow each vendor's documentation and are
> covered by mocked tests, but no event has been delivered to a real Splunk,
> Datadog, Microsoft Sentinel, Elasticsearch or Sumo Logic tenant. Send a
> test event after setup (see below), and watch the delivery history for the
> first real events.

## Activity history (built in)

Every workspace records security events in **Activity history**, its
hash-chained, tamper-evident audit log. It needs no setup and cannot be turned
off. Open it from **Settings → Security logs → View activity history**, or go
to **Settings → Audit logs**.

The destinations below receive copies. Activity history still records every
event when a destination is paused, failing or removed.

## What is sent

Each audit log entry is sent as a [CloudEvents 1.0](https://cloudevents.io)
event with an [OCSF 1.10.0](https://schema.ocsf.io) mapping in `data.ocsf`.

| OCSF class | `class_uid` | Events |
| - | - | - |
| Authentication | 3002 | Sign-in and SSO sign-in, sign-out, MFA verification, session revocation, break-glass sessions |
| Account Change | 3001 | Password changes and resets, MFA enrolment, removal, reset and lockout |
| User Access Management | 3005 | Invitations, joins, role changes, member removal |
| Group Management | 3006 | SCIM group-to-role mappings |
| Entity Management | 3004 | API keys, provider credentials, SSO providers, verified domains, identity policy, runners, workspace lifecycle, and changes to security log destinations themselves |
| Detection Finding | 2004 | Blocked model calls, egress denials, PII events, redacted credentials, quarantine |
| API Activity | 6003 | Everything else, including agent evidence |

An action with no specific mapping is sent as API Activity, so no entry is
dropped for lack of a mapping. Request IP addresses and user agents are sent
only as the keyed digests the audit log stores, never as raw values.

An event looks like this, with `data` shortened:

```json theme={null}
{
  "specversion": "1.0",
  "id": "4f1c…",
  "source": "/organizations/<organization id>",
  "type": "com.evalgate.security.api_key.created.v1",
  "time": "2026-11-23T10:15:00.000Z",
  "subject": "api_key/123",
  "datacontenttype": "application/json",
  "evalgateschemaversion": "security-event.v1",
  "evalgatechainsequence": 4182,
  "data": {
    "auditEventId": "…",
    "action": "api_key.created",
    "resourceType": "api_key",
    "resourceId": "123",
    "actorUserId": "…",
    "outcome": "unknown",
    "metadata": { },
    "integrity": { "chainSequence": 4182, "entryHash": "…" },
    "ocsf": { "class_uid": 3004, "activity_id": 1 }
  }
}
```

* `type` is `com.evalgate.security.<action>.v1`.
* `id` is stable for each entry, so a receiver can drop duplicates by `id`.
* `evalgatechainsequence` is the entry's position in the audit chain.
* `data.truncated` appears only on an entry too large to send whole. Its
  resource id is cut to 1,024 characters with a `…[truncated]` marker, or its
  metadata is left out, and `truncated` lists which fields and the full size.
  The full entry stays in the audit log, and `integrity` still identifies it.

**Agent readbacks.** When EvalGate checks an agent's side effect against the
target system, the result goes out as `com.evalgate.agent.effect_verification.v1`.
It is mapped to OCSF API Activity and carries the claim's verification state.
Tool arguments are never included.

**Pulling instead of pushing.** A collector that would rather pull agent
readbacks can page through `GET /api/agent-evidence/audit-events?after=<cursor>&limit=<n>`.
It returns the same CloudEvents, oldest first.

A new destination starts at the moment it is added. Events recorded before
then are not sent.

## Destinations

Add a destination from **Settings → Security logs → Add a destination**. You
pick each vendor's address from lists, and the address is built for you. Only
**Any HTTPS collector** takes an address you type.

Credentials are write-only. They are stored encrypted and are never shown
again, in the page, the API or the CLI.

> [accordion] Splunk (HTTP Event Collector)
>
> Choose **Splunk Cloud Platform** and enter the stack name (the part
> before `.splunkcloud.com`), or a Splunk Enterprise host and HEC port.
> Events go to `/services/collector/event` with `Authorization: Splunk     <token>`, sourcetype `evalgate:security`. Paste the **HEC token** from
> Settings → Data inputs → HTTP Event Collector.

> [accordion] Datadog Logs
>
> Choose your Datadog site (US1, US3, US5, EU1, AP1, AP2 or US1-FED).
> Events go to the site's `http-intake.logs` `/api/v2/logs` endpoint with
> `DD-API-KEY`, source and service `evalgate`, and the tags
> `evalgate_type` and `evalgate_verification`. Paste an **API key** from
> Organization Settings → API Keys.

> [accordion] Microsoft Sentinel
>
> Events go through the Azure Monitor Logs Ingestion API
> (`api-version=2023-01-01`) into a data collection rule stream, one row
> per event. Enter:
>
> * the Azure cloud (global, US Government or China);
> * the logs ingestion endpoint;
> * the DCR immutable ID (`dcr-` followed by 32 characters);
> * the stream name, which must start with `Custom-` (default
>   `Custom-EvalGateSecurity_CL`);
> * the Directory (tenant) ID and Application (client) ID;
> * the **client secret's Value** from App registrations → Certificates &
>   secrets.
>
> Give the app the Monitoring Metrics Publisher role on the data collection
> rule. The role can take up to 30 minutes to apply. EvalGate signs in to
> Microsoft Entra with the client secret and caches the token until shortly
> before it expires.
>
> Each row has the columns `TimeGenerated`, `EventId`, `EventType`,
> `EventSource`, `Subject`, `Action`, `Outcome`, `ActorUserId`,
> `OcsfClassUid`, `ChainSequence`, `Verification` and `Event` (the whole
> CloudEvent). Define your stream with these columns.

> [accordion] Elastic
>
> Give a Cloud ID, an Elastic Cloud or Serverless endpoint, or a
> self-managed host and port, plus an index or data stream (default
> `logs-evalgate.security-default`). Each event is created with
> `PUT /<index>/_create/<event id>` and `Authorization: ApiKey`, mapped to
> ECS 9.5.0 with the whole CloudEvent under `evalgate.cloudevent`. The event
> id is the document id, so a retried event is never indexed twice: a 409
> counts as delivered. Paste the **Encoded** value of an API key that can
> write to the index.

> [accordion] Sumo Logic
>
> Choose your deployment (US1, US2, AU, CA, CH, DE, ESC, EU, FED, JP or KR)
> and paste the HTTP Logs and Metrics Source address, or just the token at
> its end. The token is stored encrypted, separately from the address, and
> added only when an event is sent. Events carry `X-Sumo-Category:
>         evalgate/security` and `X-Sumo-Name: evalgate`.

> [accordion] Any HTTPS collector (signed CloudEvents)
>
> Events are posted to your HTTPS address as structured CloudEvents
> (`Content-Type: application/cloudevents+json`). EvalGate creates a
> **signing secret** and shows it once, when you add the destination. Copy
> it then: it cannot be shown again, only replaced.

Addresses must use `https://` and cannot contain credentials. EvalGate checks
every address before saving it and again before each delivery, and refuses
private and internal addresses. A workspace's data egress policy can also
block a delivery. The delivery history then says so.

### Verify signed CloudEvents

Each request to an HTTPS collector carries:

* `X-Webhook-Signature: sha256=<hex>`: an HMAC-SHA256 of the exact request
  body, keyed with the signing secret;
* `X-Webhook-Event`: `security.event` for audit log entries,
  `agent.audit_event` for agent readbacks, and `security.test` for a test
  event;
* `X-Webhook-Timestamp`;
* `X-Idempotency-Key`: the CloudEvent `id`.

Compute the HMAC over the raw body before parsing it, compare it with the
header in constant time, and reject the request if they differ.

```ts theme={null}
import { createHmac, timingSafeEqual } from "node:crypto";

export function verify(rawBody: string, header: string, secret: string) {
  const expected = `sha256=${createHmac("sha256", secret).update(rawBody).digest("hex")}`;
  const a = Buffer.from(expected);
  const b = Buffer.from(header);
  return a.length === b.length && timingSafeEqual(a, b);
}
```

Vendor destinations use the vendor's own authentication header and are not
HMAC-signed.

## Set up from the CLI

The `evalgate security-logs` command does everything the settings page does.
Pass credentials with `--token-env` or `--token-stdin` so they stay out of
your shell history.

```bash theme={null}
# Splunk HEC
evalgate security-logs add --format splunk \
  --url https://http-inputs-acme.splunkcloud.com/services/collector/event \
  --token-env SPLUNK_HEC_TOKEN

# Microsoft Sentinel
evalgate security-logs add --format sentinel \
  --url https://<endpoint>.ingest.monitor.azure.com/dataCollectionRules/<dcr-id>/streams/Custom-EvalGateSecurity_CL \
  --cloud public --tenant-id <tenant> --client-id <client> --token-env ENTRA_CLIENT_SECRET

# Sumo Logic: the whole source address can be the token source
evalgate security-logs add --format sumo --token-env SUMO_SOURCE_ADDRESS

# Any HTTPS collector: prints the signing secret once
evalgate security-logs add --format cloudevents --url https://logs.example.com/evalgate

evalgate security-logs list
evalgate security-logs test 12
```

Formats are `cloudevents`, `splunk_hec`, `datadog_logs`, `microsoft_sentinel`,
`elastic` and `sumo_logic`. The short names `splunk`, `datadog`, `sentinel`
and `sumo` also work. Unlike the settings page, `--url` takes the full
destination address. For Datadog, that is the site's
`https://http-intake.logs.<site>/api/v2/logs` address; for Elastic, the
Elasticsearch address followed by the index name. Add `--json` for
machine-readable output. Run `evalgate security-logs --help` for every
option.

The same actions are available over the API under
`/api/security-log-destinations`. See the API reference.

## Send a test event

**Send test event** on a destination (or `evalgate security-logs test <id>`)
sends one event labelled `test` through the real delivery path. It answers in
one sentence: either the destination accepted it, or what went wrong and what
to check. For example, a refused token, a missing data collection rule, or an
address that did not answer. The test event is not written to the audit log.
A paused destination does not send test events.

## Pause and resume

**Pause** stops sending to a destination without removing it. Events keep
being recorded in Activity history.

When you **Resume**, choose where to start:

* **Send what was missed** (`--from where-it-stopped`) sends every event
  recorded while the destination was paused, agent readbacks included, then
  carries on.
* **Start from now** (`--from now`) skips what was recorded while paused. The
  skipped range is written to the audit log, so the destination itself
  receives a record of the gap.

Pausing and resuming are both recorded as security events
(`security_log_destination.paused` and `security_log_destination.resumed`).

## Replace a credential or rotate the signing secret

* **Replace token** (or key, or secret) swaps a vendor credential in place.
  Use `evalgate security-logs credential <id> --token-env NAME` from the CLI.
  The new value is never shown.
* **Rotate the signing secret** of an HTTPS collector creates a new secret
  and shows it once. Use `evalgate security-logs credential <id> --rotate-signing-secret` from the CLI. The old secret stops working at once,
  so update your receiver straight away.

Both changes are recorded in the audit log.

## Delivery history and retries

**Recent deliveries** on each destination lists what was sent, newest first.
Each entry shows one of:

* **Delivered**
* **Sending**
* **Retrying**
* **Failed**
* **Stopped retrying**

Each entry also has the HTTP status and a plain reason. Raw response bodies
are never shown. A destination is marked **Needs attention** when its latest
delivery failed or any delivery has stopped retrying.

An entry too large to send whole (see `data.truncated` above) is marked
**Shortened**, with what was cut and the size of the whole event. The API and
`evalgate security-logs deliveries` report the same as `truncated`
(`fields` and `originalBytes`); it is `null` for an event sent whole.

How failed deliveries are retried:

* A delivery is tried up to five times, with backoff between attempts.
* A `429` waits for the destination's `Retry-After`, kept between 1 second
  and 1 hour (60 seconds when none is given).
* Server errors and network failures back off and try again.
* A `4xx` other than `408`, `425` and `429` cannot succeed on retry. Examples
  are a refused token or an address that does not exist. Such a delivery
  stops retrying at once and is kept for replay.

After fixing the cause, select **Retry** on the entry, or use `evalgate
security-logs retry <id> --delivery <delivery id>` or `--job <job id>` (both
listed by `evalgate security-logs deliveries <id>`). A paused destination must
be resumed before retrying.

## Limitations

* **Live qualification.** As stated at the top, no destination has been
  qualified against a real vendor endpoint yet.
* **Unconfirmed vendor details.** The Elastic Cloud ID decoding follows the
  scheme used by Elastic's official clients, which Elastic does not document.
  The Azure China ingestion host suffix (`.ingest.monitor.azure.cn`) has not
  been confirmed from an official reference page.
* **Redis job queue.** On self-hosted installs that run jobs on Redis,
  deliveries that stopped retrying do not appear in the delivery history, and
  catch-up after a pause cannot replay them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.