Skip to main content

agent-reliability-otel-labels (Python)

Process-metadata labels for OpenTelemetry agent spans.

This library adds about nine attributes and one event type to spans that your agent already emits. It answers questions a trace cannot otherwise answer: was this the same call as before, was this a retry, does this tool destroy something, and which signed policies were actually in force.

No API key, no account, no Trustabl service.

The one prerequisite

Your agent must already be instrumented. This library decorates spans; it never creates them. LangChain's instrumentation, OpenLIT, Traceloop, OpenInference or a framework's native gen_ai support all qualify.

Install

pip install agent-reliability-otel-labels

Python 3.9 or newer. It depends on opentelemetry-api and rfc8785, not on the OpenTelemetry SDK.

Use

from agent_reliability_otel_labels import Binding, Run, bind_authority, mark_run_end, mark_tool_span

run = Run()

with tracer.start_as_current_span("invoke_agent") as root:
    run.mark_start(root)
    bind_authority(root, bindings=[
        Binding(id="openshell-seccomp-v3", type="sandbox", sha256=...,
                version="3.1.0", required=True, source="entrypoint"),
    ])

    with tracer.start_as_current_span("execute_tool") as span:
        result = search_flights(args)
        mark_tool_span(span, args=args, result=result, attempt=1,
                       side_effect="read", step_index=run.next_step(),
                       run_id=run.run_id)

    # Call before the root span ends; an ended span drops the write.
    mark_run_end(root, exit_reason="final_answer")

Arguments and results are fingerprinted, never stored: the span carries a 16-character hash, not what the caller asked for. No usable span is a silent no-op, so a workload with tracing disabled is unaffected.

What it writes

Attribute On Answers
trustabl.step_index tool calls What order did this really happen in?
trustabl.run_id root and tool calls Which spans belong to one job?
trustabl.tool.input_fp tool calls Was this the same call as before?
trustabl.tool.output_fp tool calls Did the same input give the same result?
trustabl.tool.side_effect tool calls pure, read, write or irreversible? Omitted when unknown.
trustabl.tool.error_class tool calls Did it actually work?
trustabl.tool.attempt tool calls Is it retrying?
trustabl.handoff_id child agent span Which agent delegated to which?
trustabl.exit_reason root, before it ends How did the run end?
trustabl.policy.binding (event) agent / sandbox root Which signed policies were loaded?

More

The full documentation, the TypeScript and Go bindings, and a runnable example (python/examples/agent.py) are in the repository: https://github.com/trustabl/agent-reliability-otel-labels

License

Apache-2.0. See LICENSE.

Metadata

Release files for agent-reliability-otel-labels 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-reliability-otel-labels 0.1.0
File Size Uploaded
agent_reliability_otel_labels-0.1.0.tar.gz 20.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-reliability-otel-labels 0.1.0
File Interpreter ABI Platform
agent_reliability_otel_labels-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.5 kB

Release files / agent_reliability_otel_labels-0.1.0.tar.gz

Download URL agent_reliability_otel_labels-0.1.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b0fc1505e8a8771b601c4f4dc38c48328e75f05d87800ff6b626be71d5e3bc79
BLAKE2b-256 checksum
How to use checksums
967db5a2d3b4d61564a2eeb7e1dddf034100d25ad161f23ac53ca791424bc2ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / agent_reliability_otel_labels-0.1.0-py3-none-any.whl

Download URL agent_reliability_otel_labels-0.1.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad23811d613df01c6443355ae3b07b88d548a8bf82ed3f975f3bfe0168d92f1b
BLAKE2b-256 checksum
How to use checksums
c67c49a4a57aa367fee37a95f90e6d3614c8414f2aab5afc5ce530a405a5c114
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page