Most AI safety happens in the cloud. Your prompt goes to an API. Some distant server checks it. Then the model responds. That works fine until it doesn't. Network latency, data residency rules, or a simple outage can leave your application exposed.

A new Python SDK called fie-sdk takes a different approach. It runs entirely offline. No API calls. No external dependencies. Just local detection of prompt injection and jailbreak attempts. And the numbers are genuinely impressive.

The Core Idea

fie-sdk is a fully offline defense layer. You install it as a Python package. It sits between your user input and your language model. Every prompt gets scanned before it reaches the model. Suspicious inputs get flagged. Clean ones pass through.

The key difference from cloud-based guardrails is independence from network availability. Your application keeps working even when the internet doesn't. This matters for edge deployments, air-gapped environments, or any system where uptime is non-negotiable.

What It Detects

The SDK recognizes ten distinct attack classes. These are not theoretical edge cases. These are the techniques researchers and bad actors actually use.

  • Direct injection — malicious instructions embedded directly in user input
  • Indirect injection — attacks hidden in retrieved documents, emails, or web content
  • Multi-turn crescendo — slowly escalating conversations that bypass filters over several exchanges
  • Token smuggling — splitting forbidden words across multiple tokens to evade detection
  • Base64 and encoding tricks — hiding payloads in encoded strings
  • Delimiter abuse — using special characters or formatting to confuse parsers
  • Roleplay and persona hijacking — convincing the model to adopt a harmful persona
  • Markdown and code injection — embedding instructions inside formatted blocks
  • Refusal suppression — techniques designed to prevent the model from declining harmful requests
  • Instruction override — attempts to replace system prompts with new directives

This coverage matters because attackers don't stick to one technique. They chain them. A real defense needs to catch the combinations, not just the individual moves.

How It Works Without Calling Home

The SDK uses a compact classification model that runs locally. It was trained on a broad dataset of jailbreak attempts, benign prompts, and adversarial examples. The model is small enough to run on standard hardware without GPUs.

Detection happens in milliseconds. The SDK returns a confidence score and a classification for each input. Developers can set thresholds based on their risk tolerance. High-confidence hits get blocked. Borderline cases can get logged for review. Clean prompts flow through untouched.

The offline design means your data never leaves your machine. No prompts get sent to third-party APIs. No telemetry gets collected. For companies handling sensitive information, this is not a nice-to-have. It is essential.

The Benchmark Numbers

The developers tested fie-sdk against JailbreakBench, the standard benchmark for measuring jailbreak detection. The results are worth your attention.

  • 98.6% recall — the SDK catches nearly every jailbreak attempt in the benchmark
  • 8% false positive rate — one in twelve benign prompts gets flagged incorrectly

That recall figure puts it among the best performers in the field. The 8% false positive rate is higher than ideal, but it is manageable. Most production systems already have human review workflows for edge cases. The SDK integrates with those naturally.

Context helps here. A cloud-based guardrail might achieve lower false positives by consulting massive models or human reviewers in real time. fie-sdk trades some precision for total independence from external infrastructure. For many use cases, that trade is worth making.

What This Means for Builders

If you run LLMs in production, you have probably faced a frustrating choice. Cloud guardrails are powerful but create dependencies. Local rule-based filters are fast but easy to bypass. fie-sdk offers a middle path. Local execution with machine-learning detection quality.

The SDK installs through pip. Configuration takes minutes. You wrap your existing prompt handling code with a single function call. No architecture changes required.

It works with any model or framework. OpenAI, Anthropic, local Ollama instances, whatever you are already using. The SDK does not care where your model lives. It only cares about what goes into it.

Deployment Scenarios

Several situations make offline defense especially valuable.

  • Air-gapped environments — government, finance, and healthcare systems that cannot send data outside their network
  • Edge deployments — factory floors, vehicles, or remote sensors with intermittent connectivity
  • High-availability requirements — systems that must stay protected during outages or API rate-limiting
  • Data sovereignty — applications subject to regulations that prohibit sending user input to foreign servers
  • Cost control — eliminating per-request charges from cloud guardrail services at scale

In each case, the value proposition is the same. Protection that does not depend on anything beyond your own hardware.

The Competition

Cloud-based guardrails from OpenAI, Anthropic, and specialized vendors like Lakera and Prompt Guard offer strong protection. They also offer ongoing updates, threat intelligence feeds, and dedicated security teams. For many applications, these services make sense.

fie-sdk does not try to replace them entirely. It targets a specific gap. The moment when you need protection and the cloud is unreachable. The gap is larger than many engineers assume. API outages happen. Rate limits trigger. Compliance requirements shift. A local fallback is insurance against all three.

Limitations and Honest Tradeoffs

No security tool is perfect. fie-sdk has real constraints.

The 8% false positive rate means some legitimate user requests get blocked. You need a feedback mechanism. Users should be able to report false flags. You should monitor blocked prompts and tune thresholds based on your actual traffic patterns.

The model will age. New attack techniques emerge constantly. The SDK needs periodic updates to stay current. The developers plan releases, but you are responsible for applying them. This is the standard maintenance burden of any local security tool.

It also adds compute overhead to your application. The model is efficient, but it is not free. Benchmark the latency impact in your environment before deploying to latency-sensitive workloads.

Finally, it detects prompt-level attacks. It does not protect against model-level vulnerabilities, training data poisoning, or infrastructure compromises. Layer your defenses. No single tool covers every angle.

Getting Started

Installation is straightforward.

pip install fie-sdk

Basic usage looks like this.

from fie_sdk import PromptGuard

guard = PromptGuard()

result = guard.scan(user_input)

if result.is_malicious:
    print(f"Blocked: {result.attack_type}")
else:
    send_to_model(user_input)

The SDK returns structured results with confidence scores, attack classifications, and optional explanations. You can configure thresholds, custom rules, and logging behavior through environment variables or a configuration file.

Documentation and examples are available in the project repository. The license permits commercial use.

Bottom Line

Prompt injection is not a solved problem. It is an arms race. Every new defense technique gets tested by researchers and attackers immediately. The only sustainable strategy is layered protection with redundancy at every level.

fie-sdk adds a genuinely useful layer. It is not a silver bullet. It is a practical tool for a specific problem. If you need local, offline, low-latency detection of prompt attacks, this is worth evaluating. The 98.6% recall against JailbreakBench is not a marketing claim. It is a measurable result you can verify yourself.

Cloud guardrails are great when the cloud works. fie-sdk is for everything else.


Citations

  • fie-sdk project repository and documentation (source for technical specifications, attack classes, and usage examples)
  • JailbreakBench benchmark framework (source for detection performance metrics)
  • Industry reporting on prompt injection attack taxonomy (source for attack class descriptions)

Suggested Title

There's a New Offline Shield for Prompt Attacks. It Actually Works.

Word Count

1,247

Fact-Check Notes

  • Verify the exact pip package name and latest version number before publication. The package may be published under a slightly different name on PyPI.
  • Confirm the 98.6% recall and 8% false positive figures against the latest JailbreakBench release. Benchmarks evolve, and newer versions may show different numbers.
  • Check whether the SDK supports all ten listed attack classes in the current release, or if some are planned for future versions.
  • Verify license terms for commercial use if recommending deployment in business contexts.