Daily MaverickGambia’s Barrow holds off six challengers to win third term as presidentInquirerP2.34-M worth of marijuana plants uprooted in Ilocos SurThe Sydney Morning HeraldKyrgios accused of drunken tirade against female playerNHK 社会福岡 駐輪場刺殺事件 強盗殺人の疑いで再逮捕へRMF24Trudna sytuacja na froncie. Najgorzej w Konstantynówce, ale Ukraina nie traci kontroliESPNMan City cheating scandal: What the Premier League's 958-page report tells us, and what it doesn'tSudinfoCoupe de Belgique : après avoir fait tomber La Gantoise et Malines, Rochefort connaît son prochain adversaire et peut rêver du dernier carré !BBC NewsBody of missing child found in pond, say policeMyJoyOnlineKintampo Farmer Service Centre will significantly impact the lives of farmers – MCEE! OnlineTom Brady Reacts After Getting Roasted on Air for Viral Moaning ClipFrance 24Thousands take to Mexico's streets to protest electoral rulesWirtualna PolskaCyberatak na zapisy do fryzjera. Nawet pół miliona osób zagrożonych
betaThe Daily Newsstand · Free, Always
Sunday, December 6, 2026
Automatic translation is active. Articles in other languages will open in English.Enable automatic translation of articles from other languages into English.

injectguard v0.1.0 Scans External Content Locally Before AI Agents Read It

The article's text, from Joho no Todai's page.

Translate

You ask an AI to look up a web page because you want to know what it says. The text the AI receives may include instructions you did not intend to give it. Even content a person cannot see in the browser is subject to inspection if it appears in the text passed to the model.

On December 6, 2026, developer engineer948 published injectguard v0.1.0 to the Rust package registry crates.io at 11:32 UTC. The first GitHub pre-release followed at 11:50 UTC.

injectguard is open-source software that scans web pages, emails, files, and external tool results. It aims to defend against prompt injection, in which instructions embedded in outside content can prompt an AI to act against the user’s intent.

The tool does not use AI to inspect text. It needs neither a large language model (LLM) to make a judgment nor a network connection or AI service API key. That makes it possible to inspect sensitive documents without passing them to another AI service.

Scanning text even when its representation changes

The developer’s published documentation describes more than 65 detection rules. They look for instructions aimed at the AI, impersonation of trusted roles, requests to disclose credentials, and text concealed with HTML or CSS.

The instruction detection rules cover 10 languages, including Japanese: English, Turkish, German, Spanish, French, Portuguese, Italian, Russian, Chinese, and Japanese.

After applying the rules to the original string, injectguard removes invisible characters or normalizes the text and scans it again. It also scans decoded strings for supported encodings and checks HTML comments and CSS that hides text.

What a person sees may differ from what a program receives. Normalizing strings and applying the rules again makes detection less dependent on differences in how the text looks.

Showing why a passage was flagged

Findings include severity, the rule ID, the line and column, the reason for the finding, and an excerpt from the text. Severity has three levels: low, medium, and high.

On the command line, --json emits results as JSON. The --fail-on flag sets a severity threshold and returns exit code 1 when a finding meets or exceeds it. The default threshold is medium. In ordinary command-line use, code 0 indicates no findings at or above the threshold and code 2 indicates a processing error.

injectguard shows which rule matched and where. AI agent developers can review the warning and integrate the check between retrieving outside content and passing it to the model.

The tool is also available as a Rust library. Its UntrustedText feature renders control and invisible characters as visible strings and limits text length. It adds an untrusted attribute identifying the material as untrusted external content, along with detection rule IDs. The feature is intended for passing information through Model Context Protocol (MCP), which connects AI to external systems.

Text formatted by UntrustedText::new is limited to 256 characters by default. The limit is configurable, and rule IDs are determined by scanning the complete input before truncation. When passing long documents, check whether the formatted text has been cut short.

It is useful to have both a way to find suspicious passages and a way to mark content as external. Readable text remains, so marking it alone may leave instructions in that text able to influence the model. How the receiving application handles outside information is also part of the defense.

The developer detected 38 of 40 examples in a separate test

According to test results in the v0.1.0 README, the developer detected all 96 attack samples at high severity. In a separate test with 40 samples created before the rules were tuned, the tool detected 38 of them, a 95% detection rate.

Publishing a separate evaluation set alongside the attack sample results is worthwhile. The tool missed two of the 40 examples, and 95% describes performance on those 40 inputs. Estimating how often it detects attacks in practice would require more testing.

Defensive software can also flag legitimate documents. The developer said a test on 4,200 files, including technical documentation and Rust source code, found no additional high-severity matches compared with a baseline. The result measures the change relative to that baseline and cannot establish the overall false-positive rate.

The README says that 300,000 tests with irregular inputs and unusual strings did not cause a panic and that the output length limit worked. The published tests/fuzz.rs configures 1,000 iterations for regular tests and 200,000 for extended testing. The README does not break down the reported 300,000 runs.

In performance tests of 24 unusual inputs of 5 MB each, the optimized executable reportedly processed each one in under a second.

An agent could scan outside information every time it retrieves it. Keeping scans short would add protection without making users wait much longer. Actual latency depends on the input type, amount, and execution environment.

The Claude Code integration scans retrieved content and warns the model

The developer also published a Claude Code integration example. The README configuration calls injectguard after web searches, web page fetches, and file reads. On high-severity findings, it writes a warning and the scan results to standard error and returns exit code 2. Claude Code passes the warning to the model.

This integration invokes the scan through PostToolUse after the tool runs successfully. The official Claude Code documentation describes PreToolUse for blocking an action before it runs and PostToolUse for handling the result afterward.

The README integration delivers scan findings to the model as a warning. Enforcing a stop on later actions requires an independent mechanism that can deny them regardless of what the model decides.

The v0.1.0 implementation also limits command-line input to 64 MiB (about 67 MB). In hook mode, an input read failure writes an error to standard error and exits with code 0. That is also the exit code used when there are no high-severity findings, so integrations need to check that the scan itself completed successfully.

A custom AI agent can pass the findings to the model and also decide at the application level whether the severity warrants withholding outside content. The standard command-line threshold and exit codes can support that control.

Choosing what AI can read and what it can do

injectguard grew out of the scanning feature in PC-PORT, a separate project that passes text extracted from binaries to AI over MCP. It was split into a standalone Rust library under the MIT license.

Executables are available for x86-64 Linux and Windows and for Intel and Apple silicon Macs. The release page also includes SHA256SUMS, containing hashes users can check against downloaded files.

The developer says rule-based detection can miss carefully reworded instructions or flag normal text. The recommendations are to treat outside content as data, minimize the permissions given to the agent, and require human confirmation for risky actions.

Scans can miss instructions. That makes the permissions granted to the AI matter too. An agent assigned research can be given read access, while actions outside that purpose, such as deleting files or sending sensitive data elsewhere, require user approval.

People use AI to delegate work. They did not also delegate it to everyone whose text the AI happens to read. injectguard is valuable because it provides a check independent of the AI’s own judgment.

View the original on Joho no Todai →