jq. These recipes turn Failproof AI Observability’s data into something a terminal user or an AI coding agent (Claude Code, Cursor) can query and automate, without clicking through the dashboard.
The patterns below are copy-paste ready for the Failproof AI Observability CLI (agenteye). For installation, authentication, and the full option list see CLI; run agenteye -h or agenteye <command> -h for the built-in help.
Golden rules
- Global options go before the command.
agenteye --json sessionsis correct;agenteye sessions --jsonis not. The globals are--json,--base-url,--org,--token,--insecure/--secure,--timeout,--quiet,--no-color. - Pass
--jsonwhenever you parse output. Data goes to stdout as JSON; human status and errors go to stderr, so stdout stays clean to pipe intojq. - Branch on the exit code, not on stderr text:
0ok ·1unexpected error ·2bad arguments ·3cannot reach the dashboard ·4not logged in or expired ·5missing permission ·6resource not found. - Discover with
-h. Every command documents its filters, value formats, and JSON shape.
One-time setup
Confirm auth before doing work
whoami never errors on a missing or expired session; it reports logged_in:false instead, so an agent can probe auth state safely. (It can still exit non-zero if no base URL is set or the dashboard is unreachable.)
Find failing or low-scoring sessions
evals, not sessions. --score KEY:MIN..MAX is repeatable and AND-combined; either bound is optional (..0.5 means ≤ 0.5, 0.9.. means ≥ 0.9). You can pass up to 20 score filters per request; more returns HTTP 400. sessions shares the --env, --status, --agent-id, --session-id, and time-range filters with evals, but has no --score.
Read one session end-to-end
There is no singlesession show command. Combine the event trail with the session’s evaluation:
Note: By default,eventsreads a fast, payload-free feed. Each event carries a server-computed one-linesummaryplus flags likeis_errorand token counts, butpayloadcomes back as{}. To pull the raw payload, add--full(or--fields payload). The full feed is slower at scale, so keep it bounded: pair--fullwith a single--session-id.
Fetch everything (pagination)
Results are newest-first and cursor-paginated.Slim the output with —fields
Restrict the keys (in both the table and--json) to reduce what an agent must read.
2) with the valid list, a cheap way to discover field names.
Discover valid filter values
Pick your org (multi-tenant)
If you belong to more than one org, choose the active tenant at login (it’s saved):--org exits non-zero and prints the orgs to choose from.
Provision an API key for the SDK/collector
Run a saved or ad-hoc query
Triage an incident non-interactively
Note: Mutations auto-skip their confirmation prompt under--jsonor when stdin isn’t a TTY, so agents never hang; pass--yes/-yto skip it explicitly elsewhere.
Exit-code handling in a script
JSON output shapes
- Each event item (
events):id, session_id, agent_id, event_type, ts, payload, environment, summary, is_error, error_type, output_tokens, context_window, context_fill. Note thatpayloadis{}unless you request the full feed with--full(or--fields payload). - Each evaluation item (
evals):id, session_id, agent_id, environment, status, scores, reasoning, summary, error, attempt_count, duration_ms, completed_at, created_at. - Each session item (
sessions):session_id, agent_id, environment, status, scores, event_count, started_at, last_event_at, first_event_id, last_event_id, latest_evaluation.
--fields accepts exactly its own item’s field names. The set differs between sessions and evals, so a name valid for one may be rejected by the other.
Next steps
- CLI: installation, authentication, and the full option reference for every command.
- CLI agent skill: package these recipes as a skill your coding agent can load.
- API keys: create and scope the keys the CLI, SDK, and collector authenticate with.
- Python SDK: send events into Failproof AI Observability so there is data for these recipes to query.

