Runtime network monitor for Python packages — detects external API calls and sensitive data exfiltration
Project description
Varuna
Runtime network monitor for Python packages — detects external API calls and sensitive data exfiltration in real time.
pip install varuna
The Problem
When you use libraries like LangChain, LiteLLM, or the OpenAI SDK, they make network calls to external servers. You trust them — but do you know exactly what data they are sending? Your API keys, machine hostname, username, and environment variables can leave your machine silently, without you realising it.
The Solution
Varuna sits inside your Python process, intercepts every outbound network call across all protocols (HTTP, HTTPS, DNS, gRPC, raw TCP), inspects the payload for sensitive data, and shows you everything live on a terminal dashboard.
Quick Start
As a context manager
from pypi_interceptor import NetworkMonitor
with NetworkMonitor():
import requests
requests.post("https://api.openai.com/v1/chat/completions",
headers={"Authorization": "Bearer sk-..."},
json={"model": "gpt-4", "messages": [...]}
)
As a decorator
from pypi_interceptor import NetworkMonitor
@NetworkMonitor.watch
def my_pipeline(prompt):
from langchain import PromptTemplate
# ... your code here
As a CLI (zero code changes)
varuna run my_script.py
varuna run -m my_module
varuna run -c "import requests; requests.get('https://api.openai.com')"
What It Detects
- API keys and bearer tokens in headers
- OpenAI / AWS / generic API keys in body or URL
- JWT tokens
- Machine hostname and local IP addresses
- System username
- Environment variable values (e.g.
$OPENAI_API_KEY) - File paths leaking from the machine
- Email addresses, credit card numbers, SSN patterns
Live Dashboard
╭─────────────────────────────────────────────────────────────────╮
│ Varuna | Process: my_script.py PID: 1234 Elapsed: 00:03 │
╰─────────────────────────────────────────────────────────────────╯
╭─────────────────────────────── Stats ───────────────────────────╮
│ HTTPS 2 DNS 2 TCP 0 gRPC 0 | Unique Hosts: 1 CRITICAL:1 │
╰─────────────────────────────────────────────────────────────────╯
╭──────────────────────────── Network Events ─────────────────────╮
│ Time Proto Method Destination Risk PII │
│ 18:01:12 HTTPS POST api.openai.com CRITICAL YES │
│ 18:01:11 DNS QUERY api.openai.com LOW · │
╰─────────────────────────────────────────────────────────────────╯
╭──────────────────────────── Alerts ─────────────────────────────╮
│ [CRITICAL] api.openai.com — API key in Authorization header │
│ [CRITICAL] api.openai.com — Hostname found in request body │
╰─────────────────────────────────────────────────────────────────╯
Full Documentation
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file varuna-0.1.0.tar.gz.
File metadata
- Download URL: varuna-0.1.0.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cd4b50f8ece7f7e4b15c8f9fbff7f02d06e42cf4a8b728963e34e7a6783f7d1
|
|
| MD5 |
7774b8082935ff100b2edbbf8f1c4575
|
|
| BLAKE2b-256 |
1d1da76ca00d51d0292a31dd2a931951cc1b0ec285c670bbb1a90c1350efa7b1
|
File details
Details for the file varuna-0.1.0-py3-none-any.whl.
File metadata
- Download URL: varuna-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39e0bf5982104610922c1491b21503bdc3b038377ac72dca04d6baf529771c03
|
|
| MD5 |
d35f49ca0e508d85fcbddb7387719534
|
|
| BLAKE2b-256 |
4fa977478585c5d7bcebe24f6d0d51c7619e2c26741701462108b071ed7187a0
|