SecBot is an AI-powered cybersecurity assistant built on Cloudflare's Agent platform. It provides educational guidance, simulated security analysis, and expert knowledge on cybersecurity topics through an interactive chat interface with optional voice input.
π Live Demo
SecBot is designed for educational and guidance purposes only:
- π Educational Purpose: Provides security concepts, best practices, and simulated analysis - not actual security scanning
- π« No Real System Access: Cannot connect to or scan actual networks, databases, or systems
- π― Simulated Analysis: Security assessments are template-based, not live threat intelligence
- π¨βπΌ Professional Consultation: For critical security issues, always consult qualified cybersecurity professionals
- π§ͺ Not for Production: Do not rely on SecBot for production security decisions
- π‘οΈ Cybersecurity Expertise: Comprehensive knowledge of security concepts, vulnerabilities, and best practices
- π Security Analysis Tools: Simulated network log analysis, vulnerability assessments, and threat detection
- π¨ Incident Response: Step-by-step guidance for various security incidents
- π€ Voice Interface: Optional speech recognition for hands-free interaction
- π Educational Content: Detailed explanations with examples, prevention methods, and case studies
- π Skill-Level Adaptation: Tailors responses to beginner, intermediate, or advanced levels
- π Professional UI: Dark cybersecurity-themed interface with organized sample questions
- β‘οΈ Real-time Streaming: Powered by Cloudflare Workers AI (Llama 3.3-70B)
- πΎ Persistent Memory: Conversation history via Durable Objects
- Cross-Site Scripting (XSS)
- SQL Injection attacks
- CSRF (Cross-Site Request Forgery)
- DDoS attacks and mitigation
- Phishing and social engineering
- Malware analysis and prevention
- OWASP Top 10 vulnerabilities
- Network log analysis
- Vulnerability assessments
- Traffic pattern analysis
- Security configuration reviews
- Ransomware response procedures
- Data breach protocols
- Malware infection handling
- Phishing incident management
- Password security guidelines
- WordPress security hardening
- Zero-trust implementation
- Security framework compliance
- Cloudflare Account with Workers AI enabled
- Node.js 20.19+ or 22.12+
- Basic cybersecurity knowledge (recommended for optimal use)
git clone https://github.com/yourusername/cybersec-ai-agent.git
cd cybersec-ai-agent
npm installCreate a .dev.vars file:
OPENAI_API_KEY=sk-dummy-key-we-will-use-workers-ai-instead
ENVIRONMENT=development
DEBUG_MODE=trueUpdate wrangler.jsonc with your settings:
npm start
# Visit http://localhost:5173/npm run deploy
# Your SecBot will be available at: https://your-secbot-name.your-subdomain.workers.devβββ src/
β βββ app.tsx # Voice-enabled chat interface
β βββ server.ts # SecBot agent logic with Workers AI
β βββ security-tools.ts # Core cybersecurity analysis tools
β βββ tools.ts # AI tool definitions for security
β βββ styles.css # Cybersecurity-themed UI styling
β βββ client.tsx # Client-side entry point
β βββ shared.ts # Shared types and utilities
βββ wrangler.jsonc # Cloudflare Workers configuration
βββ .dev.vars.example # Environment variables template
βββ README.md # This file
Extend SecBot's capabilities by adding tools in security-tools.ts:
async explainSecurityConcept(params: {
concept: string;
skillLevel: 'beginner' | 'intermediate' | 'advanced';
includeExamples: boolean;
}): Promise<SecurityConceptExplanation> {
// Add your custom security concept explanations
const explanations = {
'your_new_concept': {
description: 'Your concept description',
technicalDetails: 'Technical explanation based on skill level',
prevention: ['Prevention method 1', 'Prevention method 2'],
// ... additional fields
}
};
// Implementation logic
}Then register the tool in tools.ts:
const explainYourConcept = tool({
description: "Explain your custom security concept",
parameters: z.object({
concept: z.string(),
skillLevel: z
.enum(["beginner", "intermediate", "advanced"])
.default("intermediate")
}),
execute: async (params) => {
const securityTools = new SecurityAnalysisTools();
return await securityTools.explainSecurityConcept(params);
}
});Modify the interface in app.tsx:
- Sample Questions: Update
quickActionsarray with new categories and questions - Theme Colors: Modify CSS variables in
styles.css - Voice Settings: Configure speech recognition parameters
- Analysis Modes: Add new security analysis types to the dropdown
Integrate real security services (with proper disclaimers):
// Example: VirusTotal API integration
const checkFileHash = tool({
description: "Check file hash against threat databases",
parameters: z.object({
hash: z.string(),
hashType: z.enum(["md5", "sha1", "sha256"])
}),
execute: async ({ hash, hashType }) => {
// Add proper API integration with error handling
// Include disclaimers about data sharing
}
});Try these sample questions:
Security Education:
- "Explain Cross-Site Scripting (XSS) attacks"
- "What are the OWASP Top 10 vulnerabilities?"
- "How do SQL injection attacks work?"
Incident Response:
- "We detected ransomware. What should we do?"
- "Guide me through malware incident response"
Best Practices:
- "How do I secure my WordPress website?"
- "What's the best password security approach?"
npm run deployUpdate your wrangler.jsonc:
{
"routes": [
{ "pattern": "secbot.yourdomain.com/*", "zone_name": "yourdomain.com" }
]
}- No Data Storage: Conversations are stored temporarily in Durable Objects for session continuity only
- No External APIs: SecBot uses only Cloudflare Workers AI - no third-party API calls
- No User Tracking: No analytics or tracking beyond Cloudflare's standard metrics
- Local Processing: Voice input is processed in the browser, not sent to external services
Monitor SecBot usage through Cloudflare Workers Analytics:
- Response times and performance
- Error rates and debugging
- Usage patterns (without personal data)
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-security-tool - Commit changes:
git commit -m "Add new security analysis tool" - Push to branch:
git push origin feature/new-security-tool - Create a Pull Request
MIT License - see LICENSE for details.
This project is for educational purposes only. For production security needs:
- Consult certified cybersecurity professionals
- Use enterprise-grade security tools
- Follow industry-standard security frameworks
- Implement proper security testing and validation
SecBot provides guidance and simulated analysis to help users learn cybersecurity concepts, but should never be relied upon for critical security decisions or actual threat detection.
- Cloudflare Agents Documentation
- Cloudflare Workers AI
- OWASP Security Guidelines
- NIST Cybersecurity Framework
{ "name": "your-secbot-name", "main": "src/server.ts", "ai": { "binding": "AI", "remote": true }, "durable_objects": { "bindings": [ { "name": "Chat", "class_name": "Chat", "script_name": "your-secbot-name" } ] } }