Metadata-Version: 2.4
Name: edgeguard-sdk
Version: 0.5.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Summary: Ultra-Fast, Zero-Overhead Layer-0 Pre-Filter for LLM Pipelines & Edge Gateways
Keywords: llm,security,guardrails,prompt-injection,pii,rust
Author: Shmuel Helman
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# EdgeGuard

Sub-microsecond, On-Device AI Guardrails Engine in Rust and C++

EdgeGuard provides low-latency, zero-network security scanning and token-by-token guardrails for on-device LLMs (such as llama.cpp, vLLM, and Apple MLX).

## Performance Benchmarks (Apple Silicon)

| Metric | EdgeGuard (Native Rust/C) | Standard Python Regex | LLM-based Guardrails |
| :--- | :--- | :--- | :--- |
| One-Shot Latency | 0.48 us | ~18.50 us | 250 ms |
| Throughput | 2,088,000+ scans/sec | ~54,000 scans/sec | ~4 req/sec |
| Streaming Latency | 0.81 us / token | ~12.20 us / token | N/A |
| Streaming Throughput | 1,238,000+ tokens/sec | ~82,000 tokens/sec | N/A |
| Network Overhead | 0 ms (Offline) | 0 ms | 50-300 ms |

## Features

- Sub-Microsecond Latency: Native zero-allocation Rust core.
- Streaming Guardrails: Real-time token streaming validation with rolling window and immediate abort.
- Dynamic Policy: Update and hot-reload rules (PII, Prompt Injection, Secrets) from policy.yaml without recompilation.
- Shannon Entropy: Unsupervised detection of high-entropy raw secret keys and passwords.
- Base64 Sniffer: Automatic decoding and scanning of obfuscated payloads in memory.

## Quick Start

```python
from edgeguard import EdgeGuard

guard = EdgeGuard(policy_path="policy.yaml")
result = guard.scan("Contact me at user@example.com")
print(result)
```

## License
MIT

