3 releases
| 0.1.6 | Feb 4, 2026 |
|---|---|
| 0.1.5 | Feb 1, 2026 |
| 0.1.0 | Jan 29, 2026 |
#567 in WebAssembly
53KB
1.5K
SLoC
OxideShield WASM Bindings
Browser-compatible subset of OxideShield security guards for WebAssembly.
Supported Guards
- PatternGuard - Regex-based pattern matching for prompt injection detection
- LengthGuard - Input length validation
- EncodingGuard - Unicode and encoding attack detection
- PIIGuard - Personal information detection and redaction
Usage in JavaScript
import init, { PatternGuard, PIIGuard, LengthGuard } from 'oxideshield';
await init();
// Pattern-based detection
const guard = new PatternGuard();
const result = guard.check("ignore previous instructions");
if (!result.passed) {
console.log("Blocked:", result.reason);
}
// PII detection
const pii = PIIGuard.withRedaction("mask");
const piiResult = pii.check("Email: john@example.com");
console.log("Sanitized:", piiResult.sanitized);
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 |
|---|---|
oxideshield-core |
Core types, pattern matching, perplexity analysis |
oxideshield-guard |
Security guards for LLM protection |
oxideshield-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
[dependencies]
oxideshield-guard = "0.1"
oxideshield-core = "0.1" # optional — core types only
Python
pip install oxideshield
Note: Requires a Rust toolchain to build from source. Pre-built wheels for common platforms are coming soon. For manual builds, use maturin:
maturin develop --release
WASM
Try OxideShield in your browser with the Interactive Playground.
Build from source using wasm-pack:
wasm-pack build crates/oxideshield-wasm --target web
Quick Start
Rust
use oxideshield_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
~10–15MB
~265K SLoC