Skip to content

Back to the catalog

AI Security Briefing
github.comrepo

AI Security Briefing

SingGuard-NSFA is an open-source guardrail framework (released as 0.8B/2B/4B/9B model checkpoints) that targets operational threats in LLM agents—prompt injection, sensitive-info extraction, malicious code requests, tool misuse, and resource exhaustion—rather than just content-safety issues. It's built on a CIA-triad-grounded taxonomy of 185 risk variants across 7 domains (cross-validated against OWASP guidelines) and a 133-language benchmark with 93K+ samples, offering both generative chain-of-thought auditing and ~50ms real-time classification heads. It beats Llama Guard 3, WildGuard, and GPT-5.1 by 6-12 F1 points on multilingual benchmarks, and can also be plugged into Llama Guard 3 as a lightweight enhancement (+17.6 F1).

TL;DR Open-source, extensible guardrail framework and 185-risk taxonomy for detecting prompt injection and agentic-AI operational threats across 133 languages in real time.
Document

What it is

SingGuard-NSFA is a released guardrail framework (four models: 0.8B/2B/4B/9B on Qwen3.5-Base) for detecting operational threats in agentic LLM systems — prompt injection, sensitive-info extraction, malicious code requests, dangerous tool misuse, resource exhaustion. Beyond what the summary states, the page details how it is built, how to extend it, and a design constraint that bounds what it can catch.

How it works

Two phases. Phase 1 is chain-of-thought SFT on the backbone using explicit boundary tags (<untrusted_input> / <untrusted_output>) to prevent instruction injection during the analysis itself. Phase 2 trains lightweight per-domain MLP heads on the frozen SFT model's last-token embeddings; each head is independent, enabling multi-label detection. Inference runs either as generative CoT reasoning (interpretable, for offline audit) or a single forward pass feeding all heads in parallel (45–57 ms, no token generation).

Training data comes from a four-stage pipeline over 74 open-source LLMs: seed-free generation, seed-based augmentation, multilingual expansion (English → Chinese full coverage + 131 languages via TranslateGemma-27B-IT), and final re-annotation by Qwen3.5-397B-A17B with disagreements discarded. ~93K purpose-built + 3,435 cross-source samples.

Preconditions / Affected

Two design constraints matter for whether this fits your system:

  • Single-turn only — by design, only risks detectable from one turn of text are in scope, so it operates statelessly. Multi-turn / stateful attack chains are out of scope.
  • Query-first, response-as-backstop — the query guardrail is primary defense; response guardrail is complementary. The taxonomy is asymmetric: query-side has 5 domains / 24 risks / 160 variants; response-side only 2 domains / 4 risks / 25 variants.

What to do

Two concrete options the page supports:

  • Extend to new risks without retraining: train one lightweight head on the frozen backbone. Scaling heads from 5 → 50,000 adds only ~9 ms (45.09 → 54.34 ms), staying within a 100 ms budget.
  • Augment an existing guardrail rather than replacing it: NSFA-trained heads applied to Llama Guard 3 (8B) add +17.6 F1 points, moving it to second place behind SingGuard-NSFA itself. A content-safety head on the 9B backbone lands within 1 F1 point of dedicated content-safety models.

Caveats

All headline F1 numbers are self-reported by the authors on their own purpose-built benchmarks; the only independent validation cited is the 3,435-sample cross-source set adapted from AgentDojo, InjecAgent, AgentHarm, AgentDyn, and ATBench. The work is a 2026 preprint (author list incomplete on the page). No license or repository availability detail is given in the fetched text.

Technologies named here

Techniques named here