Metadata-Version: 2.4
Name: varuna
Version: 0.1.0
Summary: Runtime network monitor for Python packages — detects external API calls and sensitive data exfiltration
Author-email: Manohar Vanam <your-email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/ManoharUchiha/varuna
Project-URL: Documentation, https://github.com/ManoharUchiha/varuna/blob/main/OVERVIEW.md
Project-URL: Repository, https://github.com/ManoharUchiha/varuna
Project-URL: Bug Tracker, https://github.com/ManoharUchiha/varuna/issues
Keywords: security,network,monitoring,privacy,pii,llm,langchain,openai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: Security
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: rich>=13.0
Requires-Dist: click>=8.0
Requires-Dist: urllib3>=1.26
Provides-Extra: grpc
Requires-Dist: grpcio>=1.50; extra == "grpc"
Provides-Extra: full
Requires-Dist: grpcio>=1.50; extra == "full"
Requires-Dist: httpx>=0.24; extra == "full"
Requires-Dist: aiohttp>=3.8; extra == "full"

# Varuna

**Runtime network monitor for Python packages — detects external API calls and sensitive data exfiltration in real time.**

```bash
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

```python
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

```python
from pypi_interceptor import NetworkMonitor

@NetworkMonitor.watch
def my_pipeline(prompt):
    from langchain import PromptTemplate
    # ... your code here
```

### As a CLI (zero code changes)

```bash
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

- [Setup Guide](SETUP.md)
- [Project Overview & Comparison](OVERVIEW.md)

---

## License

MIT
