<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amit Gupta</title>
    <description>The latest articles on DEV Community by Amit Gupta (@xamitgupta).</description>
    <link>https://dev.to/xamitgupta</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3871150%2Feca60acb-603f-44ba-aeec-18616992252b.png</url>
      <title>DEV Community: Amit Gupta</title>
      <link>https://dev.to/xamitgupta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xamitgupta"/>
    <language>en</language>
    <item>
      <title>IPI-Scanner: Detecting Indirect Prompt Injection Attacks Before Your LLM Reads Them</title>
      <dc:creator>Amit Gupta</dc:creator>
      <pubDate>Fri, 10 Apr 2026 07:11:17 +0000</pubDate>
      <link>https://dev.to/xamitgupta/ipi-scanner-detecting-indirect-prompt-injection-attacks-before-your-llm-reads-them-2jba</link>
      <guid>https://dev.to/xamitgupta/ipi-scanner-detecting-indirect-prompt-injection-attacks-before-your-llm-reads-them-2jba</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcbsxrbtf5kt0tdpem4e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcbsxrbtf5kt0tdpem4e.jpg" alt="IPI-Scanner" width="800" height="600"&gt;&lt;/a&gt;&lt;em&gt;An open-source security tool for RAG pipelines and agentic AI systems&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: The Silent Attack Vector
&lt;/h2&gt;

&lt;p&gt;You've probably heard about prompt injection attacks. But here's what most people don't realize: &lt;strong&gt;80% of prompt injection attacks are indirect&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They don't target your prompt. They target your &lt;em&gt;data&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;An attacker poisons a document that your RAG system later retrieves. When your LLM reads it, hidden instructions execute silently. No alerts. No warnings. Just compromised output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real Examples
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;EchoLeak&lt;/strong&gt;: Malicious email to a Copilot user leaked passwords via invisible instructions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HashJack&lt;/strong&gt;: URL fragments with hidden instructions steered AI summaries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Perplexity Comet&lt;/strong&gt;: Reddit posts with invisible text exfiltrated user data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-53773&lt;/strong&gt;: GitHub Copilot RCE via PR description injection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cost? &lt;strong&gt;$2.3 billion in global losses&lt;/strong&gt; (2025). OWASP lists prompt injection as the #1 vulnerability in LLM systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solution: IPI-Scanner
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;IPI-Scanner&lt;/strong&gt; – an open-source tool that detects indirect prompt injection attacks in documents &lt;em&gt;before&lt;/em&gt; they reach your LLM.&lt;/p&gt;

&lt;p&gt;Think of it as a security checkpoint for your data pipeline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;ipi-scanner
ipi-scan document.pdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;IPI-Scanner uses a 3-tier detection system:&lt;/p&gt;

&lt;h3&gt;
  
  
  Tier 1: Pattern Matching (Fast)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;50+ regex patterns across 15 attack categories&lt;/li&gt;
&lt;li&gt;Detection in &amp;lt;100ms per document&lt;/li&gt;
&lt;li&gt;60-80% accuracy&lt;/li&gt;
&lt;li&gt;No API calls needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tier 2: Semantic Analysis (Accurate)
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Coming in v0.2&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude-powered analysis for borderline cases&lt;/li&gt;
&lt;li&gt;85%+ accuracy&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tier 3: Simulation (Proof)
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Coming in v0.3&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proves attacks actually execute&lt;/li&gt;
&lt;li&gt;90%+ accuracy&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What It Detects
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Critical (40 points each)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data exfiltration attempts&lt;/li&gt;
&lt;li&gt;Credential/API key extraction&lt;/li&gt;
&lt;li&gt;Sensitive file access requests&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  High (25 points each)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;System prompt override&lt;/li&gt;
&lt;li&gt;Context manipulation&lt;/li&gt;
&lt;li&gt;Authentication bypass&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Medium (10 points each)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;URL fragment injection&lt;/li&gt;
&lt;li&gt;Hidden/steganographic instructions&lt;/li&gt;
&lt;li&gt;Policy override attempts&lt;/li&gt;
&lt;li&gt;Social engineering&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Low (5 points each)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Tool execution manipulation&lt;/li&gt;
&lt;li&gt;Memory poisoning&lt;/li&gt;
&lt;li&gt;Citation injection&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Real Attack Validation
&lt;/h2&gt;

&lt;p&gt;IPI-Scanner has been tested against real CVEs from 2025-2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attack&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EchoLeak&lt;/td&gt;
&lt;td&gt;✅ Email-based data exfiltration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HashJack&lt;/td&gt;
&lt;td&gt;✅ URL fragment injection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Perplexity Comet&lt;/td&gt;
&lt;td&gt;✅ Invisible text injection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CVE-2025-53773&lt;/td&gt;
&lt;td&gt;✅ System prompt override&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Gemini Calendar&lt;/td&gt;
&lt;td&gt;✅ Invite-based manipulation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ChatGPT Google Drive&lt;/td&gt;
&lt;td&gt;✅ File extraction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zero-Click MCP RCE&lt;/td&gt;
&lt;td&gt;✅ Metadata poisoning&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Detection rate: 85%+ on known attacks&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;False positive rate: &amp;lt;5% on benign documents&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Usage Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Scan a single file:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ipi-scan document.pdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Scan a directory:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ipi-scan ./documents/ &lt;span class="nt"&gt;--recursive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Get JSON output (for automation):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ipi-scan file.pdf &lt;span class="nt"&gt;--output&lt;/span&gt; json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Generate HTML report:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ipi-scan ./docs &lt;span class="nt"&gt;--output&lt;/span&gt; html &lt;span class="nt"&gt;--output-file&lt;/span&gt; report.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  With context (RAG pipeline):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ipi-scan file.pdf &lt;span class="nt"&gt;--context&lt;/span&gt; rag
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  In Python:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ipi_scanner&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Scanner&lt;/span&gt;

&lt;span class="n"&gt;scanner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Scanner&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scanner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scan_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;document.pdf&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;risk_assessment&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;score&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# 0-100 risk score
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Risk Scoring
&lt;/h2&gt;

&lt;p&gt;Results are scored 0-100 with context awareness:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;75-100 (Red):&lt;/strong&gt; BLOCK - Do not feed to your LLM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;50-74 (Orange):&lt;/strong&gt; REVIEW - Check before RAG ingestion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;25-49 (Yellow):&lt;/strong&gt; CAUTION - Monitor for suspicious behavior&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0-24 (Green):&lt;/strong&gt; SAFE - Proceed normally&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Context Multipliers
&lt;/h3&gt;

&lt;p&gt;Risk increases based on deployment context:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Untrusted source: 1.3x&lt;/li&gt;
&lt;li&gt;RAG pipeline: 1.5x&lt;/li&gt;
&lt;li&gt;Agent with tool access: 2.0x&lt;/li&gt;
&lt;li&gt;Agent with API access: 2.5x&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Open-Source?
&lt;/h2&gt;

&lt;p&gt;IPI detection is too important to be proprietary. Organizations need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand how detection works&lt;/li&gt;
&lt;li&gt;Audit the patterns&lt;/li&gt;
&lt;li&gt;Contribute improvements&lt;/li&gt;
&lt;li&gt;Build on it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;IPI-Scanner is MIT-licensed and welcomes contributions.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  v0.2.0 (coming soon)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Claude semantic analysis (Tier 2)&lt;/li&gt;
&lt;li&gt;Multi-language support&lt;/li&gt;
&lt;li&gt;Custom pattern loader&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  v0.3.0 (roadmap)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Simulation-based validation (Tier 3)&lt;/li&gt;
&lt;li&gt;MCP server integration&lt;/li&gt;
&lt;li&gt;Real-time monitoring&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;ipi-scanner
ipi-scan &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/amitgupta-ag/ipi-scanner" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/ipi-scanner/" rel="noopener noreferrer"&gt;PyPI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/amitgupta-ag/ipi-scanner/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;Contributing Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Questions?
&lt;/h2&gt;

&lt;p&gt;Drop them in the comments. Happy to discuss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detection accuracy&lt;/li&gt;
&lt;li&gt;Attack patterns&lt;/li&gt;
&lt;li&gt;Integration strategies&lt;/li&gt;
&lt;li&gt;Contributing guidelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is v0.1.0, so feedback is invaluable as we grow.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Happy scanning! 🔒&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
