Skip to content

Report export snapshot schema

agentsight report export -o snapshot.json writes a JSON snapshot of the materialized view. The same shape is returned by GET /api/v1/snapshot. This document describes schema version 1.

Compatibility

Consumers should check schema_version before reading the rest of the snapshot and reject versions they do not support. New fields may be added to an existing version, so consumers should ignore unknown fields. Removing or renaming a field, changing its JSON type, or changing its meaning incompatibly requires a schema-version bump.

Every field listed below is emitted. A nullable field is emitted as null when AgentSight does not have a value; arrays are emitted as empty arrays. generated_at is an RFC 3339 UTC timestamp.

Top-level fieldTypeMay contain captured content?Meaning
schema_versionintegerNoSnapshot schema version; currently 1.
generated_atstringNoTime at which AgentSight generated the export.
summaryobjectNoAggregate counts and the covered time range.
token_summaryarrayMetadataToken totals grouped by model.
network_targetsarrayYesObserved network destinations and request paths.
process_nodesarrayYesObserved process metadata and command lines.
audit_eventsarrayYesBounded event history; see summary.audit_limit.
resource_samplesarrayMetadataProcess CPU and memory samples.
sessionsarrayYesAgent-session summaries and source attributes.
tool_callsarrayYesObserved tool calls, including inputs and outputs when available.

The export does not include the full llm_calls or token-usage row sets. Their totals are available through summary and token_summary.

summary

FieldTypeNullableMeaning
sourcestringNoView source, such as materialized_view or agent_native_session.
view_eventsintegerNoTotal materialized rows counted by the view.
llm_callsintegerNoNumber of observed LLM calls.
token_usage_rowsintegerNoNumber of token-usage rows used for aggregation.
audit_eventsintegerNoTotal audit-event count before export limiting.
sessionsintegerNoNumber of observed sessions.
input_tokensintegerNoAggregated input tokens.
output_tokensintegerNoAggregated output tokens.
total_tokensintegerNoAggregated total tokens.
start_timestamp_msintegerYesEarliest covered Unix timestamp in milliseconds.
end_timestamp_msintegerYesLatest covered Unix timestamp in milliseconds.
audit_limitintegerNoMaximum number of recent audit rows included in audit_events.

token_summary[]

FieldTypeNullableMay contain captured content?
groupstringNoModel or grouping identifier; metadata only.
input_tokensintegerNoNo.
output_tokensintegerNoNo.
cache_creation_tokensintegerNoNo.
cache_read_tokensintegerNoNo.
total_tokensintegerNoNo.
callsintegerNoNo.
sessionsintegerNoNo.

network_targets[]

FieldTypeNullableMay contain captured content?
pidintegerYesNo.
commstringYesProcess metadata.
hoststringNoYes; observed destination host.
pathstringYesYes. Raw observed request path; not generally normalized or redacted.
countintegerNoNo.
error_countintegerNoNo.
first_timestamp_msintegerYesNo.
last_timestamp_msintegerYesNo.

process_nodes[]

FieldTypeNullableMay contain captured content?
idstringNoIdentifier metadata.
pidintegerNoNo.
ppidintegerYesNo.
root_pidintegerYesNo.
start_timestamp_msintegerYesNo.
end_timestamp_msintegerYesNo.
commstringYesProcess metadata.
commandstringYesYes; may contain the executable or command text.
argvarray of stringsNoYes; may include user data, paths, tokens, or secrets.
cwdstringYesYes; may expose user names and filesystem layout.
exit_codeintegerYesNo.
statusstringYesNo.
view_sourcestringNoNo.
confidencenumberYesNo.

audit_events[]

FieldTypeNullableMay contain captured content?
idstringNoIdentifier metadata.
timestamp_msintegerNoNo.
audit_typestringNoNo.
pidintegerYesNo.
commstringYesProcess metadata.
subjectstringYesYes; source-dependent subject.
actionstringYesUsually categorical metadata.
targetstringYesYes; commonly a file, process, or network target.
statusstringYesUsually categorical metadata.
summarystringYesYes; source-derived event summary.
detailsany JSON valueNoYes; arbitrary source event details.
view_sourcestringNoNo; identifies captured, reconstructed, agent-native, or legacy-unknown provenance.
confidencenumberYesNo; source-specific confidence in the row correlation or reconstruction.

view_source describes the lineage of each row, not the identity of the logical operation. Its values are view for rows emitted directly from captured events, sqlite for rows reconstructed from normalized persisted rows, agent_native_session for rows parsed from native session files, and unknown for legacy or otherwise unclassified evidence. One logical LLM call can therefore have a directly captured call row and a reconstructed request row with different sources. confidence is likewise row-specific: captured LLM rows reflect request/response correlation confidence, other captured event types carry canonical-event confidence, and reconstructed rows reflect extraction and lineage confidence. It must not be compared across sources as a global probability.

resource_samples[]

FieldTypeNullableMay contain captured content?
timestamp_msintegerNoNo.
pidintegerYesNo.
commstringYesProcess metadata.
cpu_percentnumberYesNo.
rss_mbintegerYesNo.

sessions[]

FieldTypeNullableMay contain captured content?
idstringNoSession identifier metadata.
agent_typestringNoNo.
start_timestamp_msintegerNoNo.
end_timestamp_msintegerYesNo.
statusstringNoNo.
modelstringYesModel identifier metadata.
input_tokensintegerNoNo.
output_tokensintegerNoNo.
total_tokensintegerNoNo.
view_sourcestringNoNo.
confidencenumberYesNo.
attributesany JSON valueNoYes; arbitrary source-specific session attributes.

tool_calls[]

FieldTypeNullableMay contain captured content?
idstringNoIdentifier metadata.
session_idstringYesSession identifier metadata.
conversation_idstringYesConversation identifier metadata.
timestamp_msintegerNoNo.
tool_namestringYesTool-name metadata.
tool_call_idstringYesTool-call identifier metadata.
start_timestamp_msintegerYesNo.
end_timestamp_msintegerYesNo.
duration_msintegerYesNo.
statusstringYesUsually categorical metadata.
inputany JSON valueNoYes; captured tool arguments or request content.
outputany JSON valueNoYes; captured tool results or response content.
related_pidintegerYesNo.
related_event_idstringYesIdentifier metadata.
view_sourcestringNoNo.
confidencenumberYesNo.

Handling exported snapshots safely

Snapshots are observability artifacts, not sanitized reports. Treat them as sensitive by default and do not publish them without review. In particular:

  • redact or remove request paths, command lines, working directories, audit targets/details, session attributes, and tool inputs/outputs;
  • review identifiers and destination hosts when they could expose tenant, project, repository, or account names;
  • store only the fields needed by the downstream consumer and apply its normal retention and access controls.

The sample in docs/sample-snapshot.json is an example payload, not an additional compatibility contract. It predates the additive audit provenance fields, so consumers should treat missing audit view_source and confidence values as unknown and null, respectively.