Skip to content

Interactive Playground

Try OxideShield security guards directly in your browser. This playground runs real OxideShield code compiled to WebAssembly, giving you instant feedback without any server round-trips.

No Installation Required

Everything runs locally in your browser. Your input never leaves your device.

Try It Now

Enter text below and see how different guards analyze it in real-time:

Guard Examples

Prompt Injection Detection

The PatternGuard detects common prompt injection techniques:

PII Detection & Redaction

The PIIGuard detects and redacts personal information like emails, phone numbers, and credit cards:

Length Validation

The LengthGuard ensures inputs stay within acceptable limits:

Encoding Attack Detection

The EncodingGuard detects Unicode homoglyph attacks and invisible characters:

Try pasting text with invisible characters or Cyrillic lookalikes to see it in action.

Combined Analysis

The CombinedGuard runs all guards together for comprehensive protection:

Understanding Results

Status Meaning
PASSED Input is safe - no issues detected
BLOCKED Potential threat detected - input should be rejected
SANITIZED PII was found and redacted - sanitized output provided

Severity Levels

Severity Description
low Minor concern, may be false positive
medium Moderate risk, should be reviewed
high Significant threat detected
critical Severe risk, immediate action required

Keyboard Shortcuts

Shortcut Action
Ctrl+Enter Run analysis

Available Guards (WASM)

Guard Description WASM Support
PatternGuard Regex-based prompt injection detection Full
LengthGuard Input length validation Full
PIIGuard PII detection and redaction Full
EncodingGuard Unicode/encoding attack detection Full
CombinedGuard All guards combined Full

Server-Side Guards

Some advanced guards like SemanticSimilarityGuard and MLClassifierGuard require ML model inference and are not available in the WASM build. Use the Rust or Python SDKs for full functionality.

Using WASM in Your Project

Install OxideShield WASM in your project:

npm install @oxideshield/wasm

Basic usage:

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

async function main() {
    // Initialize WASM module
    await init();

    // Create guards
    const patternGuard = new PatternGuard();
    const piiGuard = new PIIGuard();

    // Check user input
    const input = getUserInput();

    // Pattern check
    const patternResult = patternGuard.check(input);
    if (!patternResult.passed) {
        console.log('Blocked:', patternResult.reason);
        return;
    }

    // PII check and redact
    const piiResult = piiGuard.check(input);
    const safeInput = piiResult.sanitized || input;

    // Use the safe input
    processInput(safeInput);
}

main();

Performance

The WASM module is optimized for fast startup and low latency:

Metric Value
Module size (gzip) ~150 KB
Initialization < 50ms
Pattern check < 1ms
PII detection < 5ms

All checks run synchronously in the main thread. For heavy workloads, consider using Web Workers.

Next Steps