Inspiration
As AI coding assistants become part of everyday software development, we noticed a serious problem: AI can generate working code quickly, but not always securely. Many developers focus on getting functional output while unintentionally introducing vulnerabilities such as SQL injection, insecure authentication, and unsafe API handling.
We wanted to transform this invisible security problem into something interactive, competitive, and educational. That idea became Clash of Prompts — a real-time AI prompt battle arena where developers compete to create the most secure AI-generated code under pressure.
The project was inspired by:
Competitive esports tournaments Hackathons and cybersecurity CTFs The rapid growth of AI-assisted development The increasing need for secure prompt engineering
Our goal was to make secure AI prompting both fun and measurable.
What the Project Does
Clash of Prompts is a live Battle Royale-style platform where two developers compete in fast-paced rounds.
Each participant:
Writes a single AI prompt Generates code using an AI model Receives a live security analysis score Competes based on secure coding quality
The platform evaluates:
Security vulnerabilities Secure coding best practices Prompt efficiency Code quality
A real-time leaderboard updates instantly, creating a live spectator experience for both online and in-person audiences.
How We Built It Frontend
We designed a responsive real-time dashboard using:
React.js Tailwind CSS WebSocket-based live updates
The interface includes:
Prompt editor Live AI output viewer Security scoring dashboard Tournament brackets Real-time leaderboard Backend
The backend was built using:
Node.js / Express Python security analysis services REST APIs WebSocket communication
The backend manages:
Matchmaking Prompt submissions AI model communication Live scoring Tournament progression AI Integration
We integrated AI code generation APIs to:
Generate code from prompts Compare outputs in real time Analyze how prompt quality affects security
Each generated response is scanned using automated security analysis tools.
Security Engine
The core innovation of the project is the live security scoring system.
The scoring formula combines:
FinalScore=SecurityScore+BestPracticesScore+PromptEfficiency
The system checks for:
SQL Injection XSS vulnerabilities Hardcoded secrets Unsafe deserialization Authentication weaknesses Missing input validation Challenges We Faced
- Real-Time Code Analysis
One major challenge was analyzing AI-generated code instantly while maintaining accurate scoring. Security scanning tools can be computationally expensive, so we optimized the pipeline for low latency.
- Fair Scoring
Different prompts can produce very different coding styles. Creating a fair and balanced scoring system that rewards both security and prompt quality required extensive testing.
- AI Output Variability
AI models are unpredictable. The same prompt can produce slightly different outputs each time. We had to normalize scoring and build safeguards against inconsistent results.
- Tournament Synchronization
Managing live battles, timers, brackets, spectators, and online participants simultaneously required stable real-time communication architecture.
What We Learned
Through this project, we learned:
Prompt engineering directly impacts software security Secure AI-assisted development is an emerging skill Real-time systems require careful event synchronization Competitive gamification can improve cybersecurity awareness AI-generated code still requires strong human oversight
We also gained hands-on experience with:
AI API integration Secure coding analysis Real-time web applications WebSockets Tournament system architecture Scalable backend design Future Improvements
We plan to expand Clash of Prompts with:
Multiple AI model support Team battles Public rankings Community tournaments AI coaching assistants Advanced vulnerability visualization Educational training modes
We also want to build an AI mentor that explains why generated code is insecure and suggests safer prompt patterns.
Conclusion
Clash of Prompts transforms secure coding from a hidden backend concern into a live competitive experience. By combining AI, cybersecurity, and real-time gaming elements, the project demonstrates how prompt engineering can directly influence the safety of modern software systems.
Our vision is simple:
Better prompts create safer software.
Built With
- ai
- amazon-web-services
- cybersecurity
- docker
- express.js
- node.js
- openai
- postgresql
- prompt-engineering
- python
- react
- secure-coding
- socket.io
- tailwindcss
- websocket
Log in or sign up for Devpost to join the conversation.