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.

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.

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.

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.

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,  "classifiedTraces": [{ "trace_id": "...", "clustered_intent": "process_refund" }]}

The body is a superset of OTLP's export response, so strict OpenTelemetry exporters accept it. 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; nothing stored.
400Not JSON, or neither payload shape. The error says which fields are expected.
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.