agentlasso
Send your AI agent's production traces to AgentLasso: it learns what your agent actually does, shows what you're not testing, and turns real behavior into golden tests that run in CI.
No dependencies: standard library only. Python 3.9+.
pip install agentlasso
Send a trace
Set your project's API key (AgentLasso → Settings):
export AGENTLASSO_API_KEY="<your-project-api-key>"
Then, wherever your agent finishes handling a request:
import agentlasso
agentlasso.send_trace(
user_input="I want my money back for order 44182",
agent_output="Refund of $89.00 issued to your card, 3-5 business days.",
tool_calls=[
{"name": "orders.lookup", "arguments": {"order_id": "44182"}, "latency_ms": 210},
{"name": "stripe.refund", "arguments": {"charge_id": "ch_1P9", "amount": 8900}},
],
session_id="conv_8fa21",
model="claude-sonnet-5-5",
background=True, # don't make the user wait
)
One call per request your agent handled. Send tool_calls in the order the agent called them: trajectory checks, risk, money at stake and coverage are all built on them. arguments can be a dict or a JSON string (as OpenAI-style tool calls carry them).
| Argument | Meaning |
|---|---|
user_input |
What the user asked. Required. |
agent_output |
The agent's final reply. Needed for content checks and AI judge checks. |
tool_calls |
The tools the agent called, in order: name, optional arguments and latency_ms. |
session_id |
Groups the turns of one conversation. A random ID is used if omitted. |
model |
The model that produced the reply. |
input_tokens, output_tokens |
Token usage. |
background |
True: return immediately and send from a background thread (failures are logged, never raised). |
Background sending
With background=True, send_trace returns at once and a failure is logged to the agentlasso logger instead of raised, so a trace can never break your agent's reply. A normal Python exit waits for pending sends; in a short-lived process (a script, a serverless function), call agentlasso.flush() before returning.
Without it, send_trace waits and returns AgentLasso's response ({"accepted": 1, "traceIds": [...], ...}), or raises agentlasso.AgentLassoError (with .status, the HTTP status code).
Configuration
from agentlasso import Client
client = Client(
api_key="...", # default: AGENTLASSO_API_KEY
base_url="https://agentlasso.example.com/api/v1", # self-hosted; default: AGENTLASSO_BASE_URL, then agentlasso.dev
timeout=10.0,
)
client.send_trace(user_input="...", agent_output="...")
Already running OpenTelemetry? You don't need this package: point your OTLP/HTTP exporter at the same endpoint. See Send traces.
Links
Apache-2.0
Metadata
Release files for agentlasso 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentlasso-0.1.0.tar.gz | 14.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentlasso-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.9 kB
Release files / agentlasso-0.1.0.tar.gz
| Download URL | agentlasso-0.1.0.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fd084af87f9eb0ac84ec9d3f22cfd46b226923b17b1a1f69c94d9e52366d550
|
|
BLAKE2b-256 checksum How to use checksums |
90a019955bf2e84293e2664f83b351c2d4d98c28f96b0906970fec03272d07d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / agentlasso-0.1.0-py3-none-any.whl
| Download URL | agentlasso-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f41708658da87069c9455251d03002ce4cb1f4e78fc237c0c9de7225a8e35417
|
|
BLAKE2b-256 checksum How to use checksums |
df4ea9ecb98d5b38a314499c2705293d319a2c5c3c1230207e06bcc928bd4782
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|