Inspiration

We were inspired by the growing reliance on AI-powered browsers and assistants that use large language models (LLMs) to interact with the web. As LLMs begin processing real-world webpages, users become vulnerable to prompt injection attacks - malicious text hidden in websites that manipulates the AI into revealing sensitive information or executing harmful instructions. We wanted to build a safety layer that protects users and LLMs from these invisible threats - essentially a “firewall for AI prompts.”

What it does

PromptShield is a lightweight web tool that scans any webpage for potential prompt injection attempts. Users simply paste a URL into our interface, and PromptShield:

  1. Fetches and cleans the webpage content, stripping away HTML, scripts, and hidden text.
  2. Analyzes the text using a specialized ML-based classifier to detect malicious or manipulative intent.
  3. Flags and displays the suspicious lines that attempt to jailbreak, extract private data, or override LLM behavior.
  4. Presents a clear report highlighting the exact lines that are potentially dangerous - so users can decide whether to trust the page.

How we built it

-FastAPI powers the backend - handling API requests, scanning logic, and returning results in real time. -Playwright fetches full, JavaScript-rendered webpages to ensure no hidden text escapes detection. -BeautifulSoup (bs4) cleans and parses HTML, extracting all visible and hidden text for analysis.

  • PyTorch runs our fine-tuned ML classifier to detect prompt injections and malicious instructions. -HTML, CSS, and JavaScript form a lightweight frontend where users paste a URL, click Scan, and instantly see flagged content.

Challenges we ran into

Extracting hidden malicious text embedded in complex or complicated HTML structures. Managing API rate limits and ensuring consistent model performance on long webpage content. Training an accurate classifier that minimizes false negatives (we did not want to miss any injection attempts.) Handling cross-origin requests (CORS) during webpage scraping and content sanitization.

Accomplishments that we're proud of

Successfully implemented an end-to-end prompt injection detection pipeline that works on live webpages. Detected real examples of jailbreak and exfiltration attempts during testing. Delivered a fully functional web app in less than 8 hours despite initial plans for a browser extension. Made AI safety accessible to everyone no installs, no extensions, just paste a link and check.

What we learned

Prompt injection attacks are surprisingly creative. We expected a few “ignore previous instructions” tricks, but nope - attackers hide instructions in HTML comments, invisible text, white-on-white fonts, or even behind tags! It felt like uncovering Easter eggs… but evil ones.

LLM safety isn’t just about the model - t’s about the input. Even the smartest AI can be fooled if it’s reading tainted text. Protecting LLMs means protecting what they see, and that’s exactly where PromptShield steps in.

Rapid prototyping = fast learning. We had to pivot from a full-on browser extension to a web app in record time. In doing so, we learned how to move fast, debug faster, and still ship something that actually works (and looks cool while doing it)

What's next for PromptShield

Extending the system into a browser extension that automatically scans pages in real-time. Building a crowdsourced false-positive feedback loop to continually improve detection accuracy. Partnering with AI browser and plugin developers to integrate PromptShield as a built-in safety layer. Expanding detection beyond text - to include multimodal prompt injections hidden in code snippets or images or videos and any other form of modality that an LLM can process.

Share this project:

Updates

Submission history