Skip to main content

agentwatch

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

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.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 agentsec-agentwatch 0.1.0
File Size Uploaded
agentsec_agentwatch-0.1.0.tar.gz 380.3 kB Details

Built distribution (wheel)

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

Total release size: 664.7 kB

Release files / agentsec_agentwatch-0.1.0.tar.gz

Download URL agentsec_agentwatch-0.1.0.tar.gz
Size 380.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b17356514e48782d8449b99d4051b9368d811fbadcc30d217237dbe7222cfc38
BLAKE2b-256 checksum
How to use checksums
103586ba46583cbf4ab5c466facbd8205070dc25b2f3d9553a71ea2b757809f9
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.1.0-py3-none-any.whl

Download URL agentsec_agentwatch-0.1.0-py3-none-any.whl
Size 284.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc8eeaa8bbe1fea3398a5ee591d39ff9d347c7bcce53002ad4aa18110a8bed09
BLAKE2b-256 checksum
How to use checksums
07ed51c2c27272c8f341444c25233dfd8de1928493e3ace1ece73226517871af
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.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