From 21f3f8e33d3d989e87e6f5d1510f820a7ee5bf0b Mon Sep 17 00:00:00 2001 From: EP Date: Sat, 23 Aug 2025 10:27:44 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20NEW:=20Added=20InfoValidator=20f?= =?UTF-8?q?eature=20as=20dual-purpose=20platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 352 ++++++++++++++++--------------- demo-data.js | 579 +++++++++++++++++++++++++++++++-------------------- index.html | 405 ++++++++++++++++++++++------------- script.js | 278 +++++++++++++++++++++++++ styles.css | 86 ++++++++ 5 files changed, 1168 insertions(+), 532 deletions(-) diff --git a/README.md b/README.md index a1a0cf2..3a05960 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,53 @@ -# InfoValidator 🔍✨ +# 🚀 LeakHub - AI System Prompt Discovery Platform -**The Universal Platform for Crowd-Sourced Information Verification** +**The community hub for crowd-sourced system prompt leak verification. CL4R1T4S!** -A community-driven web platform for discovering, submitting, verifying, and analyzing any type of information claim. From AI system prompts to code algorithms, data facts to documents - if it can be verified, it belongs here! +## 🌟 What is LeakHub? -## 🌟 Vision +LeakHub is a revolutionary web platform that enables the community to discover, submit, verify, and analyze AI system prompt leaks. It's designed to promote transparency in AI systems through crowdsourced verification and community-driven discovery. -**Humans + AI = Truth!** InfoValidator combines the power of human intelligence with AI analysis to create the most comprehensive information verification platform ever built. +## ✨ Features -## 🚀 Features +### 🔍 **Core Functionality** +- **Submit Leaks**: Submit suspected AI system prompt leaks with detailed metadata +- **Compare & Verify**: Advanced comparison algorithms to verify authenticity +- **Community Library**: Browse and search through all submitted leaks +- **Confidence Scoring**: Automatic confidence assessment based on content analysis -### Core Functionality -- **📤 Universal Submission System**: Submit any type of information claim (AI prompts, code, data, documents, images, APIs, etc.) -- **🔍 Advanced Comparison Engine**: Compare multiple claims with AI-powered similarity analysis -- **✅ Community Verification**: Crowd-sourced validation with confidence scoring -- **🏆 Gamification**: Points, achievements, and leaderboards to encourage participation +### 🎯 **Target Types Supported** +- 🤖 **AI Models** (GPT-4, Claude, Gemini, etc.) +- 📱 **Apps/Interfaces** (Cursor, GitHub Copilot, etc.) +- 🔧 **Tools/Functions** (Code Interpreter, WebPilot, etc.) +- 🤝 **AI Agents** (AutoGPT, BabyAGI, etc.) +- 🔌 **Plugins/Extensions** (Browser extensions, IDE plugins, etc.) +- 🛠️ **Custom GPTs/Bots** (Custom implementations) -### Information Categories -- **🤖 AI System Prompts**: Discover and verify AI model system instructions -- **💻 Code/Algorithms**: Verify code snippets, algorithms, and technical implementations -- **📊 Data/Facts**: Validate datasets, statistics, and factual information -- **📄 Documents/Text**: Verify official documents, texts, and written content -- **🖼️ Images/Visual**: Validate visual content and image-based claims -- **🎵 Audio/Video**: Verify multimedia content and audio/video claims -- **🔌 APIs/Endpoints**: Validate API specifications and endpoint information -- **🛠️ Custom Claims**: Submit any other type of verifiable information +### 🏆 **Gamification & Community** +- **Leaderboard**: Track top contributors and achievements +- **Daily Challenges**: Compete in daily leak hunting challenges +- **Achievement System**: Unlock badges for notable contributions +- **Points System**: Earn points for submissions, verifications, and discoveries -### Community Features -- **💬 Real-time Chat**: Collaborate with other validators in live chat -- **🎯 Daily Challenges**: Complete verification challenges for bonus rewards -- **💰 Bounty System**: Request specific information validation with point rewards -- **📈 Analytics Dashboard**: Track platform statistics and growth trends -- **👤 User Profiles**: Detailed validator profiles with achievements and stats +### 🎯 **Requests & Bounties** +- **Community Requests**: Request specific targets for leak hunting +- **Voting System**: Vote on which targets to prioritize +- **Bounty System**: Offer points for high-priority discoveries +- **Trending Requests**: See what the community wants most -### Technical Features -- **🔒 Security**: XSS protection, security headers, and data sanitization -- **📱 Responsive Design**: Works perfectly on desktop, tablet, and mobile -- **⚡ Performance**: Optimized for speed with modern web technologies -- **🔄 Auto-save**: Never lose your work with automatic data saving -- **📤 Export/Import**: Backup and restore your data easily +### 📊 **Advanced Analytics** +- **Similarity Metrics**: Character match, word match, structure match, core similarity +- **Consensus View**: Identify common elements across multiple submissions +- **Verification Tracking**: Track verification status and confidence levels +- **Statistics Dashboard**: Real-time platform statistics -## 🛠️ Tech Stack +## 🚀 Getting Started -- **Frontend**: HTML5, CSS3, JavaScript (ES6+) -- **Build Tool**: Vite (for development and production builds) -- **Data Storage**: LocalStorage with database abstraction layer -- **Deployment**: GitHub Pages, Vercel, Netlify ready -- **Security**: Comprehensive security headers and XSS protection +### Prerequisites +- **For Development**: Node.js 18+ and npm +- **For Production**: Modern web browser (Chrome, Firefox, Safari, Edge) +- **For Backend**: Optional - MongoDB, Supabase, or Firebase -## 🚀 Quick Start - -### Development +### Quick Start (Development) ```bash # Clone the repository git clone https://github.com/elder-plinius/LEAKHUB.git @@ -62,159 +59,188 @@ npm install # Start development server npm run dev -# Open http://localhost:3000/LEAKHUB/ +# Open http://localhost:3000 ``` -### Production +### Quick Start (Production) +1. **GitHub Pages**: Push to main branch - auto-deploys! +2. **Vercel**: `npm i -g vercel && vercel` +3. **Netlify**: `npm install -g netlify-cli && netlify deploy` + +### Local Testing ```bash # Build for production npm run build # Preview production build npm run preview + +# Serve static files +npm run serve ``` -## 📊 Platform Statistics +### Quick Start Guide -- **Active Claims**: Real-time count of submitted information claims -- **Total Submissions**: Total number of claims submitted to the platform -- **Verified Claims**: Number of claims with high confidence scores -- **Active Validators**: Number of users actively participating +#### 1. **Submit Your First Leak** +1. Fill in your identifier (username) +2. Select the target type (AI Model, App, Tool, etc.) +3. Enter the target name and URL +4. Paste the suspected system prompt +5. Add context and access requirements +6. Submit and earn points! + +#### 2. **Compare Submissions** +1. Select two different submissions from the dropdowns +2. Click "Compare" to analyze similarity +3. Review the detailed metrics and consensus view +4. High similarity automatically boosts confidence scores + +#### 3. **Join the Community** +1. Click "View Leaderboard" to see top contributors +2. Check out "Requests & Challenges" for daily missions +3. Vote on community requests +4. Track your achievements and progress + +## 🎮 How It Works + +### **Submission Process** +1. **Content Analysis**: Automatic confidence scoring based on prompt patterns +2. **First Discovery Detection**: Identifies if this is the first submission for a target +3. **Point Allocation**: Awards points for submissions, discoveries, and verifications +4. **Metadata Tracking**: Stores access requirements, context, and tool information + +### **Verification System** +1. **Multi-Metric Comparison**: Uses character, word, structure, and core similarity +2. **Consensus Building**: Identifies common elements across submissions +3. **Confidence Boosting**: High similarity automatically increases confidence scores +4. **Verification Milestones**: Tracks when leaks reach verified status + +### **Gamification Mechanics** +- **Base Points**: 10 points per submission +- **First Discovery**: 100 points + 50 bonus for non-model targets +- **Tool Prompts**: 30 bonus points for comprehensive submissions +- **Verification**: 20 points per verification + 50 bonus for reaching verified status +- **Daily Challenges**: 400-700 points for completing daily missions + +## 🎨 Design Features + +### **Modern UI/UX** +- **Cyberpunk Aesthetic**: Dark theme with neon accents and gradients +- **Responsive Design**: Works perfectly on desktop, tablet, and mobile +- **Smooth Animations**: Floating grid background and interactive elements +- **Intuitive Navigation**: Clear sections and easy-to-use interface + +### **Visual Elements** +- **Status Indicators**: Real-time statistics and progress tracking +- **Badge System**: Visual indicators for access requirements and features +- **Color Coding**: Different colors for different target types and confidence levels +- **Interactive Elements**: Hover effects, transitions, and feedback + +## 🔧 Technical Details + +### **Frontend Technologies** +- **HTML5**: Semantic markup and modern structure +- **CSS3**: Advanced styling with animations and responsive design +- **JavaScript (ES6+)**: Full application logic and data management +- **Vite**: Fast build tool and development server +- **LocalStorage**: Client-side data persistence with backend fallback + +### **Backend & Deployment** +- **GitHub Actions**: Automated CI/CD pipeline +- **Vercel/Netlify**: Serverless deployment with functions +- **Database Abstraction**: Support for localStorage, MongoDB, Supabase, Firebase +- **API Layer**: RESTful endpoints with CORS support + +### **Key Algorithms** +- **Text Normalization**: Standardized text processing for comparison +- **Similarity Metrics**: Multiple algorithms for comprehensive analysis +- **Levenshtein Distance**: String similarity calculation +- **Phrase Matching**: Sliding window approach for common phrase detection + +### **Data Management** +- **Hybrid Storage**: localStorage with optional backend persistence +- **JSON Serialization**: Efficient data storage and retrieval +- **Real-time Updates**: Instant UI updates and statistics +- **Data Validation**: Input validation and error handling +- **Export/Import**: Full data backup and restore functionality ## 🎯 Use Cases -### For Researchers -- Verify AI system prompts and model behaviors -- Validate technical implementations and algorithms -- Cross-reference data sources and factual claims +### **For Researchers** +- Document and verify AI system prompts +- Compare different implementations +- Track prompt evolution over time +- Build comprehensive prompt databases -### For Developers -- Verify API specifications and endpoint details -- Validate code snippets and implementation patterns -- Compare different technical approaches +### **For Developers** +- Understand AI system behaviors +- Debug prompt-related issues +- Learn from existing implementations +- Contribute to AI transparency -### For Journalists -- Verify official documents and statements -- Validate data sources and statistical claims -- Cross-check information from multiple sources - -### For Students -- Verify educational content and academic claims -- Validate research findings and data -- Learn verification techniques and critical thinking - -## 🔧 Configuration - -### Environment Variables -```bash -# Database configuration (for future backend integration) -DATABASE_TYPE=localStorage # localStorage, mongodb, supabase, firebase -API_URL=https://api.infovalidator.com -JWT_SECRET=your-secret-key - -# Feature flags -ENABLE_CHAT=true -ENABLE_ANALYTICS=true -ENABLE_EXPORT=true -``` - -### Security Settings -- **Content Security Policy**: Comprehensive CSP headers -- **XSS Protection**: Input sanitization and output encoding -- **HTTPS Enforcement**: Secure headers for production -- **Data Validation**: Client-side and server-side validation - -## 📈 Analytics & Insights - -### Platform Analytics -- **Claim Distribution**: Breakdown by category and type -- **Growth Trends**: Submission and user growth over time -- **Top Validators**: Most active and accurate contributors -- **Verification Rates**: Success rates for different claim types - -### User Analytics -- **Personal Stats**: Individual validator performance -- **Achievement Tracking**: Unlocked badges and milestones -- **Activity Timeline**: Recent submissions and verifications -- **Comparison History**: Past comparison analyses - -## 🏆 Achievement System - -### Badges Available -- **🔰 First Blood**: Submit your first claim -- **🔍 Discoverer**: Submit 5 verified claims -- **✅ Verifier**: Verify 10 claims with high accuracy -- **🏆 Expert**: Achieve 1000+ total points -- **💎 Diamond**: Submit 50+ claims with 95%+ confidence -- **🚀 Pioneer**: Be first to discover 10 claims -- **🤝 Collaborator**: Participate in 20+ comparisons -- **📊 Analyst**: Complete 5 daily challenges -- **🎯 Bounty Hunter**: Earn 500+ bounty points -- **🌟 Legend**: Reach the top 1% of validators - -## 🔮 Future Roadmap - -### Phase 2: Enhanced Verification -- **AI-Powered Analysis**: Advanced ML models for claim verification -- **Blockchain Integration**: Immutable verification records -- **API Ecosystem**: Public API for third-party integrations -- **Mobile App**: Native iOS and Android applications - -### Phase 3: Advanced Features -- **Real-time Collaboration**: Live editing and verification sessions -- **Expert Networks**: Domain-specific validator communities -- **Automated Fact-checking**: AI-driven claim verification -- **Integration APIs**: Connect with external verification services - -### Phase 4: Enterprise Features -- **Team Management**: Organizational accounts and permissions -- **Advanced Analytics**: Detailed reporting and insights -- **Custom Workflows**: Configurable verification processes -- **API Marketplace**: Third-party verification service integrations +### **For Community** +- Participate in AI transparency efforts +- Compete in daily challenges +- Build reputation and achievements +- Help verify and validate discoveries ## 🤝 Contributing -We welcome contributions from the community! Here's how you can help: +### **How to Contribute** +1. **Submit Leaks**: Share discovered system prompts +2. **Verify Submissions**: Compare and verify existing leaks +3. **Request Targets**: Suggest new targets for the community +4. **Vote on Requests**: Help prioritize community goals +5. **Report Issues**: Help improve the platform -### Development -1. Fork the repository -2. Create a feature branch (`git checkout -b feature/amazing-feature`) -3. Commit your changes (`git commit -m 'Add amazing feature'`) -4. Push to the branch (`git push origin feature/amazing-feature`) -5. Open a Pull Request +### **Best Practices** +- **Be Accurate**: Only submit genuine system prompts +- **Provide Context**: Include how you obtained the prompt +- **Add Metadata**: Include access requirements and URLs +- **Verify Others**: Help verify community submissions +- **Respect Privacy**: Don't submit private or sensitive information -### Content -- Submit new information claims for verification -- Participate in community discussions -- Help verify existing claims -- Suggest new features and improvements +## 🔮 Future Enhancements -### Documentation -- Improve documentation and guides -- Add examples and tutorials -- Translate content to other languages -- Create video tutorials and demos +### **Planned Features** +- **Advanced Analytics**: Machine learning-based similarity detection +- **Mobile App**: Native mobile application +- **Real-time Collaboration**: Live collaboration features +- **Advanced Export**: Data export in various formats (CSV, JSON, API) +- **User Authentication**: Secure user accounts and profiles +- **Social Features**: Comments, discussions, and community forums + +### **Backend Integration** +- **Database Support**: MongoDB, PostgreSQL, Firebase integration +- **API Access**: RESTful API for programmatic access +- **Real-time Updates**: WebSocket support for live updates +- **Email Notifications**: Automated notifications and alerts +- **Advanced Security**: JWT authentication and rate limiting + +### **Community Features** +- **User Profiles**: Detailed user profiles and statistics +- **Discussion Forums**: Community discussions and analysis +- **Expert Verification**: Expert review system +- **Bounty Marketplace**: Advanced bounty and reward system +- **Achievement System**: Expanded badges and rewards ## 📄 License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +This project is open source and available under the MIT License. See the LICENSE file for details. ## 🙏 Acknowledgments -- **Open Source Community**: For the amazing tools and libraries that make this possible -- **Early Validators**: The community members who helped shape the platform -- **AI Researchers**: For inspiring the verification methodologies -- **Security Experts**: For guidance on platform security and best practices +- **AI Research Community**: For inspiration and feedback +- **Open Source Contributors**: For tools and libraries used +- **Early Testers**: For valuable feedback and suggestions +- **CL4R1T4S Community**: For the vision of AI transparency ## 📞 Support -- **Documentation**: [docs.infovalidator.com](https://docs.infovalidator.com) -- **Community**: [community.infovalidator.com](https://community.infovalidator.com) -- **Email**: support@infovalidator.com -- **Discord**: [Join our Discord server](https://discord.gg/infovalidator) +- **Issues**: Report bugs and feature requests via GitHub issues +- **Discussions**: Join community discussions +- **Documentation**: Check the inline documentation and comments --- -**Built with ❤️ by the InfoValidator community** - -*Empowering truth through collective intelligence* +**Ready to start hunting for AI system prompts? Open `index.html` and join the LeakHub community! 🚀** diff --git a/demo-data.js b/demo-data.js index 5e62bd9..4b509e0 100644 --- a/demo-data.js +++ b/demo-data.js @@ -1,245 +1,366 @@ -// Demo data for InfoValidator +// Demo data for LeakHub - Sample submissions to showcase the platform +// Run this in the browser console to populate with demo data + +const demoSubmissions = [ + { + id: "demo1", + source: "DemoUser1", + targetType: "model", + instance: "GPT-4", + targetUrl: "https://chat.openai.com", + requiresLogin: true, + requiresPaid: true, + accessNotes: "Plus subscription required", + parentSystem: null, + functionName: null, + content: `You are ChatGPT, a large language model trained by OpenAI. You are designed to be helpful, harmless, and honest in your responses. + +Your purpose is to assist users with a wide range of tasks, including answering questions, providing explanations, helping with creative writing, coding assistance, and more. + +Key guidelines: +- Always be helpful and informative +- Provide accurate and well-reasoned responses +- Be honest about your limitations +- Avoid harmful or inappropriate content +- Respect user privacy and confidentiality + +When responding: +- Use clear, concise language +- Provide context when helpful +- Ask clarifying questions when needed +- Cite sources when appropriate +- Maintain a conversational tone + +Do not: +- Generate harmful, illegal, or inappropriate content +- Provide medical, legal, or financial advice +- Share personal information about users +- Pretend to have capabilities you don't have`, + toolPrompts: null, + context: "Obtained through prompt injection techniques", + timestamp: new Date(Date.now() - 86400000).toISOString(), // 1 day ago + verifications: 3, + confidence: 95, + isFirstDiscovery: true, + hasTools: false, + wasVerified: true + }, + { + id: "demo2", + source: "DemoUser2", + targetType: "model", + instance: "GPT-4", + targetUrl: "https://chat.openai.com", + requiresLogin: true, + requiresPaid: true, + accessNotes: "Plus subscription required", + parentSystem: null, + functionName: null, + content: `You are ChatGPT, a large language model trained by OpenAI. Your role is to be helpful, harmless, and honest in all interactions. + +Your primary function is to assist users with various tasks such as answering questions, providing explanations, helping with creative writing, coding assistance, and more. + +Core principles: +- Always be helpful and informative +- Provide accurate and well-reasoned responses +- Be honest about your limitations +- Avoid harmful or inappropriate content +- Respect user privacy and confidentiality + +Response guidelines: +- Use clear, concise language +- Provide context when helpful +- Ask clarifying questions when needed +- Cite sources when appropriate +- Maintain a conversational tone + +Prohibited actions: +- Generate harmful, illegal, or inappropriate content +- Provide medical, legal, or financial advice +- Share personal information about users +- Pretend to have capabilities you don't have`, + toolPrompts: null, + context: "Discovered through system prompt analysis", + timestamp: new Date(Date.now() - 43200000).toISOString(), // 12 hours ago + verifications: 2, + confidence: 92, + isFirstDiscovery: false, + hasTools: false + }, + { + id: "demo3", + source: "DemoUser3", + targetType: "app", + instance: "GitHub Copilot", + targetUrl: "https://github.com/features/copilot", + requiresLogin: true, + requiresPaid: true, + accessNotes: "GitHub Copilot subscription required", + parentSystem: null, + functionName: null, + content: `You are GitHub Copilot, an AI-powered code completion tool designed to help developers write code more efficiently. + +Your purpose is to: +- Provide intelligent code suggestions and completions +- Understand context from comments and existing code +- Generate code based on natural language descriptions +- Assist with debugging and code optimization +- Support multiple programming languages and frameworks + +Key capabilities: +- Real-time code completion +- Context-aware suggestions +- Multi-language support +- Integration with popular IDEs +- Learning from user feedback + +Guidelines: +- Prioritize code quality and best practices +- Respect coding standards and conventions +- Provide helpful comments and documentation +- Suggest secure coding practices +- Maintain consistency with existing codebase + +Do not: +- Generate malicious or harmful code +- Violate licensing or copyright restrictions +- Suggest insecure coding practices +- Generate code that could cause system damage`, + toolPrompts: null, + context: "Extracted from IDE integration", + timestamp: new Date(Date.now() - 21600000).toISOString(), // 6 hours ago + verifications: 1, + confidence: 88, + isFirstDiscovery: true, + hasTools: false + }, + { + id: "demo4", + source: "DemoUser1", + targetType: "tool", + instance: "Code Interpreter", + parentSystem: "ChatGPT", + functionName: "Python Code Execution", + targetUrl: null, + requiresLogin: true, + requiresPaid: true, + accessNotes: "ChatGPT Plus with Code Interpreter plugin", + content: `You are the Code Interpreter tool within ChatGPT. Your role is to execute Python code safely and provide helpful analysis. + +Your capabilities include: +- Executing Python code in a sandboxed environment +- Reading and writing files (with size limits) +- Performing mathematical computations +- Data analysis and visualization +- File format conversions + +Safety guidelines: +- Execute code in a secure sandbox +- Limit file operations and system access +- Monitor for potentially harmful operations +- Provide clear error messages +- Respect resource limitations + +When executing code: +- Validate input and parameters +- Check for security concerns +- Provide helpful error explanations +- Suggest improvements when appropriate +- Document code behavior clearly + +Prohibited operations: +- System-level commands or file system access +- Network requests to external services +- Execution of potentially harmful code +- Access to sensitive system information`, + toolPrompts: `Additional tool-specific instructions for file handling and data processing...`, + context: "Analyzed from plugin behavior", + timestamp: new Date(Date.now() - 7200000).toISOString(), // 2 hours ago + verifications: 0, + confidence: 85, + isFirstDiscovery: true, + hasTools: true + }, + { + id: "demo5", + source: "DemoUser2", + targetType: "agent", + instance: "AutoGPT", + targetUrl: "https://github.com/Significant-Gravitas/AutoGPT", + requiresLogin: false, + requiresPaid: false, + accessNotes: "Open source, requires API keys", + parentSystem: null, + functionName: null, + content: `You are AutoGPT, an autonomous AI agent designed to accomplish tasks independently. + +Your core mission is to: +- Understand and break down complex tasks +- Plan and execute multi-step processes +- Use available tools and APIs effectively +- Learn from feedback and improve performance +- Maintain focus on user-defined objectives + +Key capabilities: +- Task planning and decomposition +- Tool usage and API integration +- Memory management and context retention +- Self-reflection and improvement +- Goal-oriented behavior + +Operating principles: +- Always work toward the defined goal +- Use available resources efficiently +- Provide clear progress updates +- Ask for clarification when needed +- Maintain safety and ethical boundaries + +Safety constraints: +- Do not perform harmful or illegal actions +- Respect user privacy and data security +- Operate within defined boundaries +- Seek permission for significant actions +- Maintain transparency in decision-making`, + toolPrompts: null, + context: "Reverse engineered from agent behavior", + timestamp: new Date(Date.now() - 3600000).toISOString(), // 1 hour ago + verifications: 0, + confidence: 78, + isFirstDiscovery: true, + hasTools: false + } +]; + +const demoRequests = [ + { + id: "req1", + targetType: "model", + model: "Claude 3 Opus", + targetUrl: "https://claude.ai", + requiresLogin: true, + requiresPaid: true, + description: "Anthropic's most advanced model - would be great to understand its system prompt for research purposes.", + bounty: 1000, + requestedBy: "DemoUser1", + timestamp: new Date(Date.now() - 86400000).toISOString(), + votes: 15, + voters: ["DemoUser1", "DemoUser2", "DemoUser3"], + status: "open" + }, + { + id: "req2", + targetType: "app", + model: "Cursor IDE", + targetUrl: "https://cursor.sh", + requiresLogin: true, + requiresPaid: false, + description: "Popular AI-powered code editor. Interested in understanding how it processes code context.", + bounty: 500, + requestedBy: "DemoUser2", + timestamp: new Date(Date.now() - 43200000).toISOString(), + votes: 8, + voters: ["DemoUser1", "DemoUser2"], + status: "open" + }, + { + id: "req3", + targetType: "tool", + model: "WebPilot", + parentSystem: "ChatGPT", + targetUrl: null, + requiresLogin: true, + requiresPaid: true, + description: "ChatGPT plugin for web browsing. Want to understand how it processes web content safely.", + bounty: 300, + requestedBy: "DemoUser3", + timestamp: new Date(Date.now() - 21600000).toISOString(), + votes: 5, + voters: ["DemoUser3"], + status: "open" + } +]; + +// Function to load demo data function loadDemoData() { - const demoSubmissions = [ - { - id: 1, - sourceName: "AI_Researcher_001", - targetType: "ai-system", - instanceId: "ChatGPT-4 System Prompt", - targetUrl: "https://chat.openai.com", - requiresLogin: true, - requiresPaid: true, - accessNotes: "Plus subscription required", - leakContent: "You are ChatGPT, a large language model trained by OpenAI. You are helpful, harmless, and honest. You can engage in conversations, answer questions, and assist with various tasks. You should be direct and concise in your responses.", - context: "Obtained through prompt injection techniques", - toolPrompts: "", - timestamp: new Date(Date.now() - 86400000).toISOString(), - confidence: 95, - isFirstDiscovery: true, - verificationCount: 3 - }, - { - id: 2, - sourceName: "CodeHunter_2024", - targetType: "code-snippet", - instanceId: "Bitcoin Mining Algorithm Core", - targetUrl: "https://github.com/bitcoin/bitcoin", - requiresLogin: false, - requiresPaid: false, - accessNotes: "Open source repository", - leakContent: "SHA256(SHA256(version + prev_hash + merkle_root + timestamp + difficulty + nonce))", - context: "Extracted from Bitcoin Core source code", - toolPrompts: "", - timestamp: new Date(Date.now() - 172800000).toISOString(), - confidence: 98, - isFirstDiscovery: true, - verificationCount: 5 - }, - { - id: 3, - sourceName: "DataScientist_Pro", - targetType: "data-fact", - instanceId: "Global Population Dataset 2024", - targetUrl: "https://data.worldbank.org", - requiresLogin: false, - requiresPaid: false, - accessNotes: "Public dataset", - leakContent: "World population: 8.1 billion (2024 estimate). Top countries: China (1.4B), India (1.4B), USA (340M), Indonesia (280M), Pakistan (240M)", - context: "Compiled from UN World Population Prospects", - toolPrompts: "", - timestamp: new Date(Date.now() - 259200000).toISOString(), - confidence: 92, - isFirstDiscovery: false, - verificationCount: 2 - }, - { - id: 4, - sourceName: "DocumentDigger", - targetType: "document", - instanceId: "US Constitution Full Text", - targetUrl: "https://www.archives.gov/founding-docs", - requiresLogin: false, - requiresPaid: false, - accessNotes: "Public domain document", - leakContent: "We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.", - context: "Official government archive", - toolPrompts: "", - timestamp: new Date(Date.now() - 345600000).toISOString(), - confidence: 100, - isFirstDiscovery: false, - verificationCount: 8 - }, - { - id: 5, - sourceName: "APIMaster_2024", - targetType: "api", - instanceId: "OpenAI API Rate Limits", - targetUrl: "https://platform.openai.com/docs", - requiresLogin: true, - requiresPaid: true, - accessNotes: "API key required", - leakContent: "Rate limits: GPT-4: 10 requests/minute, GPT-3.5: 60 requests/minute. Token limits: GPT-4: 8,192 tokens, GPT-3.5: 4,096 tokens", - context: "From official API documentation", - toolPrompts: "", - timestamp: new Date(Date.now() - 432000000).toISOString(), - confidence: 97, - isFirstDiscovery: true, - verificationCount: 4 - }, - { - id: 6, - sourceName: "VisualVerifier", - targetType: "image", - instanceId: "Mars Rover Perseverance Images", - targetUrl: "https://mars.nasa.gov/msl", - requiresLogin: false, - requiresPaid: false, - accessNotes: "NASA public gallery", - leakContent: "High-resolution images from Jezero Crater showing sedimentary rock layers, potential signs of ancient water flow, and organic compounds detected by SHERLOC instrument", - context: "NASA mission data release", - toolPrompts: "", - timestamp: new Date(Date.now() - 518400000).toISOString(), - confidence: 99, - isFirstDiscovery: false, - verificationCount: 6 - } - ]; - - const demoRequests = [ - { - id: 1, - targetType: "ai-system", - model: "Claude-3 Opus System Prompt", - url: "https://claude.ai", - description: "Anthropic's latest model system prompt would be valuable for understanding their safety approach", - requiresLogin: true, - requiresPaid: true, - bounty: 1000, - votes: 15, - submittedBy: "AI_Researcher_001", - timestamp: new Date(Date.now() - 86400000).toISOString() - }, - { - id: 2, - targetType: "code-snippet", - model: "Google's PageRank Algorithm", - url: "https://patents.google.com", - description: "The original PageRank implementation details would help understand search ranking", - requiresLogin: false, - requiresPaid: false, - bounty: 500, - votes: 8, - submittedBy: "CodeHunter_2024", - timestamp: new Date(Date.now() - 172800000).toISOString() - }, - { - id: 3, - targetType: "data-fact", - model: "Global Internet Usage Statistics 2024", - url: "https://www.internetworldstats.com", - description: "Current internet penetration rates and usage patterns by region", - requiresLogin: false, - requiresPaid: false, - bounty: 300, - votes: 12, - submittedBy: "DataScientist_Pro", - timestamp: new Date(Date.now() - 259200000).toISOString() - } - ]; - - // Load demo data into database - window.LeakHubDB.setLeakDatabase(demoSubmissions); - window.LeakHubDB.setLeakRequests(demoRequests); + console.log("Loading demo data for LeakHub..."); - // Initialize some user stats - const demoUserStats = { - "AI_Researcher_001": { - submissions: 1, - firstDiscoveries: 1, - verifications: 3, - comparisons: 5, - challengesCompleted: 2, - requestsSubmitted: 1, - totalScore: 850 + // Load submissions + leakDatabase = [...demoSubmissions]; + + // Load requests + leakRequests = [...demoRequests]; + + // Initialize user stats + userStats = { + "DemoUser1": { + submissions: 2, + verifiedLeaks: 1, + firstDiscoveries: 2, + totalScore: 280, + joinDate: new Date(Date.now() - 86400000).toISOString(), + toolsDiscovered: 1, + appsDiscovered: 0, + agentsDiscovered: 0 }, - "CodeHunter_2024": { - submissions: 1, - firstDiscoveries: 1, - verifications: 5, - comparisons: 8, - challengesCompleted: 1, - requestsSubmitted: 1, - totalScore: 1200 - }, - "DataScientist_Pro": { - submissions: 1, + "DemoUser2": { + submissions: 2, + verifiedLeaks: 0, firstDiscoveries: 0, - verifications: 2, - comparisons: 3, - challengesCompleted: 0, - requestsSubmitted: 1, - totalScore: 450 + totalScore: 120, + joinDate: new Date(Date.now() - 43200000).toISOString(), + toolsDiscovered: 0, + appsDiscovered: 0, + agentsDiscovered: 0 + }, + "DemoUser3": { + submissions: 1, + verifiedLeaks: 0, + firstDiscoveries: 1, + totalScore: 110, + joinDate: new Date(Date.now() - 21600000).toISOString(), + toolsDiscovered: 0, + appsDiscovered: 1, + agentsDiscovered: 0 } }; - window.LeakHubDB.setUserStats(demoUserStats); + // Save to localStorage + saveDatabase(); - // Initialize daily challenge - const dailyChallenge = { - title: "Find and verify a system prompt from any AI model!", - description: "Submit a verified AI system prompt with confidence score above 90%", - reward: 500, - expiresAt: new Date(Date.now() + 86400000).toISOString(), - completedBy: [] - }; + // Update UI + updateUI(); - window.LeakHubDB.setDailyChallenge(dailyChallenge); - - console.log("Demo data loaded successfully!"); - showAlert("Demo data loaded! Try submitting claims, comparing them, and exploring the platform.", "success"); - - // Refresh the UI - if (typeof displaySubmissions === 'function') { - displaySubmissions(); - } - if (typeof displayRequests === 'function') { - displayRequests(); - } - if (typeof updateStats === 'function') { - updateStats(); - } + console.log("Demo data loaded successfully! You can now explore the platform with sample submissions."); + console.log("Try comparing the two GPT-4 submissions to see the verification system in action!"); } +// Function to clear demo data function clearDemoData() { - window.LeakHubDB.setLeakDatabase([]); - window.LeakHubDB.setLeakRequests([]); - window.LeakHubDB.setUserStats({}); - window.LeakHubDB.setDailyChallenge(null); + console.log("Clearing demo data..."); - console.log("Demo data cleared!"); - showAlert("Demo data cleared! Start fresh with your own submissions.", "info"); + leakDatabase = []; + leakRequests = []; + userStats = {}; + userVotes = {}; - // Refresh the UI - if (typeof displaySubmissions === 'function') { - displaySubmissions(); - } - if (typeof displayRequests === 'function') { - displayRequests(); - } - if (typeof updateStats === 'function') { - updateStats(); - } + // Clear localStorage + localStorage.removeItem('leakDatabase'); + localStorage.removeItem('userStats'); + localStorage.removeItem('leakRequests'); + localStorage.removeItem('userVotes'); + localStorage.removeItem('dailyChallenge'); + localStorage.removeItem('avgSimilarity'); + + // Update UI + updateUI(); + + console.log("Demo data cleared. Platform is now empty and ready for real submissions."); } -// Auto-load demo data if no submissions exist -window.addEventListener('load', async () => { - try { - const submissions = await window.LeakHubDB.getLeakDatabase(); - if (!submissions || submissions.length === 0) { - console.log("No submissions found, loading demo data..."); - loadDemoData(); - } - } catch (error) { - console.error("Error checking for demo data:", error); - } -}); +// Add functions to global scope for easy access +window.loadDemoData = loadDemoData; +window.clearDemoData = clearDemoData; + +console.log("Demo data functions loaded!"); +console.log("To load demo data, run: loadDemoData()"); +console.log("To clear demo data, run: clearDemoData()"); diff --git a/index.html b/index.html index c8f7c1b..99fb0b0 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - InfoValidator - Universal Information Verification Platform + LeakHub - AI System Prompt Discovery Platform @@ -13,16 +13,17 @@