Skip to main content

List Agent Observations

Returns paginated agent operations for a project. Each row is one generation, tool call, retrieval, agent step, or session-scoped operation.

Query Parameters

Response


Get Agent Observation

Returns the full record for one observation including structured inputs, outputs, tags, and propagated attributes.

Response

Audit telemetry completeness

Returns content-free coverage counters for trace linkage, generation inputs, system prompts, completed outputs, model/provider attribution, token usage, and cost. The privacy_posture object reports privacy-mode coverage plus the count and percentage of content-bearing, reasoning-bearing, and tool-payload-bearing observations. It never returns the captured content. Use this endpoint as an instrumentation and privacy-policy release gate without exporting prompts, responses, reasoning, or tool payloads. The default window is the last 24 hours. Windows are capped at 31 days and can be filtered by agent_id, workflow_id, model, provider, release, or environment. Pass include_missing_examples=true to return up to 20 observation IDs for each incomplete field without returning prompt or response content.
Each field under coverage includes captured, eligible, missing, and percent. Output, token, and cost coverage use successful generations as the denominator. Generation input, model, and provider coverage use all generations. System-prompt coverage uses chat/system-capable generations, so prompt-only requests are not incorrectly reported as missing a separate system message. For CI and release gates, --fail-under <percent> exits non-zero when any applicable coverage dimension falls below the threshold. It also rejects invalid token totals and, by default, an empty window. Add --min-observations <count> to require enough live evidence before a release can pass. The JSON report is printed before the failure so CI artifacts retain the exact coverage and denominators. Use --min-scored-observations and --min-scores to require enough human-feedback or evaluation evidence for an engagement, experiment, or training-data workflow. Use --require-privacy-mode to require every observation in the selected window to declare privacy mode. Use --max-content-bearing-percent <percent> to bound the percentage of observations whose stored payload shape indicates prompt, response, reasoning, message, or tool content. The posture report is a metadata-only policy signal: it checks content presence and known privacy-mode attributes, not the meaning of captured text.

Export an evaluation or training dataset

Returns a deterministic, paginated set of completed generations with their full structured input, output, cost, token usage, and current scores. Use it to build offline evaluation sets, supervised fine-tuning examples, or preference/RL datasets without scraping the dashboard. This endpoint handles raw prompt and model-output content. API keys need the explicit ai:export scope or *; read, write, and errors:read do not grant access. MCP intentionally does not expose this bulk operation. Identifiers and arbitrary metadata are opt-in so a normal training export does not accidentally carry customer identity or unrelated telemetry. When enabled, each score includes its own metadata.attributes and metadata.tags, preserving feedback reasons, experiment assignments, evaluator context, and other training signals. Prompt and output content is never reconstructed: privacy-mode or upstream-redacted fields remain absent/redacted in the export.

Common Workflows

  • Find all expensive generations by filtering observation_type=generation and sorting by cost_usd in your client.
  • Search prompt text, tool payloads, or model output by passing q with a phrase from input_json or output_json.
  • Debug one agent run by filtering trace_id or session_id.
  • Investigate a user’s failures by filtering user_id and status=error.
  • Isolate tool performance by filtering observation_type=tool_call or tool_name.
  • Export positively scored generations with agent-observations export for an eval, SFT, or preference dataset.
  • Gate instrumentation releases with agent-observations quality and compare coverage by agent, workflow, release, environment, model, or provider. Add --include-missing-examples to jump directly from a failed coverage gate to the incomplete observations, then enforce the release with --fail-under 100 --min-observations <expected-volume>.

Agent handoff

Use this API when an assistant needs row-level AI workflow evidence:
For terminal workflows, use squasher agent-observations .... For MCP, call search("agentObservations"), inspect the schema, then execute the exact request. Squasher’s AI dashboard also uses these project-scoped endpoints:
  • GET /v1/projects/{project_id}/ai/stats for summary metrics, top models, top providers, sessions, and users
  • GET /v1/projects/{project_id}/ai/histogram for daily request/cost/latency/token charts
  • GET /v1/projects/{project_id}/ai/sessions/{session_id} for session drill-down
  • GET /v1/projects/{project_id}/ai/users/{user_id} for user drill-down; accepts optional from and to ISO timestamp query parameters to keep high-volume users windowed
  • GET /v1/projects/{project_id}/ai/fixes/stats for hosted fixer dispatch counts by source, requester, status, and webhook delivery
  • GET /v1/projects/{project_id}/ai/fixes/timeline for hosted fixer dispatch and completion counts over time
These endpoints are designed for dashboards and product analytics. The observation list/detail endpoints above remain the source of truth for row-level inspection.