A VS Code extension that scans your code for security issues β powered by Semgrep and designed for developers who move fast.
Built as a capstone project. MVP-first, local-first, no cloud required.
- Open a file in VS Code
- Pick it in the Scan panel or just run "VibeSec: Scan Current File"
- The extension runs Semgrep in the background
- Security issues appear as inline highlights directly in your code
- Results show up in the Findings panel grouped by folder and file
- Click any finding to jump to the exact line β or copy its description to clipboard
No accounts. No cloud. No telemetry. Everything runs on your machine.
(Coming soon)
| Feature | Status |
|---|---|
| Scan current file | β v0.1.0 |
| Inline diagnostics (squiggly lines) | β v0.1.0 |
| YAML policy file to control rules | β v0.2.0 |
| Findings side panel | β v0.2.0 |
| Bundled default ruleset (no internet) | β v0.2.0 |
| Activity bar icon + dedicated panels | β v0.3.0 |
| Scan panel (file browser with multi-select) | β v0.3.0 |
| Folder-grouped findings tree | β v0.3.0 |
| Copy Description button | β v0.3.0 |
| Configurable settings | β v0.3.0 |
| First-install walkthrough | β v0.3.0 |
| Scan whole project / multi-file scan | β v0.4.0 |
| AI fix prompts (OpenAI / Anthropic / Gemini) | β v0.4.0 |
| Secure API key storage | β v0.4.0 |
| Copy-paste prompts per finding, file, or project | β v0.4.0 |
| Analysis panel (React webview, sidebar) | β v0.5.0 |
| Control Center (Dashboard / Settings / Logs / Rules) | β v0.6.4 |
| Persistent scan history + sparkline | β v0.6.4 |
| Structured logs with disk persistence + Output channel | β v0.6.4 |
| Rule index browser with Open YAML | β v0.6.4 |
| Taint analysis (source β sink data flow tracking) | β v0.7.0 |
| Data flow visualisation in finding cards (click-to-jump) | β v0.7.0 |
| TAINT chip on the Rules page | β v0.7.0 |
- VS Code 1.85 or later
- Semgrep CLI installed and on your PATH
- Node.js 18+ (for extension development only)
# macOS / Linux
pip install semgrep
# or via Homebrew
brew install semgrep
# Windows
pip install semgrepVerify it works:
semgrep --versionIf you just want to use VibeSec (not build it from source), install the packaged .vsix:
- Download
vibesec-<version>.vsixfrom the Releases page. - Install it, either way works:
- Command line:
code --install-extension vibesec-<version>.vsix - From VS Code: open the Extensions panel β
β¦menu (top-right) β Install from VSIXβ¦ β pick the file.
- Command line:
- Reload VS Code if prompted. VibeSec appears in the activity bar on the left.
Make sure Semgrep is installed and on your PATH first β VibeSec uses it under the hood.
git clone https://github.com/Moawiah188/vibesec.git
cd vibesecnpm installnpm run compile- Open the
vibesecfolder in VS Code - Press F5
- A second VS Code window opens β this is your test environment
- Open any file and run Ctrl+Shift+P β VibeSec: Scan Current File
The repo includes an intentionally insecure Python file for testing:
test-samples/insecure.py
Open it in the Extension Development Host and run a scan. You should see findings for:
- Command injection via
subprocessandos.system - Weak hashing with MD5 and SHA-1
- Hardcoded credentials and API keys
- SQL injection via string formatting
- Insecure deserialization with
pickle - Unsafe
yaml.load() - Insecure randomness with
random.random() - Code injection via
evalandexec
Drop a .vibesec.yaml in your project root to control how VibeSec scans your code.
# Which rule packs to use
presets:
- vibesec:default # Bundled OWASP rules β works offline
# Minimum severity to report
severity:
minSeverity: warning # error | warning | info
# Exclude paths from scanning
files:
exclude:
- "**/node_modules/**"
- "**/*.test.ts"
# Add your own inline rules
rules:
- id: my-custom-rule
message: "Don't use eval()"
severity: ERROR
languages: [javascript]
pattern: eval(...)Use Ctrl+Shift+P β VibeSec: Open Policy File to create one with a starter template. Use VibeSec: Reload Policy to pick up changes without restarting VS Code.
| Command | Description |
|---|---|
VibeSec: Scan Current File |
Scan the active file and show findings |
VibeSec: Scan Selected |
Scan files/folders selected in the Scan panel |
VibeSec: Scan Whole Project |
Scan every scannable file in the workspace |
VibeSec: Open Policy File |
Create or open .vibesec.yaml in the workspace root |
VibeSec: Reload Policy |
Force-reload the policy file from disk |
VibeSec: Refresh File Tree |
Manually rebuild the Scan panel file list |
VibeSec: Set API Key |
Store an OpenAI, Anthropic, or Gemini API key securely |
VibeSec: Clear API Key |
Remove a stored API key |
VibeSec: Test API Key |
Verify a stored key is valid and accepted |
VibeSec: Generate Prompts |
Pre-generate AI fix prompts for all current findings |
vibesec/
βββ src/
β βββ extension.ts # Entry point β registers commands, wires up UI
β βββ scanner.ts # Runs Semgrep, parses JSON output
β βββ policy.ts # Loads and validates .vibesec.yaml
β βββ findingsProvider.ts # Findings panel (TreeView)
β βββ scanProvider.ts # Scan panel file browser (TreeView)
β βββ scannableExtensions.ts # Shared list of scannable file extensions
β βββ secrets.ts # Secure API key storage (VS Code SecretStorage)
β βββ llmClient.ts # HTTP clients for OpenAI, Anthropic, Gemini
β βββ promptGenerator.ts # Builds AI fix prompts from findings
β βββ types.ts # Internal data models
βββ media/
β βββ vibesec-icon.svg # Activity bar icon
β βββ walkthrough/ # First-install walkthrough content
βββ rules/
β βββ default.yaml # Bundled OWASP-aligned rules
βββ test-samples/
β βββ insecure.py # Sample vulnerable Python file
β βββ .vibesec.yaml # Example policy (preset-based)
β βββ .vibesec-custom.yaml # Example policy (custom rules only)
β βββ custom-rules.yaml # Example external rule file
βββ design-mockups/ # UI design system and component mockups
βββ package.json # Extension manifest
βββ tsconfig.json # TypeScript config
βββ CHANGELOG.md # Version history
The vibesec:default preset includes ~30 rules covering the OWASP Top 10 β no internet required.
| Category | Examples |
|---|---|
| Injection | Command injection, SQL injection, eval/exec |
| Cryptographic Failures | MD5, SHA-1 weak hashing |
| Auth Failures | Hardcoded passwords, API keys, tokens |
| Integrity Failures | pickle deserialization, unsafe YAML load |
| XSS | innerHTML, document.write |
| Misconfiguration | Flask debug=True, CORS allow-all |
| Insecure Randomness | random.random(), Math.random() |
| Path Traversal | Unsanitized open(), readFile() |
Languages covered: Python, JavaScript, TypeScript
- v0.1.0 β Sprint 1 "Scan": scan a file, show inline highlights β
- v0.2.0 β Sprint 2 "Policy": policy file, findings panel, bundled ruleset β
- v0.3.0 β Sprint 3 "Interface": activity bar, scan panel, redesigned findings tree β
- v0.4.0 β Sprint 4 "Prompts": multi-file scan, AI fix prompts, API key management β
- v0.5.0 β Sprint 5 "Panel": React analysis sidebar, Full Fix tab, severity callouts β
- v0.6.4 β Sprint 6 "Control Center": editor-area Dashboard / Settings / Logs / Rules, persistent scan history, structured logging β
- v0.7.0 β Sprint 7 "Taint": bundled taint ruleset, dataflow extraction, data flow UI block, taint-aware AI prompts β
- Next β Sprint 8 "Rule Sources": external rule pack syncing, live per-rule toggles
VibeSec ships a bundled taint ruleset that tracks how untrusted data flows from a source (HTTP request body, command-line argument, environment variable, file read) through variable assignments and helper calls to a sink (shell exec, SQL query, deserializer, outbound HTTP). This catches bugs that line-by-line pattern matching misses β e.g. when user input is read on line 12, stored in a variable, and only reaches subprocess.run on line 47.
Enable it by adding vibesec:taint to your .vibesec.yaml:
presets:
- vibesec:default
- vibesec:taintBundled rules cover command injection, SQL injection, path traversal, unsafe deserialization (pickle / yaml), XSS, and SSRF for Python and JavaScript/TypeScript.
When a taint rule fires, the finding card shows a dedicated Data flow block:
- β SOURCE β where the untrusted data enters
- β‘ STEP N β any intermediate variable assignments along the path
- β’ SINK β the dangerous call
Click any row to jump straight to that line. The AI fix prompt automatically includes the full data-flow path, so the assistant knows exactly where to add validation or sanitisation.
After a scan, VibeSec can generate a copy-paste prompt you paste into Cursor, Claude Code, ChatGPT, or any AI assistant to get a fix back.
Setup (one time):
Ctrl+Shift+Pβ VibeSec: Set API Key β pick your provider (OpenAI, Anthropic, or Gemini) and paste your key. It's stored securely using VS Code's built-in secret storage and never written to disk.- Open Settings β VibeSec and choose your preferred Prompt Mode:
- Per File (default) β one prompt per file, batching all findings in it
- Per Vulnerability β one prompt per individual finding
- Per Project β one prompt covering every finding across the whole scan
Generating prompts:
- Click the $(sparkle) Generate Prompts button in the Findings panel title bar to pre-generate all prompts at once
- Or hover any finding/file row and click the $(comment-discussion) Copy Prompt button to generate and copy on demand β no upfront cost
Prompts include the offending code with context lines, rule details, and instructions for the AI to explain the issue, show a corrected snippet, and list follow-up checks.
- TypeScript
- VS Code Extension API
- Semgrep CLI
js-yamlβ policy file parsingminimatchβ glob-based file exclusions- Node 18+ built-in
fetchβ LLM API calls (no extra HTTP library)
No backend. No database. No cloud infrastructure. Your API key stays on your machine.
MIT