How sumantaparida/ai-security-coding works
ai-security-coding is a web-based security assistant that accepts either a vulnerable code snippet or a directory to scan, then presents explanations, proposed diffs, and test plans. The browser sends snippet submissions to the Express patch route; directory submissions run Semgrep, read its findings, and request AI suggestions for each finding. Both AI paths use OpenAI. A separate Vercel handler implements the snippet endpoint for deployment, but the sampled files do not show how it is wired. The README is only a title, so capabilities and links here are limited to the sampled source.
Main entry points: app.js Form and results UI · index.ts Directory scan route · index.html Security dashboard · ai.ts AI service client
Components 12
Web interface
- Security dashboard
public/index.html - Form and results UI
public/app.js
Application server
- Express server
server/index.ts - Snippet patch route
server/index.ts - Directory scan route
server/index.ts
Security analysis
- Semgrep scanner
- Scan output JSON
semgrep.json
AI suggestions
- Finding payload builder
server/ai.ts - AI service client
server/ai.ts - Vercel patch handler
api/suggest-patch.ts
Other components
- Security user
- OpenAI API
Connections 18
- Security user → Security dashboard: opens
- Express server → Security dashboard: serves
server/index.ts - Security dashboard → Form and results UI: loads
- Security user → Form and results UI: submits
public/app.js - Form and results UI → Snippet patch route: posts snippet
public/app.js - Form and results UI → Directory scan route: posts path
public/app.js - Snippet patch route → OpenAI API: requests suggestion
server/index.ts - Directory scan route → Semgrep scanner: runs scan
server/index.ts - Semgrep scanner → Scan output JSON: writes results
- Directory scan route → Scan output JSON: reads results
server/index.ts - Directory scan route → Finding payload builder: builds payload
server/index.ts - Directory scan route → AI service client: requests suggestion
server/index.ts - AI service client → Snippet patch route: posts payload
server/ai.ts - Form and results UI → Vercel patch handler: posts snippet
- Vercel patch handler → OpenAI API: requests suggestion
api/suggest-patch.ts - Snippet patch route → Form and results UI: returns suggestion
public/app.js - Directory scan route → Form and results UI: returns findings
public/app.js - Form and results UI → Security user: displays results
public/app.js