Skip to main content
Every exporter receives the same three payloads, and the HTTP exporter and TypeScript reporter send them as JSON request bodies. The payloads are defined as JSON Schema (draft 2020-12) in schemas/exporter/, and the HTTP endpoints in schemas/openapi.yaml. tests/test_schemas.py checks the Python output against the schemas.

Payloads

Shared definitions (AgentProfile, FrameworkEvent, IntegrityScore, LayerResult, SessionSummary, TokenUsage, SessionUsage) live in common.json. The three top-level payloads reject unknown keys; the shared objects inside them accept extra fields.

Session start

Sent once per session, before its first event.
session_id is 32 lowercase hex characters, generated per adapter instance. adapter_name is the adapter’s name: claude, langchain, openai_agents, crewai, google_adk, autogen, agno, bedrock_agents, claude_code or codex in Python; claude, langchain, openai_agents, crewai, google_adk or vercel_ai in TypeScript. The profile requires agent_id, name, agent_type, capabilities, deployment_context and risk_tier. The HTTP exporter fills an empty framework with the adapter name before sending.

Event

Sent once per event, wrapping a FrameworkEvent.
The example shortens layer_results to one layer and trims its details; a real event lists every layer that ran.

Session end

Sent once, when the adapter is closed.

FrameworkEvent

string
required
Snake-case event name matching ^[a-z][a-z0-9_]*$. See Event types.
string
required
When the adapter emitted the event, ISO 8601 with UTC offset.
string
required
Name of the adapter that emitted it.
object
required
The event’s payload. For framework events this is the data the framework handed the adapter, so it can include prompts, tool arguments and tool output. On stop events it also carries usage, the session’s token usage so far.
IntegrityScore | null
The integrity score for evaluated events, otherwise null.
An IntegrityScore has composite (0 to 1), properties (one score per integrity property), layer_results and action in the schema. The Python library also sends timestamp, confidence, evaluator_version, total_latency_ms and passed. Each LayerResult has layer_name, score, passed, action, details and latency_ms. action is one of pass, alert, escalate or block; the score’s action is the most severe across its layers. How the scores are computed is covered in Scoring and actions.

Event types

The schema lists the known types in its examples. Python adapters emit them from src/agentegrity/adapters/base.py, and KNOWN_EVENT_TYPES in @agentegrity/client mirrors the list. Overflow events are sent once per channel per session. The channels are inputs, tool_calls, tool_outputs, subagents, peer_message, shared_memory_write, broadcast and task_started, so the event names are tool_outputs_overflow, broadcast_overflow and so on. After the cap, new entries for that channel are no longer buffered for evaluation; broadcast events also stop being emitted, while the other channels keep emitting their events. The OpenTelemetry exporter treats capture_failure, subagent_orphan and every overflow event as instrumentation-health events (see OpenTelemetry). The Bedrock adapter sends stop with reason: "stream_terminated_early" when a response stream ends before completing. Multi-agent events are explained in Multi-agent.

Forward compatibility

New releases add event types and fields. The schemas are written so older consumers keep working:
  • event_type accepts any snake_case name. Handle the types you know and accept the rest; do not reject an event because its type is new.
  • TokenUsage and SessionUsage allow fields that later releases add, and usage.sources accepts new values. Ignore what you do not recognize.
  • AgentProfile, IntegrityScore, LayerResult, FrameworkEvent, data and SessionSummary all allow additional properties.

Session summary

The summary in the session end payload is the adapter’s get_summary(), the same dict Python report() returns. chain_hash_linked shows the records are linked, which anyone holding the chain can recompute; it is not a signature check. chain_signatures is: Only trusted shows who produced the chain. agentegrity verify-decisions --trusted-key runs the same check on a saved chain.

Usage

usage on stop events and in the summary follows SessionUsage:
input_tokens always includes cached tokens, complete: false marks totals that are a lower bound, and the field is absent when nothing was recorded. The definitions are in Token usage.

HTTP API

schemas/openapi.yaml (OpenAPI 3.1) describes three endpoints, which a backend must implement to receive sessions: sessionId must match ^[0-9a-f]{32}$. Clients send Content-Type: application/json and, when configured with a token, Authorization: Bearer <token>. The default server in the file is http://localhost:8787. Because a backend may answer 404 for events on a session it has not seen, the Python HTTPExporter sends requests in order from a single worker thread. The agentegrity pro command additionally calls GET /ingest/verify, which Agentegrity Pro provides and the OpenAPI file does not describe.