Production case studyWork · Case Study

Built, shipped, operated

ShadowShield

A unified, open-source security shield for agentic AI — defense-in-depth prompt-injection protection on both model input and output, with canary tokens, goal-hijack auditing, and benchmarks it publishes honestly.

ShadowShield security framework
Live — shadowshield.xyzLive surface
  • AI Security
  • Open-source
  • PyPI
  • MIT

Live interface

Systems under pressure. You bring the pressure.

Type a prompt injection — or pick one — and the real shadowshield package (the same one on PyPI) scans it server-side and shows you exactly what it caught.

0/500

Pick a preset or paste your own injection, then Test it — the real shadowshield package scans it server-side.

Operating brief

The constraint.

Prompt injection is the number-one risk for agentic AI (OWASP LLM01), but most open-source guards are a single regex that only inspects user input. A jailbroken model still leaks secrets on the way out, and a single strong signal gets averaged away by naive scoring.

What the system does

  • Guards both directions with one engine — model input (prompts, retrieved docs, tool results) and model output (secret/PII leaks, system-prompt regurgitation).

  • Layers detection: multilingual signatures, normalization-aware matching (zero-width/homoglyph/bidi), encoded-payload decoding, heuristic scoring, an optional DeBERTa classifier and LLM self-check — combined with a noisy-or aggregator.

  • Is agent-aware: tool-call guarding, canary tokens that detect successful injections, and an agent-trace alignment audit for goal-hijack.

  • Acts, not just alerts: sanitize, block, throttle, or isolate (spotlighting / datamarking), across strict / balanced / permissive modes.

Architecture

How it moves.

The same engine runs on input and output. Untrusted text is normalized, scored by a detector ladder, aggregated, then answered with an action.

  1. Untrusted text (input or output)
  2. Normalize & decode
  3. Detection ladder (signatures · vector · DeBERTa · LLM check)
  4. Noisy-or aggregator
  5. Response (sanitize · block · isolate)

Canary tokens detect successful injections; an agent-trace alignment audit catches goal-hijack.

Build ledger

What carries it.

Language
Python 3.10+ · strict typing · FastAPI service
Detection
Multilingual signatures (de/es/fr/it/pt) · optional DeBERTa · vector similarity
Distribution
PyPI (pip install shadowshield) · MIT license · OIDC release pipeline
Testing
130+ tests · reproducible benchmark harness (PINT / deepset / InjecAgent)

Current status

Delivered.

  • Open-source on PyPI under MIT, with strict typing and 130+ tests.

  • 0% false-positive rate on hard negatives in the bundled benchmark — and publishes the harder external numbers on purpose.

  • Measured recall ladder on deepset/prompt-injections (all at 0% false positives): regex 18% → +multilingual 23% → +vector 25% → +DeBERTa 48%.

shadowshield — checking PyPI…