Skip to main content

Event schema

Alerts and Use Cases evaluate rules over metadata events stored in the NeuralTrust metadata store. TrustGuard and TrustGate each emit one metadata record per request over OpenTelemetry (OTLP); a collector ingests them into separate TrustGate and TrustGuard event streams.
No raw prompt or response text is in the metadata stream. Identifiers, verdicts, counters, and finding labels only. Raw bodies live in a separate store keyed by trace_id for drill-down in the UI.

Architecture

Correlation keys across streams: tenant_id, trace_id, session_id. Rules over TrustGuard read only the evaluations TrustGuard acted on. Shadow copies — a second evaluation of a request that is already recorded — are stored but never matched.

Rule fields

A rule field is a key a rule may use in match: or detection:. Every rule field is listed below, and every one is offered in the Use Cases field picker for the products it exists for. AlertEngine rejects any other key when a rule is saved, and a field used on a product it does not exist for. Aliases are older names that resolve to the same field, so stored rules keep working. The builder writes the canonical name.

Both products

TrustGate only

TrustGuard only


Entity and grouping

Entity is not a stored column. AlertEngine derives it from consumer_id, the reference for “who” triggered the event. A rule’s group_by can be app or any rule field of its product except the detection.* fields, which have no single value per event. A cross rule’s correlate_on can be any rule field both products have. The builder offers the keys in this table, and Application or Session for correlate_on. Each event also stores the client ip, for investigation. It is not a rule field: rules cannot match or group on it, so surge and anomaly rules group by session or consumer. Predefined nt-uc-111 (Unidentified Consumer Surge) groups by session.

Detection matching (TrustGuard)

Rules with a detection: block match over the raw detector_chain JSON array. AlertEngine normalizes each element at query time (not as a stored column). TrustGuard writes elements in two shapes: a flat one that carries detection_type and action directly, and a nested one with source.plugin, signal, and outcome. Each field reads the flat key first.

Rule detection fields

Plugin → type mapping (nested chain)

When the flat detection_type field is empty, type is derived from source.plugin:

Finding guard

An element counts as a finding only when it carries a detection_type, an action or outcome.action, or a signal.type. Elements that only record that a detector ran on a clean request do not count, and neither does a detector that failed to run (not_executed): those are matched by the coverage.* fields instead.

Stored fields that are not rule fields

These are part of each stored event, for Activity, investigation, and analytics, but rules cannot match them.

TrustGate

TrustGuard


Raw record fields shown in Activity

The raw store also keeps a few short fields derived from the body, so Activity can show them without loading every payload. Like the bodies, they never reach the metadata stream. On hybrid deployments the bodies stay in your data plane, so there is no preview and Activity hides the Request column.

What the builder does not create

Every rule field is in the builder. What it does not create are some rule shapes, which predefined use cases use:
  • aggregate rules over a metric — ratio, p95, p90, avg, sum — and new count_distinct rules. A count_distinct rule is kept when copied or edited.
  • A windowed rule with a threshold of 1, which raises one alert per window. In the builder, a threshold of 1 is a per-event rule.
  • group_by on a key other than the four the builder offers.
  • Rules over the console audit log (stream: audit).
See Rule kinds.

Upstream requirements

For rules to match reliably, products must emit:

Use Cases

Custom rule builder and full UI field catalog.

TrustGuard overview

Guardrail detections that populate TrustGuard events.