Catalog PyPI
PACKAGE EXPLORERView in registry

agent-reliability-otel-labels

PyPI

Process-metadata labels for OpenTelemetry agent spans

Versions collected1
Direct dependencies4From release 0.1.0
Last observed20 Oct, 23:11 UTC

README

Version 0.1.0 documentation

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

AttributeOnAnswers
trustabl.step_indextool callsWhat order did this really happen in?
trustabl.run_idroot and tool callsWhich spans belong to one job?
trustabl.tool.input_fptool callsWas this the same call as before?
trustabl.tool.output_fptool callsDid the same input give the same result?
trustabl.tool.side_effecttool callspure, read, write or irreversible? Omitted when unknown.
trustabl.tool.error_classtool callsDid it actually work?
trustabl.tool.attempttool callsIs it retrying?
trustabl.handoff_idchild agent spanWhich agent delegated to which?
trustabl.exit_reasonroot, before it endsHow did the run end?
trustabl.policy.binding (event)agent / sandbox rootWhich 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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.05 Oct 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
trustabl/agent-reliability-otel-labels

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:11 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:00eaf14bfca47d772f32bb4a5d4a9e6a477bfd49f21d40672dd17af1ca81d980