Events
Read security events, incidents, alerts, audit links, and evidence over HTTP, follow the live stream, and subscribe to events on NATS JetStream.
AgentShield exposes its security record three ways: paged HTTP reads on the control plane, a server-sent event stream for live views, and a NATS JetStream stream for integrations.
Event types
| Type | Written by | When |
|---|---|---|
authorization.decided | Gateway | Every recorded decision |
tool.executed | Gateway | An execution completed |
tool.failed | Gateway | An execution failed (timeout, rejected, adapter_error) |
content.flagged | Gateway | Content analysis flagged a result or arguments |
agent.registered, agent.suspended, agent.resumed, agent.revoked | Control plane | Agent lifecycle |
credential.rotated | Control plane | Key rotation |
approval.decided | Control plane | Approve or reject |
alert.acknowledged, alert.resolved | Control plane | Alert triage |
evidence.viewed, evidence.integrity_failed | Control plane | Evidence reads |
member.* | Control plane | Membership and password changes |
Read events
Owner, admin, auditor, and operator. Events are newest first; limit is 1–200 (default 50).
/api/v1/eventsList redacted security events
Owner, admin, auditor, and operator can list redacted events for their organization.
Parameters
limitquery · integermin 1 · max 200
cursorquery · string
Responses
200EventPageEvent page
curl -X GET "http://127.0.0.1:8080/api/v1/events" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
Live stream
GET /api/v1/events/stream is a server-sent events endpoint for the same roles. It sends the latest page of 20 events immediately and then every five seconds. The dashboard's overview uses it and falls back to polling if the stream drops.
curl -N http://127.0.0.1:8080/api/v1/events/stream -H "Authorization: Bearer $TOKEN"data: {"items":[{"id":"…","event_type":"tool.executed","occurred_at":"…","payload_redacted":{…}}],"next_cursor":"…"}This route is served by the control plane in addition to the OpenAPI contract.
Incidents, alerts, and audit
/api/v1/incidentsList security incidents
Owner, admin, and auditor sessions can list incidents for their organization.
Responses
200IncidentPageIncident page
curl -X GET "http://127.0.0.1:8080/api/v1/incidents" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/alertsContent analysis alerts, newest first
Implemented for owner, admin, and auditor. Alerts are advice about calls that already ran.
Parameters
statusquery · stringone of
open,acknowledged,resolved
Responses
200objectAlerts
curl -X GET "http://127.0.0.1:8080/api/v1/alerts" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/alerts/{alertId}Acknowledge or resolve an alert
Implemented for owner and admin. Forward only. Appends alert.acknowledged or alert.resolved. No decision changes.
Parameters
alertIdpath · string (uuid)required
Request body · required
statusstringrequiredone of
acknowledged,resolved
Responses
200AlertUpdated alert
409ErrorBodyError
curl -X PATCH "http://127.0.0.1:8080/api/v1/alerts/$ALERT_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
Alert status moves forward only, through open, acknowledged, and resolved, never back. Owners and admins change it; each change is audited.
/api/v1/auditList hash-chain links for the caller's organization
Owner, admin, and auditor can list links. Operator cannot.
Responses
200AuditPageAudit page
curl -X GET "http://127.0.0.1:8080/api/v1/audit" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/audit/exportsExport the current audit head hash
Stores an external copy of the current organization head hash.
Request body · required
destinationstringrequiredmin length 1 · max length 256
Responses
201AuditExportStored export
curl -X POST "http://127.0.0.1:8080/api/v1/audit/exports" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
Evidence
/api/v1/evidence/{evidenceId}Read one bundle after checking its SHA-256
Implemented for owner, admin, and auditor. 409 evidence_integrity_failed when the stored object no longer matches its recorded hash. Every read appends evidence.viewed or evidence.integrity_failed. 503 when storage is not configured.
Parameters
evidenceIdpath · string (uuid)required
Responses
200objectVerified bundle
409ErrorBodyError
curl -X GET "http://127.0.0.1:8080/api/v1/evidence/$EVIDENCE_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
NATS JetStream
Every committed event is published by the event relay:
| Property | Value |
|---|---|
| Stream | AGENTSHIELD_EVENTS |
| Subject | agentshield.events.<organization id>.<event type> |
| Deduplication | Nats-Msg-Id = event id; 10-minute window |
| Retention | 7 days |
{
"id": "6d0c…",
"organization_id": "9a7e5d2c-…",
"agent_id": "3f2b8c1e-…",
"execution_id": "c4d6e8f0-…",
"event_type": "tool.executed",
"occurred_at": "2026-11-30T12:00:01.123456Z",
"payload": { "…": "redacted payload as stored" },
"audit_hash": "4be1…"
}Subscribe with a filter such as agentshield.events.<org>.tool.* or agentshield.events.*.content.flagged. See Event streaming for consumer setup.
Was this page helpful?