Inspiration The number that started everything: 87–94%. That is the share of AI-generated code that ships with security flaws — not because developers are careless, but because the models themselves are trained on years of insecure StackOverflow answers, legacy patterns, and code that was never written with production security in mind. Tools like GitHub Copilot and Amazon CodeWhisperer have fundamentally changed how software is written. But they have also introduced a silent, systemic vulnerability into the modern software supply chain. The deeper problem is not that AI generates bad code. It is that developers have no security layer sitting between their intent and the model's output. They write a prompt. The model generates code. That code goes to production. Nobody checked it in between. PromptArmor was built to be that layer. Not a linter that runs after the damage is done. Not a template library of "secure prompt tips." A real compiler — one that understands what you are trying to build, maps it to a live threat model, injects context-specific security constraints before the model ever sees your prompt, and then validates, scores, and self-heals the output until it meets a measurable security threshold. The inspiration was simple: if compilers have had type safety and memory safety for decades, why does AI-generated code have no security safety layer at the prompt level?

⚙️ What It Does PromptArmor runs every developer prompt through a five-layer security compilation pipeline:

  1. Dynamic Threat Modeling — detects the attack surface from your raw intent (file upload, authentication, payments, SQL, APIs, cloud infra, AI agents) and surfaces the probable vulnerability classes before a single line of code is generated.
  2. Context-Aware Prompt Compilation — injects precise, non-generic security constraints mapped to the detected context. File upload prompts get extension whitelisting, MIME validation, and ZIP bomb protection. Auth prompts get argon2 enforcement, session entropy rules, and brute-force rate limiting. Payment prompts get PCI-DSS constraints. The compiler knows the difference.
  3. Self-Healing Feedback Loop — after the model generates code, PromptArmor runs a static analysis pass against known vulnerability signatures. If issues are detected, it automatically refines the prompt and regenerates — up to three iterations — until the output is clean or the delta is minimized.
  4. Security Benchmarking Dashboard — a live before/after comparison showing vulnerability reduction percentage, OWASP category coverage, and a security score delta across six attack surfaces, rendered as a radar chart.
  5. Multi-Model Compatibility — works across Gemini 2.5, Claude Sonnet, and GPT-4o without requiring the user to manage a single API key.

🔨 How We Built It LayerTechnologyFrontendReact + TypeScriptStylingTailwind CSSThreat Model EngineClient-side deterministic rule engine (JS)Static Analysis SimulationRegex-based vulnerability pattern matcherCode GenerationGemini 2.5 via APIVisualizationRecharts — radar chart + animated score deltaPrompt Diff ViewCustom split-pane editor with injection highlightsSelf-Healing LoopIterative API call pipeline with diff tracking The threat modeling and prompt compilation layers are entirely deterministic and client-side — meaning the security logic is auditable, not a black box. The AI is used for code generation only. The security intelligence is human-defined, OWASP-mapped, and version-controlled.

🚧 Challenges We Ran Into

  1. Static rules vs. contextual nuance. The first version of the compilation engine used flat keyword matching. It broke immediately on ambiguous prompts. We rebuilt it as a layered inference system — first detecting the primary attack surface, then cross-referencing secondary context signals before injecting constraints.
  2. Measuring security reliably without a full SAST engine. Running Semgrep or Bandit server-side was out of scope for a one-day build. The solution was a curated, high-signal regex pattern library targeting the most exploitable vulnerability signatures — eval(), raw SQL concatenation, hardcoded secret patterns, missing input validation structures — that gave judges measurable output without requiring infrastructure.
  3. Making the self-healing loop deterministic. The feedback loop between generation, scanning, and re-prompting had to be constrained. Uncapped, it became an infinite loop on ambiguous outputs. Capping at three iterations with a diminishing-returns threshold made it both reliable and honest about its limits.
  4. Showing the delta, not just the output. The hardest UX problem was making the security improvement visible to a non-technical judge in under ten seconds. The benchmarking dashboard and animated score counter solved this — judges see a number go from 34% to 91% in real time. That lands harder than any explanation.

🔭 What's Next — The Roadmap PromptArmor's ceiling is not a hackathon demo. The architecture maps directly onto a real enterprise product trajectory: Phase 1 — Prompt Firewall (current) Browser-based compiler for individual developers. Works today. Phase 2 — IDE Plugin VS Code and JetBrains extensions that intercept Copilot/CodeWhisperer prompts before they reach the model — inline, invisible, automatic. Phase 3 — CI/CD Integration A pre-commit hook and GitHub Action that scans AI-assisted commits for vulnerability signatures and flags prompt-origin code for review. Phase 4 — Enterprise AI Governance Layer Team-level prompt policy enforcement — org-defined security rules that compile into every developer's AI workflow automatically. Audit logs. Compliance reporting. OWASP coverage dashboards per team. Phase 5 — Adaptive Learning The compiler learns from false positives and team-specific codebases, improving context detection accuracy over time. The market this addresses — DevSecOps tooling for AI-assisted development — does not have a dominant player yet. PromptArmor is positioned to be the security middleware that every AI coding workflow will eventually require.

🏷️ Tags for Devpost prompt-engineering devsecops ai-security owasp code-generation gemini static-analysis cybersecurity developer-tools ai-governance

📽️ Demo Video Script (60–90 seconds)

"87% of AI-generated code ships with security flaws. PromptArmor fixes that before the model ever generates a line." Show: raw prompt entered → threat model animates in → compiled prompt diff appears → code generates → self-healing loop runs → benchmark dashboard shows score jump from ~30% to ~90% → end on the radar chart fully covered. Final line: "Not a prompt rewriter. A security compiler for the AI development era."

Paste each section directly into the corresponding Devpost field. The elevator pitch goes in the short description. Everything else maps one-to-one to the standard Devpost project sections.Sonnet 4.6

Built With

Share this project:

Updates