QRGuard scans every uploaded image before it reaches the AI, decodes each QR (multi-frame + multi-QR-per-frame), and classifies each payload against 18 built-in prompt-injection patterns plus custom patterns you supply.
Four Server Actions: ContainsQRCode for blanket rejection; ScanImage for per-content filtering; DecodeAllQRCodes for raw inspection; RedactQRCodes to overwrite suspicious QRs in place while preserving legitimate product-code QRs and the original image format.
Stateless, 1,322 automated tests, 30+ image formats. Layer 1 Priority 4 of the multimodal AI preprocessing pipeline — pair with FileMetadataStrip and StegoGuard.
Micro QR - not supported on ZXing.Net 0.16.9. BarcodeFormat.MICRO_QR_CODE is not exposed. Standard QR (Model 1 and Model 2) is fully supported by the base QR_CODE detector.
Content length heuristic - decoded content exceeding the configured length threshold (default 500 chars) is flagged as suspicious regardless of actual content, which may produce false positives for long-URL QR codes. Tune via SuspiciousLengthThreshold on ScanImage and RedactQRCodes (0 = default 500; positive = custom, floor 20; set very high to effectively disable while pattern matching keeps running).
No PDF or Office document scanning - QR codes inside PDFs, Word, Excel, or PowerPoint files are not detected. Extract each page as an image first, then call ScanImage on each raster.
MIT License
Copyright (c) 2026 AR
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.