Skip to main content

Metrics API

Analytics endpoints for dashboard visualizations and monitoring.

All metrics endpoints require JWT Bearer Token authentication.


Run statistics

GET /v1/metrics/runs

Get aggregate run statistics for a date range.

ParameterTypeDescription
fromISO dateStart date
toISO dateEnd date
curl "http://localhost:3000/v1/metrics/runs?from=2026-03-01&to=2026-03-19" \
-H "Authorization: Bearer $TOKEN"

Risk distribution

GET /v1/metrics/risk

Get risk severity breakdown.

ParameterTypeDescription
fromISO dateStart date
toISO dateEnd date

Approval statistics

GET /v1/metrics/approvals

Get approval metrics (pending, approved, rejected counts and response times).


Top tools

GET /v1/metrics/tools

Get the most-used tools ranked by call count.

ParameterTypeDescription
fromISO dateStart date
toISO dateEnd date
limitnumberMax results

Runs timeseries

GET /v1/metrics/timeseries

Get completed vs failed runs over time.

ParameterTypeDescription
daysnumberNumber of days to look back (default: 30)

Action metrics

GET /v1/metrics/actions

Get action control metrics with recent actions.

ParameterTypeDescription
daysnumberLookback period

Action timeline

GET /v1/metrics/actions/timeline

Actions over time.


Action coverage

GET /v1/metrics/actions/coverage

Policy coverage analysis — which action types have policies and which don't.


Agent metrics

GET /v1/metrics/agents

Metrics grouped by agent (runs, tool calls, risk events per agent).


Agent detail

GET /v1/metrics/agents/:agentId

Detailed metrics for a specific agent.


Dashboard insights

GET /v1/metrics/insights

Contextual insights for the dashboard (e.g., "18 db_migrate actions have no policy").