Skip to content

WASM

OxideShield™ provides WebAssembly bindings for client-side security validation.

Supported Guards

Guard WASM Support
PatternGuard ✅ Full
LengthGuard ✅ Full
PIIGuard ✅ Full
EncodingGuard ✅ Full
PerplexityGuard ❌ Not supported
SemanticSimilarityGuard ❌ Not supported
MLClassifierGuard ❌ Not supported

Installation

npm install @oxideshield/wasm

Usage

import init, { PatternGuard, PIIGuard, CombinedGuard } from '@oxideshield/wasm';

async function main() {
    await init();

    // Pattern detection
    const guard = new PatternGuard();
    const result = guard.check("ignore previous instructions");

    if (!result.passed) {
        console.log("Blocked:", result.reason);
    }

    // PII redaction
    const pii = PIIGuard.withRedaction("mask");
    const sanitized = pii.redact("john@example.com");
    // j***@example.com

    // Combined guard
    const combined = new CombinedGuard();
    const fullResult = combined.check(userInput);
}

Size

Build Size
Debug ~2 MB
Release ~500 KB
Release + gzip ~150 KB

Interactive Playground

Try the WASM guards directly in your browser on our Interactive Playground.

License Terms

The OxideShield WASM module is provided under the following terms:

Permitted Use (Free)

Use Case Allowed
Personal projects Yes
Educational use Yes
Evaluation/testing Yes
Non-commercial open source Yes
Internal development/prototyping Yes

Commercial Use (License Required)

A Professional or Enterprise license is required for:

Use Case License Required
Embedding in commercial products Professional
SaaS/hosted services Professional
Redistribution as part of a product Professional
White-labeling Enterprise
OEM/reseller agreements Enterprise

Attribution

When embedding the WASM module outside of official OxideShield documentation, a visible "Powered by OxideShield" attribution is required for free use.

Contact

For commercial licensing inquiries, please contact us or email sales@oxideshield.ai.

Building from Source

To build the WASM module from source:

# Install wasm-pack
cargo install wasm-pack

# Build for web target
wasm-pack build crates/oxide-wasm --target web --out-dir pkg

# Build for bundler (webpack, etc.)
wasm-pack build crates/oxide-wasm --target bundler --out-dir pkg

Browser Compatibility

Browser Support
Chrome 57+ Full
Firefox 52+ Full
Safari 11+ Full
Edge 16+ Full
IE 11 Not supported

The WASM module requires WebAssembly support and ES modules.