Please use this identifier to cite or link to this item:
http://kmutnb-ir.kmutnb.ac.th/jspui/handle/123456789/580| Title: | Development of a Policy-Driven Go-Based Middleware for Prompt Injection Mitigation in Large Language Model Systems การพัฒนามิดเดิลแวร์เชิงนโยบายด้วยภาษาโก สำหรับการบรรเทาการโจมตีแบบ Prompt Injection ในระบบแบบจำลองภาษาขนาดใหญ่ |
| Authors: | JATTUPLUEK USAKIJ จัตุพฤทธิ์ อุสส่าห์กิจ PONGSARUN BOONYOPAKORN พงศ์ศรัณย์ บุญโญปกรณ์ King Mongkut's University of Technology North Bangkok มหาวิทยาลัยเทคโนโลยีพระจอมเกล้าพระนครเหนือ pongsarunb@kmutnb.ac.th |
| Keywords: | Prompt Injection Policy-Driven Middleware Go LLM Security Prompt Injection มิดเดิลแวร์เชิงนโยบาย ภาษาโก การตรวจจับเชิงกฎ |
| Issue Date: | 17-Nov-2026 |
| Publisher: | King Mongkut's University of Technology North Bangkok |
| Abstract: | Prompt injection is the top-ranked risk for LLM applications. This study develops GuardRail, a policy-driven Go middleware whose rules, weights and thresholds can be changed without modifying code, and evaluates its detection performance, latency and policy flexibility.
GuardRail exposes a REST API built with Gin and runs four detection layers: obfuscation decoding, Trie-based keyword matching, regular expressions and heuristics. Layer scores are combined by weighted voting under a JSON policy to allow, flag or block a prompt.
On a 368-sample core test set, GuardRail achieved an accuracy of 0.68, precision of 0.81, recall of 0.51 and F1-score of 0.62, below the targets. On a 1,000-sample combined set its precision was 0.93 with a false positive rate of 0.03. P99 latency was 46.10 ms, within the 100 ms target, and database policy changes took effect without a restart. The middleware suits a low-latency first line of defense complemented by semantic detection. การโจมตีแบบ Prompt Injection เป็นความเสี่ยงอันดับหนึ่งของแอปพลิเคชันที่ใช้แบบจำลองภาษาขนาดใหญ่ การค้นคว้าอิสระนี้พัฒนามิดเดิลแวร์เชิงนโยบายด้วยภาษาโก ชื่อ GuardRail ที่กำหนดกฎ ค่าน้ำหนัก และค่าเกณฑ์ได้โดยไม่ต้องแก้ไขโค้ด และประเมินด้านการตรวจจับ ความหน่วง และความยืดหยุ่นของนโยบาย ระบบให้บริการผ่าน REST API ด้วย Gin มีกระบวนการตรวจจับ 4 ชั้น ได้แก่ การถอดรหัสข้อความอำพราง การจับคู่คำสำคัญด้วย Trie การจับคู่ Regular Expression และฮิวริสติก แล้วรวมคะแนนแบบถ่วงน้ำหนักตามนโยบาย JSON เพื่อตัดสินผล allow, flag หรือ block ผลการทดลองบนชุดทดสอบหลัก 368 ตัวอย่าง ได้ค่า Accuracy 0.68, Precision 0.81, Recall 0.51 และ F1-Score 0.62 ยังไม่ถึงเป้าหมาย บนชุดรวม 1,000 ตัวอย่างได้ Precision 0.93 และอัตราแจ้งเตือนผิดพลาด 0.03 ความหน่วง P99 เท่ากับ 46.10 มิลลิวินาที ผ่านเป้าหมาย และการแก้นโยบายในฐานข้อมูลมีผลโดยไม่ต้องเริ่มระบบใหม่ ระบบจึงเหมาะเป็นชั้นป้องกันแรกที่มีความหน่วงต่ำ และควรเสริมด้วยการวิเคราะห์เชิงความหมาย |
| URI: | http://kmutnb-ir.kmutnb.ac.th/jspui/handle/123456789/580 |
| Appears in Collections: | FACULTY OF INFORMATION TECHNOLOGY AND DIGITAL INNOVATION |
Files in This Item:
| File | Size | Format | |
|---|---|---|---|
| s6707031857263.pdf | 1.88 MB | Adobe PDF | View/Open |
Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.