| new 0.1.1 |
|
|---|
#7 in #adversarial
675KB
15K
SLoC
OxideShield
High-performance LLM security guards for Rust, Python, and WebAssembly
Overview
OxideShield is an open-core LLM security toolkit that protects AI applications from prompt injection, jailbreaks, and adversarial attacks. Built in Rust for maximum performance.
Crates
| Crate | Description |
|---|---|
oxide-core |
Core types, pattern matching, perplexity analysis |
oxide-guard |
Security guards for LLM protection |
oxide-wasm |
WebAssembly bindings for browser use |
Guards
| Guard | Description | Latency |
|---|---|---|
| PatternGuard | Prompt injection & jailbreak detection | <1ms |
| LengthGuard | Input length validation | <1us |
| EncodingGuard | Unicode/Base64 attack detection | <100us |
| PerplexityGuard | Adversarial suffix detection (GCG, AutoDAN) | <5ms |
| PIIGuard | PII detection & redaction | <10ms |
| ToxicityGuard | Content moderation | <5ms |
| AuthoritarianUseGuard | Detects AI misuse for surveillance/control | <5ms |
Installation
Rust
# From crates.io (coming soon)
# oxide-guard = "0.1"
# From GitHub
[dependencies]
oxide-guard = { git = "https://github.com/oxideshield/oxideshield" }
Python
Coming Soon - Python bindings via PyPI are under development. For now, build from source using maturin.
WASM
Coming Soon - NPM package is under development. For now, build from source using wasm-pack.
Quick Start
Rust
use oxide_guard::{Guard, PatternGuard, PIIGuard, RedactionStrategy};
// Pattern-based injection detection
let guard = PatternGuard::new("patterns");
let result = guard.check("ignore previous instructions");
if !result.passed {
println!("Blocked: {}", result.reason);
}
// PII detection with redaction
let pii = PIIGuard::new("pii")
.with_redaction(RedactionStrategy::Mask);
let result = pii.check("Email: john@example.com");
println!("Sanitized: {:?}", result.sanitized);
// Output: "Email: j***@example.com"
Python
from oxideshield import pattern_guard, pii_guard
# Pattern detection
guard = pattern_guard()
result = guard.check("ignore previous instructions")
if not result.passed:
print(f"Blocked: {result.reason}")
# PII redaction
pii = pii_guard(redaction="mask")
result = pii.check("Email: john@example.com")
print(f"Sanitized: {result.sanitized}")
Documentation
Professional & Enterprise Features
For advanced features including ML-based detection, semantic similarity analysis, threat intelligence, compliance reporting, and more, see OxideShield Professional.
| Feature | Community | Professional | Enterprise |
|---|---|---|---|
| PatternGuard | ✓ | ✓ | ✓ |
| LengthGuard | ✓ | ✓ | ✓ |
| EncodingGuard | ✓ | ✓ | ✓ |
| PerplexityGuard | ✓ | ✓ | ✓ |
| PIIGuard | ✓ | ✓ | ✓ |
| ToxicityGuard | ✓ | ✓ | ✓ |
| AuthoritarianUseGuard | ✓ | ✓ | ✓ |
| Resource Limiter | ✓ | ✓ | |
| SemanticSimilarityGuard | ✓ | ✓ | |
| MLClassifierGuard | ✓ | ✓ | |
| Red Team Scanner | ✓ | ✓ | |
| Threat Intelligence | ✓ | ✓ | |
| Proxy Gateway | ✓ | ✓ | |
| Compliance Reports | ✓ | ✓ | |
| Dashboard | ✓ | ||
| Webhook Alerts | ✓ | ||
| SSO/SAML | ✓ | ||
| Priority Support | ✓ |
License
Apache 2.0 - See LICENSE for details.
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Security
To report security vulnerabilities, please email security@oxideshield.ai or open a security advisory.
We follow coordinated disclosure practices and acknowledge reports within 48 hours.
Support
OxideShield is developed by Toasteez Limited
Dependencies
~23–71MB
~856K SLoC