agentwatch
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentsec_agentwatch-0.2.0.tar.gz | 736.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentsec_agentwatch-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / agentsec_agentwatch-0.2.0.tar.gz
| Download URL | agentsec_agentwatch-0.2.0.tar.gz |
|---|---|
| Size | 736.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9dd5af8bce19a764bbfa2c986fcb3332ae94296d62a856f628b32b1ca779d945
|
|
BLAKE2b-256 checksum How to use checksums |
7d6e9f2ec480f65841dd9e54ae048e440e748d817bbb2217f5a88a10599eec3f
|
| 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.0-py3-none-any.whl
| Download URL | agentsec_agentwatch-0.2.0-py3-none-any.whl |
|---|---|
| Size | 529.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea27640f9094df892dbb534254d9469ad24f475ff00aeb5cc8a068865ba9a0d9
|
|
BLAKE2b-256 checksum How to use checksums |
f12d236048d0a0391b6f6cbc9bb6d29715f39a7b864af05d5ace331cf2080c90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|