Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”Œ wiretaps

Agent observability platform. See everything your AI agents do.

A transparent proxy + interceptor that captures every LLM call, shell command, and HTTP request from your AI agents. Auto-detects PII, credentials, and crypto wallet addresses.

License: MIT Python 3.11+


Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AI Agent   │────▢│             wiretaps                 │────▢│   LLM API   β”‚
β”‚ (any agent) β”‚     β”‚                                      β”‚     β”‚ (OpenAI,..) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”  β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚  β”‚ Proxy  β”‚  β”‚ Storage β”‚  β”‚  API β”‚  β”‚
                    β”‚  β”‚ :8080  β”‚  β”‚ SQLite  β”‚  β”‚ :8899β”‚  β”‚
                    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”¬β”€β”€β”€β”˜  β”‚
                    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚      β”‚
                    β”‚  β”‚   sitecustomize     β”‚     β”‚      β”‚
                    β”‚  β”‚   (interceptor)     β”‚β”€β”€β”€β”€β”€β”˜      β”‚
                    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚
                                                   β–Ό
                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                          β”‚  Web Dashboard   β”‚
                                          β”‚  Next.js :3000   β”‚
                                          β”‚                  β”‚
                                          β”‚  Sessions list   β”‚
                                          β”‚  Event timeline  β”‚
                                          β”‚  Stats & charts  β”‚
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

How it works

  1. MitM Proxy (localhost:8080) β€” sits between your agent and the LLM API, logging every request/response
  2. sitecustomize interceptor β€” automatically hooks into Python subprocess calls and HTTP clients
  3. REST API (localhost:8899) β€” serves captured data (agents, sessions, events, stats)
  4. Web Dashboard (localhost:3000) β€” Next.js frontend to explore sessions, timelines, and stats

Web Dashboard

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          β”‚  Sessions                                        β”‚
β”‚ πŸ“‘ Sess  β”‚                                                  β”‚
β”‚ πŸ“Š Stats β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚          β”‚  β”‚ claude-agent         2m 30s      PII       β”‚  β”‚
β”‚          β”‚  β”‚ πŸ€– 12 LLM  πŸ’» 5 shell  🌐 3 HTTP          β”‚  β”‚
β”‚          β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”‚          β”‚  β”‚ gpt-worker           45s                   β”‚  β”‚
β”‚          β”‚  β”‚ πŸ€– 8 LLM   πŸ’» 2 shell                     β”‚  β”‚
β”‚          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚          β”‚                                                  β”‚
β”‚ v2.0.0   β”‚                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Features

  • πŸ” Full Visibility β€” Log every prompt, response, shell command, and HTTP request
  • 🚨 PII Detection β€” Auto-detect emails, phone numbers, SSNs, credit cards, crypto addresses
  • πŸ›‘οΈ Redact Mode β€” Mask PII before it reaches the LLM
  • 🚫 Block Mode β€” Reject requests that contain PII
  • πŸ“Š Web Dashboard β€” Browse sessions, event timelines, and stats
  • πŸ”Œ Zero Code Changes β€” Just set OPENAI_BASE_URL or use wiretaps run
  • 🏠 Self-Hosted β€” Your data never leaves your machine
  • πŸ“¦ SQLite Default β€” Zero dependencies, instant setup

Quick Start

# Install
pip install wiretaps

# Start wiretaps (proxy + API + interceptor)
wiretaps run -- python my_agent.py

# Or start the daemon separately
wiretaps start

# Point your agent to the proxy
export OPENAI_BASE_URL=http://localhost:8080/v1
python my_agent.py

Start the Dashboard

cd frontend
npm install
npm run dev
# Open http://localhost:3000

Dashboard Pages

Sessions List (/sessions)

Browse all captured agent sessions with event counts by type and PII alerts.

Session Timeline (/sessions/:id)

Chronological timeline of every event in a session. Click any event to see the full payload β€” request/response for LLM calls, stdout/stderr for shell commands.

Stats (/stats)

Dashboard with total sessions, events, tokens, PII alerts. Bar charts for events by day and breakdown by type.

PII Detection

wiretaps automatically scans for sensitive data:

Pattern Example
Email user@example.com
Phone +1 (555) 123-4567
SSN 123-45-6789
Credit Card 4111-1111-1111-1111
CPF (Brazil) 123.456.789-00
BTC Address bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh
ETH Address 0x71C7656EC7ab88b098defB751B7401B5f6d8976F
Private Key 0x... (64 hex chars)
Seed Phrase 12/24 BIP-39 words

REST API

The API runs on port 8899 by default.

Endpoint Description
GET /health Health check
GET /agents List agents
GET /sessions List sessions (filter by agent_id)
GET /sessions/:id Session details
GET /sessions/:id/events Events for a session
GET /events List events (filter by type, session_id, pii_only)
GET /events/:id Event details
GET /stats Overall statistics
GET /stats/by-day Stats grouped by day
GET /stats/by-type Stats grouped by event type

Environment Variables

Variable Default Description
WIRETAPS_URL http://127.0.0.1:8899 Backend API URL (used by interceptors)
WIRETAPS_SESSION_ID (auto) Session ID for the current run
WIRETAPS_API_PORT 8899 API server port
WIRETAPS_PROXY_PORT 8080 Proxy server port
WIRETAPS_HOST 127.0.0.1 Host to bind to
WIRETAPS_TARGET https://api.openai.com LLM API to forward requests to
NEXT_PUBLIC_API_URL http://localhost:8899 Frontend: API URL for the dashboard

Redact & Block Modes

# Redact: mask PII before sending to LLM
wiretaps start --redact

# Block: reject requests with PII entirely
wiretaps start --block

Supported LLM APIs

  • OpenAI (api.openai.com)
  • Anthropic (api.anthropic.com)
  • Azure OpenAI
  • Google AI (Gemini)
  • Local models (Ollama, vLLM, etc.)
  • Any OpenAI-compatible API

Project Structure

wiretaps/
β”œβ”€β”€ frontend/              # Next.js web dashboard
β”‚   β”œβ”€β”€ src/app/           # App Router pages
β”‚   β”‚   β”œβ”€β”€ sessions/      # Sessions list + timeline
β”‚   β”‚   └── stats/         # Stats dashboard
β”‚   └── src/lib/           # API client & types
β”œβ”€β”€ src/wiretaps/
β”‚   β”œβ”€β”€ api/               # FastAPI REST API
β”‚   β”‚   β”œβ”€β”€ app.py         # App factory + CORS
β”‚   β”‚   β”œβ”€β”€ schemas.py     # Pydantic models
β”‚   β”‚   └── routes/        # Endpoint handlers
β”‚   β”œβ”€β”€ interceptors/      # sitecustomize hook
β”‚   β”œβ”€β”€ proxy.py           # MitM proxy server
β”‚   β”œβ”€β”€ pii.py             # PII detection engine
β”‚   β”œβ”€β”€ storage.py         # SQLite storage layer
β”‚   β”œβ”€β”€ cli.py             # CLI commands
β”‚   └── daemon.py          # Daemon process
β”œβ”€β”€ tests/                 # Test suite
β”œβ”€β”€ patterns/              # PII pattern definitions
└── pyproject.toml

Contributing

git clone https://github.com/marcosgabbardo/wiretaps
cd wiretaps
pip install -e ".[dev]"
pytest
ruff check .

License

MIT β€” use it however you want.


Built with πŸ”Œ by @marcosgabbardo

About

See what your AI agents are sending to LLMs.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages