Skip to content

Tracing quickstart

Send one run through the AI Gateway or install agent hooks, then verify the trace and the guard decision in Provon.

Both paths can block in real time. For passive evidence from existing instrumentation or historical sessions, see OpenTelemetry and Agent transcripts.

Prerequisites#

  • A running Provon deployment.
  • A project API key with the default capabilities: telemetry:ingest, telemetry:read, and guardrails:evaluate.
  • For the Gateway path: a provider key and at least one model binding in Providers.
  • For the hooks path: the provon CLI and Claude Code, Codex, Cursor, OpenCode, dsh, or Pi installed locally.
bash
export PROVON_API_KEY="your_project_api_key"

Send a trace#

Point an OpenAI-compatible client at the Gateway origin and add a stable conversation header:

bash
export PROVON_GATEWAY_URL="https://<your-provon-gateway-origin>/v1"

curl "$PROVON_GATEWAY_URL/chat/completions" \
  -H "Authorization: Bearer $PROVON_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-otel-gen-ai-conversation-id: quickstart-gateway-1" \
  -d '{
    "model": "openai/gpt-5-mini",
    "messages": [{ "role": "user", "content": "Refund order 123 and explain the policy." }]
  }'

Replace the model with one enabled for your provider. The Gateway records the request, response, provider attempt, latency, tokens, errors, and guardrail decisions according to the project's trace-capture settings.

Guardrail outcomes appear only on calls actually proxied through the Gateway. See the Gateway quickstart for provider setup and enforcement modes.

Verify the evidence#

Open Traces and find the run you just created.

Verify:

  • the trace has a stable conversation identifier;
  • model and tool spans appear in causal order;
  • token, cost, latency, status, and error fields appear when the source emitted them;
  • for hooks, a provon.guard.tool_call span records the decision, mode, rule, and bounded reason.

Note

A trace is evidence that the run was captured, not proof that the task succeeded. A healthy trace may legitimately produce no Finding.

Inspect it from the CLI#

CLI authentication reads the same project key:

bash
provon auth token set --api-key "$PROVON_API_KEY"

Search and summarize the trace:

bash
provon traces search "<trace-id>" --search-type trace-id --range 1h
provon traces summarize "<trace-id>"

traces summarize reports telemetry facts such as duration, spans, errors, tokens, cost, and slow operations. It does not run diagnostic Rules or create Findings.

Diagnose the same evidence with the CLI#

Export a trace bundle, then diagnose it locally without uploading or persisting a Finding:

bash
provon traces export "<trace-id>" --out ./quickstart-trace
provon diagnose ./quickstart-trace --mode rule-signals

The healthy example should normally produce no Finding. That is a successful result: traces are evidence, while Findings are supported problems. See Trace diagnosis with CLI.

Limitations#

  • Gateway capture only sees traffic that crosses the Gateway; tool execution outside that boundary needs hooks or application instrumentation.
  • Hook capture only sees local sessions where the hook is installed and trusted.
  • provon traces summarize is a read summary; diagnosis and Finding publication require Rules and a recorded conversation settled long enough to run.
  • Advanced OTLP and transcript ingest add evidence but cannot block a model call or a tool call.