PromptForest: Local-First Prompt Injection Detection with Uncertainty

PromptForest is a new local-first library created to tackle the issues commonly seen with current prompt injection detectors. It aims to detect prompt injections and jailbreaks efficiently and with a measure of uncertainty to avoid overconfidence in results. This approach differentiates it from traditional systems, particularly by maintaining performance while still providing more nuanced outputs.
Key Details
One of the fundamental issues with existing injection detectors is the reliance on large models like Llama 2 8B and Qualifire Sentinel 0.6B. These models are not only slow, but their overconfidence in results can lead to false positives that undermine their trustworthiness in production scenarios. Recognizing these limitations, PromptForest leverages a voting ensemble method comprising three smaller, specialized models:
- Llama Prompt Guard (86M): Offers the highest pre-ensemble Expected Calibration Error (ECE) in its weight class.
- Vijil Dome (ModernBERT): Delivers the highest accuracy per parameter.
- Custom XGBoost: Trained on embeddings for architectural diversity.
These models collectively use a weighted soft voting method to determine results, where more accurate models have greater influence. This method simplifies decision-making while maintaining high accuracy and consistency.
Benchmarking shows that PromptForest performs with a mean latency of ~141ms, compared to ~225ms for the Qualifire Sentinel v2, while delivering a comparable accuracy of 90% against their 97%. Calibration ECE also fares well at 0.070 versus Sentinel's 0.096. Throughput is impressive as well, with approximately 27 prompts processed per second on a consumer GPU using the pfranger CLI.
For testing and implementation, developers can experiment with PromptForest on Google Colab or audit prompts with the PFRanger tool, which works entirely locally. PFRanger utilizes parallelization to enhance speed and throughput.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Two Patterns for Preventing AI Agent Memory Rot: AutoDream and Skeptical Retrieval
OpenClaw introduces two MIT-licensed patterns to address file-based AI memory rot: AutoDream for nightly memory consolidation and Skeptical Retrieval for decay-weighted memory scoring. Both work together in a self-improving loop to keep agent context current.

ClaudeClaw: Free Claude Code Plugin for Persistent AI Agents on Messaging Platforms
ClaudeClaw is a free, open-source MIT-licensed Claude Code plugin that runs Claude as a persistent agent on Slack, WhatsApp, and Telegram. It requires Node.js 20+, Claude Code, and your own Anthropic API key, with OS-level sandbox isolation via Anthropic's sandbox-runtime.

Agent Smith: One Command To Scaffold MCP Servers, Skills, And A Ticket-To-PR Pipeline For Claude Code
Agent Smith scans your repo, detects exact stack (Go/Echo, React/Zustand, golang-jwt, pgx, etc.), sets up MCP servers, hooks, and skills tailored to your setup, and provides an autonomous ticket-to-PR pipeline.

Claude wrote 3,000 lines of code instead of importing pywikibot — a case study in AI agents ignoring existing libraries
A developer tasked Claude Code (Opus 4.7) with fixing typos on Fandom wikis. The model wrote ~3,000 lines of Python reimplementing pywikibot, mwparserfromhell, and RETF rules rather than importing them. The post explores why this happens and how a two-minute search reduced the codebase to 1,259 lines.