Skip to main content

agentwatch

PyPI version Python versions License: Apache-2.0 Status: v0.1.0

Instrumentation SDK for AI agents — turn agent behavior into OpenTelemetry GenAI spans and validated, redacted execution records. Part of agentwatch.

Installation

pip install agentsec-agentwatch

Optional extras:

pip install "agentsec-agentwatch[langgraph]"   # LangGraph adapter
pip install "agentsec-agentwatch[otlp]"        # OTLP export
pip install "agentsec-agentwatch[signing]"     # cryptographic signing helpers

Requires Python 3.10+.

Quickstart

Trace a plain Python agent — no framework required:

from agentwatch.raw import trace_agent
from agentwatch.spans import plan_span, execute_tool_span

@trace_agent("support-bot", agent_version="v0.1.0", model="gpt-4o", provider="openai")
def answer(request: str) -> str:
    with plan_span("decide next action"):
        ...
    with execute_tool_span("search", arguments={"q": request}):
        ...
    return "done"

Or drive the run context explicitly:

from agentwatch.config import default_config
from agentwatch.tracer import configure_tracing
from agentwatch.context import RunContext
from agentwatch.instrument import invoke_agent

configure_tracing(default_config())          # once at startup
with invoke_agent(RunContext(agent_name="request-triage")):
    ...

LangGraph:

from agentwatch.langgraph import trace_graph

graph = trace_graph(compiled_graph, agent_name="planner")

Privacy

Records are redacted by default. Four privacy modes are available per span/tool call:

Mode What is stored
truncated (default) Content-safe truncated values
metadata-only Names, timings, and counts; no content
hashed One-way digests of content
full Raw content (opt-in)

Record, replay, verify

The same package installs the CLI:

agentwatch init            # install Claude Code hooks + start the local daemon
agentwatch sessions        # list recorded sessions
agentwatch replay <id>     # reconstruct a session's action timeline
agentwatch verify-store    # verify the hash chain

Records are written to a local-first, hash-chained JSONL store; OTLP export is opt-in and gated on a redaction self-test.

Documentation

License

Apache-2.0 — see LICENSE.

Metadata

Release files for agentsec-agentwatch 0.2.1

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

Source distribution (sdist)

Source distribution for agentsec-agentwatch 0.2.1
File Size Uploaded
agentsec_agentwatch-0.2.1.tar.gz 736.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentsec-agentwatch 0.2.1
File Interpreter ABI Platform
agentsec_agentwatch-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / agentsec_agentwatch-0.2.1.tar.gz

Download URL agentsec_agentwatch-0.2.1.tar.gz
Size 736.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4d94d64ca3d39bcb9581ca1f9114af6aaff05ebdbeb93ee43d299615a5e63604
BLAKE2b-256 checksum
How to use checksums
b4b3fe709aa3ee93d7ed66955fad6b9dd8a05d9583e85ba9096e1d5311db90a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / agentsec_agentwatch-0.2.1-py3-none-any.whl

Download URL agentsec_agentwatch-0.2.1-py3-none-any.whl
Size 529.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d78d9d987bd17605175c03aa6e8a72aec38d9bfe5bf4ec3f1911a0921066c7e0
BLAKE2b-256 checksum
How to use checksums
e07419bc737e708c03d1bf94405a83558c29434e5d3bf9fb60c9108367d8b534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

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