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

Helix: Open-Source Framework Turns Claude into Personal AI Agent for macOS
Helix is an open-source framework that connects Claude via Claude Code in Terminal to macOS through four MCP server plugins, enabling Claude to control applications, maintain persistent memory, run scheduled tasks, and operate with local voice processing.

LogClaw: Open-Source AI SRE for Auto-Ticketing from Logs
LogClaw is an open-source log intelligence platform that runs on Kubernetes, ingests logs via OpenTelemetry, detects anomalies using signal-based composite scoring, and automatically creates tickets with root cause analysis in about 90 seconds.

Academic Research Skills for Claude Code: A Human-in-the-Loop Pipeline for Paper Writing
Academic Research Skills (ARS) v3.7.0+ is a Claude Code plugin that automates reference hunting, citation formatting, data checking, and logical consistency review while keeping the human researcher in control. Install via /plugin marketplace add Imbad0202/academic-research-skills.

Mymir: An Open-Source Project Graph for Coding Agents via MCP
Mymir gives agents a graph-based project map with dependencies, decisions, acceptance criteria, and previous execution notes, delivered via MCP to avoid re-explaining state across sessions.