PromptShield — Resilient Prompt Copilot for AI Apps

Inspiration

Modern AI applications are incredibly powerful, but they often fail in frustrating ways. A slow or unavailable LLM, a failing MCP server, or an API outage can completely break the user experience. Most tools either crash silently, show confusing errors, or leave users stuck waiting with no recovery path.

We wanted to explore a different question:

What if AI applications could fail gracefully instead of failing completely?

PromptShield was inspired by the idea of building a resilience layer for AI-powered workflows. Instead of treating outages as fatal errors, PromptShield focuses on preserving productivity through fallback behaviors, recovery timelines, and graceful degradation.

At the same time, weak prompting remains a common issue for users interacting with AI systems. We combined both ideas into a single product: a browser-based prompt copilot that improves prompts while staying resilient during infrastructure failures.


What it does

PromptShield is a browser extension that overlays AI platforms like ChatGPT, Claude, and Gemini and helps users transform weak prompts into structured, actionable prompts.

The system supports multiple enhancement modes:

  • General assistance
  • Resume optimization
  • Coding support
  • Research assistance

What makes PromptShield different is its resilience-focused architecture.

The project includes:

  • LLM failure simulation
  • MCP/tool failure simulation
  • Slow response / brownout simulation
  • Recovery timelines
  • Fallback prompt generation
  • User-visible recovery states

Instead of crashing during failures, PromptShield:

  • explains what failed,
  • switches to fallback behavior,
  • preserves useful output,
  • and continues helping the user.

How we built it

PromptShield was built using:

Frontend

  • Chrome Extension
  • JavaScript
  • HTML/CSS

The extension injects a floating PromptShield widget into AI websites using a MutationObserver so it survives dynamic DOM changes.

Backend

  • FastAPI
  • Python

The backend handles:

  • prompt enhancement,
  • resilience logic,
  • fallback routing,
  • chaos simulation,
  • and recovery tracking.

AI Layer

  • TrueFoundry AI Gateway integration
  • OpenAI-compatible API routing
  • Local fallback prompt templates

The architecture is designed around resilient request handling:

Browser AI App
      ↓
PromptShield Extension
      ↓
FastAPI Backend
      ↓
TrueFoundry AI Gateway
      ↓
Primary LLM → Fallback LLM
      ↓
Local Template Recovery

If the primary provider fails, PromptShield gracefully falls back to local prompt templates instead of returning unusable errors.


Challenges we ran into

One of the biggest technical challenges was browser stability.

AI platforms like ChatGPT constantly re-render their UI, which caused injected extension components to disappear repeatedly. We solved this by using a MutationObserver-based reinjection strategy that continuously monitors DOM changes and restores the PromptShield interface.

Another challenge was designing resilience behavior that still felt useful to users. We wanted the system to:

  • recover gracefully,
  • avoid raw infrastructure errors,
  • and still generate meaningful output even when providers fail.

Integrating and debugging AI Gateway routing and authorization was also an important learning experience while building the resilient backend flow.


Accomplishments that we're proud of

We are proud that PromptShield:

  • successfully works as a browser extension overlay,
  • improves prompts in multiple domains,
  • simulates real-world infrastructure failures,
  • demonstrates graceful degradation,
  • and maintains a usable experience during outages.

We are especially proud of the resilience timeline and fallback UX because it transforms infrastructure failures into understandable user-facing recovery behavior.


What we learned

This project changed the way we think about AI systems.

We learned that resilience is not only about retries and backend infrastructure. User experience during failure matters just as much as successful responses.

We also learned:

  • how browser extensions behave on highly dynamic AI platforms,
  • how to structure resilient AI request pipelines,
  • and how to design fallback systems that remain genuinely useful. What's next for PromptShield

Future plans include:

  • full production-ready TrueFoundry Virtual Model routing,
  • multi-provider failover chains,
  • persistent user memory,
  • prompt history and analytics,
  • MCP server integrations,
  • enterprise prompt governance,
  • and team collaboration features.

Long term, we envision PromptShield evolving into a resilient orchestration layer for AI-powered productivity systems.

Built With

Share this project:

Updates