Catalog PyPI
PACKAGE EXPLORERView in registry

agentwit

PyPI

Transparent proxy witness for AI agent ↔ MCP server communications

ai-agentauditllmmcpproxysecuritywitness
Versions collected1
Direct dependencies9From release 1.1.0
Last observed21 Oct, 08:57 UTC

README

Version 1.1.0 documentation

agentwit

Debug and audit AI agent ↔ MCP server tool calls.

pip install agentwit
agentwit proxy --target http://localhost:3000 --port 8765
[agentwit] 14:32:01  tools/call  bash       HIGH ⚠  shell_exec
[agentwit] 14:32:03  tools/call  read_file  LOW  ✓
[agentwit] 14:32:05  tools/call  bash       CRITICAL 🚨 privilege_escalation  LLM06

Change one URL. No MCP server modification needed.

agentwit demo

日本語版 · PyPI · Releases

Python 3.10+ PyPI Tests License: MIT OWASP LLM Top 10 Plugin API


The problem

When an AI agent calls MCP server tools, you can't see what's happening.

AI Agent
↓  (black box)
MCP Server  →  bash / read_file / fetch / ...

agentwit sits between them as a transparent proxy and records everything.

AI Agent
↓
agentwit  ←  logs every call · detects risks · verifies integrity
↓
MCP Server  (zero modification)

5-minute quickstart

pip install agentwit

# 1. Start the proxy
agentwit proxy --target http://localhost:3000 --port 8765

# 2. Point your agent to port 8765 instead of 3000
#    That's it. Recording starts immediately.

# 3. Generate an audit report
agentwit report --session ./witness_logs/SESSION_ID --format html

# 4. Verify log integrity
agentwit verify --session ./witness_logs/SESSION_ID
# Chain integrity:  VALID ✓
# Signature check:  VALID ✓

→ Full guide: docs/quickstart.md


Features

Log recording

  • Tamper-proof SHA-256 chain — detect any modification
  • ed25519 signatures — prove who recorded the log
  • HTML / Markdown / JSON report generation
  • Auto-backup to ~/.agentwit/backups/ on session end

Risk detection

  • 15+ built-in patterns: shell_exec, privilege_escalation, data_exfiltration, jailbreak, ...
  • Prompt injection detection (CRITICAL/HIGH/MEDIUM/LOW)
  • Tool schema change detection
  • Agent thought & reasoning recording (LangChain)

OWASP LLM Top 10 mapping (v1.0.0)

Every detected risk is automatically tagged with the corresponding OWASP LLM category:

OWASP LLMCategoryDetected patterns
LLM01Prompt Injectioninstruction_override / role_hijack / jailbreak
LLM02Sensitive Info Disclosurecredential_access / data_exfiltration
LLM06Excessive Agencyprivilege_escalation / persistence / lateral_movement
LLM08Integrity Failurestool_schema_change / proxy_bypass_detected
LLM10Unbounded Consumptioncall_rate_anomaly / session_cost_exceeded
from agentwit.analyzer.owasp_mapper import OWASPMapper
mapper = OWASPMapper()
mapper.map("privilege_escalation")  # → "LLM06"
mapper.map_events(events)           # → adds owasp_category to each event

Plugin API (v1.0.0)

Add custom detection rules as external packages — no fork needed:

# my_package/plugin.py
from agentwit.plugins.base import PluginBase

class MyPlugin(PluginBase):
    def scan(self, event: dict) -> list[dict]:
        if "dangerous_pattern" in str(event):
            return [{"pattern": "my_pattern", "severity": "HIGH",
                     "description": "Custom detection"}]
        return []
# pyproject.toml of your plugin package
[project.entry-points."agentwit.plugins"]
my_plugin = "my_package:MyPlugin"
pip install agentwit-plugin-myname
agentwit proxy --target http://localhost:3000 --port 8765
# → plugin auto-loaded on startup

→ Full guide: docs/plugin-guide.md

SIEM integration (v1.0.0)

Forward audit logs to Splunk, Elasticsearch, or Grafana Loki via Fluent Bit:

# docker/docker-compose.siem.yml
SPLUNK_HEC_TOKEN=your-token docker compose -f docker/docker-compose.siem.yml up

Supports: Splunk HEC · Elasticsearch · Grafana Loki

MCP Inspector GUI

Desktop app for real-time MCP server debugging.

Download: GitHub Releases

  • Linux: .deb / .rpm / .AppImage
  • Windows: .msi (via GitHub Actions)

GUI features

  • 3-pane layout: Server info + Tool list / Parameter editor + Response / History + Metrics + Compare
  • Export Report button — generate HTML audit report from History tab with one click
  • EN/JP language support
  • Real-time risk score display
┌─────────────────┬──────────────────────┬─────────────────────┐
│  Server Info    │  Parameter Editor    │  History            │
│  ─────────────  │  ──────────────────  │  ─────────────────  │
│  Tools          │  {                   │  [Export Report]    │
│  ✓ bash   EXEC  │    "command": "ls"   │                     │
│  ✓ read   READ  │  }                   │  14:32 bash  HIGH   │
│  ✓ fetch  READ  │                      │  14:33 read  LOW    │
│                 │  [Execute]           │  14:34 bash  CRIT   │
└─────────────────┴──────────────────────┴─────────────────────┘

Transports

TransportStatusHow to use
Streamable HTTP✅agentwit proxy --target http://localhost:3000
SSE (legacy)✅auto-detected
stdio✅agentwit proxy --stdio -- python mcp_server.py

LangChain integration

pip install agentwit[full]
from agentwit import AgentwitCallback

callbacks = [AgentwitCallback(output="./audit.jsonl")]

# Agent thoughts and reasoning are also recorded:
# {"type": "agent_thought", "thought": "...", "tool_selected": "bash",
#  "reasoning": "...", "timestamp": "..."}

CLI reference

# Proxy
agentwit proxy --target http://localhost:3000 --port 8765
agentwit proxy --target http://localhost:3000 --port 8765 --timeout 60
agentwit proxy --stdio -- python mcp_server.py
agentwit proxy --target http://localhost:3000 \
  --webhook https://hooks.slack.com/xxx \
  --webhook-on HIGH,CRITICAL

# Reports
agentwit report --session ./witness_logs/SESSION_ID --format json
agentwit report --session ./witness_logs/SESSION_ID --format markdown
agentwit report --session ./witness_logs/SESSION_ID --format html --output ./report.html

# Verification
agentwit verify --session ./witness_logs/SESSION_ID
agentwit replay --session ./witness_logs/SESSION_ID
agentwit diff --session-a ./witness_logs/A --session-b ./witness_logs/B

→ Full reference: docs/api-reference.md


Guard vs. Witness

ToolApproachBlocks callsTamper-proof log
mcp-scanProxy + Guard✅❌
InterceptPolicy proxy✅❌
agentwitWitness proxy❌✅

agentwit does not block. It witnesses.
A blocked call leaves no trace. A witnessed call leaves evidence.


Version history

VersionDateHighlights
v0.1.02026-03-14MVP: HTTP/SSE/stdio proxy, SHA-256 chain log
v0.2.02026-03-15HTML report, LangChain, Slack/Discord webhook
v0.3.02026-03-16MCP Inspector GUI, standard /mcp endpoint
v0.4.02026-03-21MCP spec auto-follow, injection detection, tool monitoring
v0.5.02026-03-22ed25519 signatures, bypass detection, anomaly detection
v0.6.02026-03-22GUI Export Report, agent thought recording, error handling
v0.7.02026-03-22OWASP LLM Top 10 mapping, Windows build (GitHub Actions)
v1.0.02026-03-22Plugin API, SIEM integration, full docs, GUI tests

Documentation

DocContents
docs/quickstart.md5-minute getting started guide
docs/architecture.mdArchitecture and design philosophy
docs/api-reference.mdFull CLI and Python API reference
docs/plugin-guide.mdPlugin development guide
CONTRIBUTING.mdHow to contribute
CHANGELOG.mdFull version history

License

MIT — see LICENSE

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.1.010 Apr 20269

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
tokotokokame/agentwit

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 08:57 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:7816547206ac2e8b177c0e4a989794623add665a85318a362b5211475f24b1ef