Local AI VS Code extension blocks insecure code generation during saves

A developer created a VS Code extension that runs llama3.1:8b-instruct-q4 locally to physically block saves containing insecure AI-generated code. The tool was built after Claude generated a Flask route with a textbook CWE-117 (Log Injection) vulnerability.
How it works
The extension intercepts your save operations in VS Code, runs the llama3.1:8b-instruct-q4 model locally, maps the source-to-sink execution flow of the code, and throws a hard block if the AI generated something dangerous. The entire system operates offline with no cloud dependencies or API keys required.
Specific details from the source
- Model used: llama3.1:8b-instruct-q4
- Platform: VS Code extension
- Trigger: Intercepts save operations
- Analysis method: Maps source-to-sink execution flow
- Action: Throws a hard block on dangerous code
- Example vulnerability caught: CWE-117 Log Injection in a Flask route generated by Claude
- Infrastructure: Completely offline, no cloud, no API keys
This approach addresses a common issue where AI coding assistants like Claude and GitHub Copilot generate code quickly but may introduce security vulnerabilities. The local execution ensures privacy and eliminates dependency on external services.
📖 Read the full source: r/LocalLLaMA
👀 See Also

OpenClaw memory loss fix using Mem0 plugin
OpenClaw agents experience memory loss due to context compaction rewriting files like MEMORY.md. The Mem0 plugin solves this by moving memory outside the context window with auto-recall and auto-capture features.

Unlocking Proactivity: A Deep Dive into Clawbot Innovations from the Community
Discover how enthusiasts are enhancing their Clawbot's proactivity through inventive strategies and community-driven insights. A look at discussions and revelations from r/openclaw.

GitHub Comic Bot: Turn Commits into Daily Medieval Knight Comics
A bot that reads GitHub commits and generates 4-panel comic strips featuring a deadpan medieval knight, built with Claude Code and Gemini, running on GitHub Actions with free tier costs.

Semble: A Local MCP Server for Claude Code with 98% Token Reduction
Semble is an open-source MCP server for Claude Code that replaces grep+read workflows, using embeddings, BM25, and reranking to reduce token usage by ~98% while indexing repos in ~250ms.