Skip to main content

OpenInference Agent Spec Instrumentation

Python auto-instrumentation library for Agent Spec.

Open Agent Spec (Agent Spec) is a portable, platform-agnostic configuration language that allows Agents and Agentic Systems to be described with high fidelity. It defines the conceptual building blocks—called components—that make up agents in typical agent-based systems. This includes the properties that configure each component and the semantics that govern their behavior.

Agent Spec Tracing is an extension of Agent Spec that standardizes how agent and flow executions emit traces. It enables:

  • Runtime adapters to emit consistent traces across different frameworks.
  • Consumers (observability backends, UIs, developer tooling) to ingest one standardized format regardless of the producer.

You can find more information about Agent Spec and Agent Spec Tracing at:

The traces emitted by this instrumentation are fully OpenTelemetry compatible and can be sent to an OpenTelemetry collector for viewing, such as Arize Phoenix or Arize AX.

Installation

pip install openinference-instrumentation-agentspec

Quickstart

In this example we will instrument a small program that uses Agent Spec Tracing and observe the traces via arize-phoenix.

Install packages.

pip install openinference-instrumentation-agentspec pyagentspec[langgraph] arize-phoenix opentelemetry-sdk opentelemetry-exporter-otlp

Start the phoenix server so that it is ready to collect traces. The Phoenix server runs entirely on your machine and does not send data over the internet.

phoenix serve

In a python file (e.g., agentspec_agent.py) , set up the AgentSpecInstrumentor and configure the tracer to send traces to Phoenix.

from pyagentspec.adapters.langgraph import AgentSpecLoader
from pyagentspec.agent import Agent
from pyagentspec.llms import OpenAiConfig

agent = Agent(
    name="assistant",
    description="An general purpose agent without tools",
    llm_config=OpenAiConfig(name="openai-gpt-5-mini", model_id="gpt-5-mini"),
    system_prompt="You are a helpful assistant. Help the user answering politely.",
)

langgraph_agent = AgentSpecLoader().load_component(agent)

from phoenix.otel import register

from openinference.instrumentation.agentspec import AgentSpecInstrumentor

tracer_provider = register(batch=True, project_name="hello-world-app")
AgentSpecInstrumentor().instrument(tracer_provider=tracer_provider)

while True:
    user_input = input("USER  >>> ")
    if user_input.lower() in ["exit", "quit"]:
        break
    response = langgraph_agent.invoke(
        input={"messages": [{"role": "user", "content": user_input}]},
        config={"configurable": {"thread_id": "1"}},
    )
    print("AGENT >>>", response['messages'][-1].content.strip())

Now simply run the python file and observe the traces in Phoenix.

python agentspec_agent.py

More Info

Metadata

Release files for openinference-instrumentation-agentspec 0.1.19

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

Source distribution (sdist)

Source distribution for openinference-instrumentation-agentspec 0.1.19
File Size Uploaded Provenance Actions
openinference_instrumentation_agentspec-0.1.19.tar.gz 14.4 kB With provenance Details for openinference_instrumentation_agentspec-0.1.19.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openinference-instrumentation-agentspec 0.1.19
File Interpreter ABI Platform Actions
openinference_instrumentation_agentspec-0.1.19-py3-none-any.whl Python 3 none any Details for openinference_instrumentation_agentspec-0.1.19-py3-none-any.whl

Total release size: 31.6 kB

Release files / openinference_instrumentation_agentspec-0.1.19.tar.gz

Download URL openinference_instrumentation_agentspec-0.1.19.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
16fcd9a82478de7df764c930c225b10c977fcd1bb6b559f2c89530eea294a818
BLAKE2b-256 checksum
How to use checksums
77cbd5b8b5a117bc62b1fe6f963370f9052b503852622fc3febf9a2a4603a4d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / openinference_instrumentation_agentspec-0.1.19-py3-none-any.whl

Download URL openinference_instrumentation_agentspec-0.1.19-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
273cc7123816474bd5bc1931959d7d534ed836a513186dad8a137b1f32ea6d15
BLAKE2b-256 checksum
How to use checksums
c5bfc0a0aeae25c708366e4935002ae87cacc12086f1c755fe1de7d6b8d1a961
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for openinference-instrumentation-agentspec 0.1.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openinference_instrumentation_agentspec-0.1.19.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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