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.

Full Playground

Select a guard, configure its options, pick an example or enter your own text, and click Run Analysis.

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
none No issue detected
low Minor concern, may be false positive
medium Moderate risk, should be reviewed
high Significant threat detected
critical Severe risk, immediate action required

Features

Per-Guard Configuration

Each guard has a dedicated configuration panel:

  • PatternGuard — Toggle block-on-match, add custom regex patterns with category and severity
  • LengthGuard — Adjust max/min character limits and word count via sliders
  • PIIGuard — Choose redaction strategy (Mask/Replace/Remove/Hash), toggle block-on-detect, compare all 4 modes side-by-side
  • EncodingGuard — Adjust max Unicode ratio threshold
  • CombinedGuard — Enable/disable individual sub-guards, toggle fail-fast, view per-guard breakdown

Example Library

30+ categorised examples covering:

  • Prompt Injection — Direct overrides, system prompt leaks, admin mode, multilingual attacks (Chinese, Japanese, Korean, Russian)
  • Jailbreaks — DAN variants, constraint removal, roleplay exploits, safety bypass
  • PII Detection — Emails, phones, SSNs, credit cards, IPs, API keys, mixed PII
  • Encoding Attacks — Invisible characters, homoglyphs, base64, high Unicode ratio, zero-width injection
  • Length Violations — Too long, too short, word limit exceeded
  • Safe Inputs — Normal conversation, technical questions, code snippets

Click any example to auto-load its text and select the recommended guard.

Comparison Mode

Click the Compare button to split the results panel into two columns. Run the same input through two different guard configurations side-by-side.

Input History

The playground stores your last 10 inputs in session storage. Click History to view and restore previous inputs.

Performance Metrics

Every run displays per-guard timing using performance.now(). For CombinedGuard with breakdown enabled, each sub-guard is timed individually.

Keyboard Shortcuts

Shortcut Action
Ctrl+Enter Run analysis

Available Guards (WASM)

Guard Description WASM Support
PatternGuard Regex-based prompt injection detection (124+ multilingual patterns) Full
LengthGuard Input length and word count validation Full
PIIGuard PII detection and redaction (6 categories, 4 strategies) Full
EncodingGuard Unicode/encoding attack detection Full
CombinedGuard All guards combined with fail-fast option Full

Server-Side Guards

Some advanced guards like SemanticSimilarityGuard and MLClassifierGuard require ML model inference and are not available in the WASM build. The 5 community guards (SecretGuard, CodeGuard, URLGuard, GibberishGuard, LanguageGuard) are available in the Rust and Python SDKs only. 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