Send traces

AgentLasso learns what your agent does from its production traces: one record per request your agent handled. Send them as a flat JSON object (no SDK needed) or as standard OpenTelemetry. Both go to the same endpoint and are stored the same way.

No live integration yet? You can import traces from a file instead, once or on a regular schedule: see Imports instead of a live integration.

POST https://agentlasso.dev/api/v1/telemetryx-api-key: <your-project-api-key>

Your project's API key is in Settings. Authorization: Bearer <key> works too, for OpenTelemetry exporters configured for bearer auth.

Simple JSON

The fastest path, and the right one for most agents that don't already run an OpenTelemetry pipeline:

sh
curl -X POST "https://agentlasso.dev/api/v1/telemetry" \  -H "x-api-key: <your-project-api-key>" \  -H "Content-Type: application/json" \  -d '{    "session_id": "conv_8fa21",    "user_input": "I want my money back for order 44182",    "agent_output": "Refund of $89.00 issued to your card, 3-5 business days.",    "model": "claude-sonnet-5-5",    "tool_calls": [      { "name": "orders.lookup", "arguments": { "order_id": "44182" }, "latency_ms": 210 },      { "name": "stripe.refund", "arguments": { "charge_id": "ch_1P9", "amount": 8900 }, "latency_ms": 640 }    ],    "input_tokens": 412,    "output_tokens": 58  }'
FieldRequiredMeaning
user_inputyesWhat the user asked.
agent_outputnoThe agent's final reply. Needed for content checks and AI judge checks.
tool_callsnoThe tools the agent called, in order: name, optional arguments (object) and latency_ms. Trajectory checks, tool-matching classification, risk, money at stake and coverage are all built on these, so send them whenever your agent uses tools.
session_idnoGroups turns of one conversation. A random ID is generated if omitted.
modelnoThe model that produced the reply.
input_tokens, output_tokensnoToken usage.
timestampnoWhen it happened: ISO 8601 (2026-10-01T08:30:00Z) or Unix time in seconds or milliseconds. Only for importing history; live traffic is stamped on arrival.
outcomenoWhat happened: resolved, escalated or failed. When given, it decides whether the request counts as a success on the scorecard; otherwise success is inferred from what classification flags.

Send one object per request your agent handled, from wherever it finishes a request. Don't block the user's response on it: fire it and log failures.

Import history

The easiest way is in the app: Production Sync → Import traces. Drop in a JSON Lines, JSON, CSV or OpenTelemetry export, match its columns (user message, reply, tools, time, and optionally an outcome), check the preview and import. A summary shows, before and after the import: how many traces were received, imported, skipped (and why) and rejected; the date range; how many have a reply, tool calls, a time and an outcome; how many had personal data redacted; columns and values that weren't used; and whether it's enough for coverage analysis (a few hundred traces over a week or more, most with tool calls). Up to 5,000 traces per import on the free plan; paid plans import up to their monthly allowance.

Before importing, turn on Settings → Semantic grouping so Discovery groups the imported traffic by what users asked for, not only by the tools called (see Quickstart).

After the import, traces are classified in the background. A large import goes through Anthropic's batch queue, usually done within minutes and at most a few hours. Production Sync, Discovery and the Dashboard show progress ("320 of 1,000 traces classified") and refresh when it's done. Progress moves along while the app is open, with new traffic, or with the optional scheduled job. Discovery stays empty until traces are classified.

To script it instead, send up to 500 traces per request as { "traces": [...] }, each with its timestamp:

sh
curl -X POST "https://agentlasso.dev/api/v1/telemetry" \  -H "x-api-key: <your-project-api-key>" \  -H "Content-Type: application/json" \  -d '{    "traces": [      { "user_input": "Where is order 44907?", "agent_output": "It is out for delivery.", "tool_calls": [{ "name": "shippo.track" }], "timestamp": "2026-09-28T14:05:00Z" },      { "user_input": "Cancel my plan", "tool_calls": [{ "name": "stripe.subscription.cancel" }], "timestamp": 1790000000 }    ]  }'

Or from Python, with a list of dicts or a file (JSON Lines, a JSON array, or { "traces": [...] }):

sh
pip install agentlassoexport AGENTLASSO_API_KEY="<your-project-api-key>"agentlasso import traces.jsonl            # add --dry-run to check the file first
python
import agentlassoagentlasso.send_traces(rows)  # each row: user_input, agent_output, tool_calls, ..., timestamp
  • Each trace keeps its date, so the scorecard's 30-day numbers, trends and drift are right from the start. Without timestamp, a trace counts as today.
  • Traces older than 90 days are skipped (counted as skippedTooOld in the response): nothing in AgentLasso looks back further. A timestamp in the future counts as now.
  • A batch is all or nothing: if any entry has no user_input, nothing is stored and the error names the entry (traces[12]).
  • After an import, traces are classified in the background; behavior no capability covers yet shows up in Discovery. A large import uses the cheaper batch path for the AI step.
  • Importing the same traces twice stores them twice. Imports don't check for traces already stored, so overlapping files double-count traffic. Export each period once; see below.

Imports instead of a live integration

You don't have to wire AgentLasso into your agent. Importing exports works for trying it on your real history, for a pilot, or as your regular workflow. Everything works on imported traces exactly as on live ones: classification, Discovery, the Semantic Agent Map and scorecards, the Coverage plan, Dataset Studio (Add as test on real requests and failures) and CI runs.

What's different:

  • The numbers are a snapshot. The map, scorecards, drift and the Coverage plan reflect your traces up to your last import. Nothing changes between imports, so a regression in production shows up only after the next one.
  • Only the last 90 days count. Older traces are skipped on import. Import at least every few weeks, or the 30-day numbers empty out.
  • Avoid overlapping files. Imports don't recognize traces already stored, so importing the same requests twice counts them twice (traffic, paths, failures). Export non-overlapping periods, for example last Monday to Sunday, every Monday.
  • Each trace needs its time. Map your export's time column (or send timestamp), so traces land on the days they happened. Without it, a whole import counts as today and skews 30-day numbers and trends.

A weekly routine:

  1. Export last week's traces (Monday to Sunday) from your logs or observability tool, with the user's message, the agent's reply, the tools it called and the time.
  2. Production Sync → Import traces, or agentlasso import last-week.jsonl in a scheduled job.
  3. Check Discovery for new behavior, then the Coverage plan for what to test next.

When you're ready for live numbers, add the POST (or point your OpenTelemetry exporter) at the same endpoint. Stop importing the periods the live feed covers, so nothing is counted twice.

OpenTelemetry

If your agent already emits OpenTelemetry traces, point your exporter at the same endpoint. The payload is detected automatically ({ "resourceSpans": [...] }, OTLP/HTTP JSON):

sh
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://agentlasso.dev/api/v1/telemetry"export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<your-project-api-key>"

AgentLasso reads the GenAI semantic conventions:

  • one trace per GenAI chat/generation span (gen_ai.operation.name, gen_ai.request.model / gen_ai.response.model, or gen_ai.prompt / gen_ai.completion);
  • tool-call spans (gen_ai.tool.name, gen_ai.tool.call.arguments) become that trace's tool calls;
  • gen_ai.conversation.id or session.id as the session; gen_ai.usage.* as token counts;
  • the span's start time as the trace's time, so exported history keeps its dates (the same 90-day limit applies).

A payload with no GenAI spans is accepted with 202 and accepted: 0, plus a note saying what was looked for.

Already sending to LangSmith, Langfuse or Datadog? Keep it, and dual-export: see Send traces you already have.

Response

json
{  "partialSuccess": {},  "accepted": 1,  "traceIds": ["..."],  "skippedSpanCount": 0,  "skippedTooOld": 0,  "classifiedTraces": [{ "trace_id": "...", "clustered_intent": "process_refund" }]}

The body is a superset of OTLP's export response, so strict OpenTelemetry exporters accept it. skippedTooOld appears when traces older than 90 days were skipped. classifiedTraces appears while a new project's first traces are classified as they arrive (see Capabilities and classification).

StatusMeaning
200Stored.
202Valid OTLP but no GenAI spans found, or every trace was older than 90 days; nothing stored.
413More than 500 traces in one { "traces": [...] } request; split it.
400Not JSON, neither payload shape, or a batch entry without user_input. The error says what's wrong.
401Missing or invalid API key.
500Storage failed; safe to retry.

Personal data is redacted before storage

By default, before anything is stored, AgentLasso replaces personal data in the user input, the agent's reply and tool-call arguments:

  • emails → [REDACTED_EMAIL]
  • US social security numbers → [REDACTED_SSN]
  • phone numbers → [REDACTED_PHONE]
  • card numbers (only numbers that pass the Luhn check) → [REDACTED_CARD]

Turn it off per project in Settings → Data controls only if you need the raw content.

Next

Traces become capabilities, each with a scorecard.