Skip to Content
AgentShield
API Reference

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

TypeWritten byWhen
authorization.decidedGatewayEvery recorded decision
tool.executedGatewayAn execution completed
tool.failedGatewayAn execution failed (timeout, rejected, adapter_error)
content.flaggedGatewayContent analysis flagged a result or arguments
agent.registered, agent.suspended, agent.resumed, agent.revokedControl planeAgent lifecycle
credential.rotatedControl planeKey rotation
approval.decidedControl planeApprove or reject
alert.acknowledged, alert.resolvedControl planeAlert triage
evidence.viewed, evidence.integrity_failedControl planeEvidence reads
member.*Control planeMembership and password changes

Read events

Owner, admin, auditor, and operator. Events are newest first; limit is 1–200 (default 50).

GET/api/v1/events

List redacted security events

Bearer sessionoperationId: listEvents

Owner, admin, auditor, and operator can list redacted events for their organization.

Parameters

  • limitquery · integer

    min 1 · max 200

  • cursorquery · string

Responses

  • 200EventPage

    Event 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

GET/api/v1/incidents

List security incidents

Bearer sessionoperationId: listIncidents

Owner, admin, and auditor sessions can list incidents for their organization.

Responses

  • 200IncidentPage

    Incident 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.

GET/api/v1/alerts

Content analysis alerts, newest first

Bearer sessionoperationId: listAlerts

Implemented for owner, admin, and auditor. Alerts are advice about calls that already ran.

Parameters

  • statusquery · string

    one of open, acknowledged, resolved

Responses

  • 200object

    Alerts

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.

PATCH/api/v1/alerts/{alertId}

Acknowledge or resolve an alert

Bearer sessionoperationId: changeAlert

Implemented for owner and admin. Forward only. Appends alert.acknowledged or alert.resolved. No decision changes.

Parameters

  • alertIdpath · string (uuid)required

Request body · required

  • statusstringrequired

    one of acknowledged, resolved

Responses

  • 200Alert

    Updated alert

  • 409ErrorBody

    Error

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.json

Examples 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.

POST/api/v1/audit/exports

Export the current audit head hash

Bearer sessionoperationId: exportAuditHead

Stores an external copy of the current organization head hash.

Request body · required

  • destinationstringrequired

    min length 1 · max length 256

Responses

  • 201AuditExport

    Stored 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.json

Examples are generated from the schema. Values are placeholders.

Evidence

GET/api/v1/evidence/{evidenceId}

Read one bundle after checking its SHA-256

Bearer sessionoperationId: readEvidence

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

  • 200object

    Verified bundle

  • 409ErrorBody

    Error

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:

PropertyValue
StreamAGENTSHIELD_EVENTS
Subjectagentshield.events.<organization id>.<event type>
DeduplicationNats-Msg-Id = event id; 10-minute window
Retention7 days
Message body
{
  "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?

On this page