VibinGuard
VibinGuard is a local security guard for AI-generated code. It catches secrets and common security mistakes before they reach a commit, and it can guard clipboard content before it is inserted into the editor.
What it does
- Guards clipboard content in memory before paste.
- Blocks hardcoded secrets and high-risk generated code.
- Scans the current file, the workspace, and supported files on save.
- Shows findings as native VS Code diagnostics.
- Presents findings in a friendly security review grouped by file, with technical details kept secondary.
- Provides safe refactoring requests that can be copied to a coding assistant.
- Optionally runs a second semantic review through a local Ollama model.
- Can generate a local secure refactor, show only the corrected-code preview, and apply it after both layers approve it.
- Runs without telemetry or remote AI calls.
Detected patterns
- Hardcoded credentials and tokens, including names such as
OPENAI_API_KEY and stripeSecretKey.
- Provider credential formats: OpenAI and Anthropic, Stripe live, AWS, GitHub, GitLab, Slack, Supabase secret keys, and PEM private keys.
- Supabase
service_role keys in source (public anon keys are not flagged).
- Database connection strings with an embedded password.
- Private
.env files that are tracked by Git or are not protected by .gitignore.
- Client-side secret exposure.
- JWTs without explicit expiration.
- SQL built with string interpolation or concatenation.
- Unsafe raw HTML rendering.
- Request bodies used without nearby schema validation.
- Untrusted input concatenated into LLM prompts.
- Permissive CORS configurations.
- Semantic authorization, tenant-isolation, trust-boundary, business-logic, and data-exposure risks when local AI is enabled.
Paste warnings
Every paste into a supported file (Ctrl+V, or Paste from the context or Edit menu) is checked automatically. The paste always happens as usual; VibinGuard never blocks or changes it. Right after the paste, a message says what is wrong in the pasted code and on which line, and the affected lines are marked in the editor.
- Critical and high findings appear as an error notification, medium findings as a warning, and low findings only as editor diagnostics.
- From the message you can open the security review, copy an AI fix prompt, or run a local AI fix.
- Code copied inside a VS Code editor is not checked, so moving your own code around stays quiet. Code copied from a browser, a chat app, or another window is checked.
- Only the deterministic rules run on paste, so pasting stays instant. Local AI is used by the manual commands.
- Turn it off with
vibinguard.scanOnPaste. Paste warnings rely on VS Code's editor.pasteAs.enabled setting, which is on by default.
To block risky content instead of only warning, use VibinGuard: Guard Clipboard Before Paste.
False positives
When a blocked paste is a false positive, choose Paste anyway in the notification or in the security review. The findings stay in the review until you fix them or accept them.
To accept a finding in your own files, add an inline comment:
// vibinguard-ignore-next-line
const sample = "not-a-real-secret-123";
const token = "fixture-token-123456"; // vibinguard-ignore hardcoded-secret
A directive without rule ids applies to every rule on that line. Directives work in file, project, and on-save scans. They are ignored inside clipboard content, so generated code cannot silence the guard by including its own comment.
Restricted Mode
In untrusted folders, VibinGuard keeps scanning but never starts Git, so dotenv Git exposure checks are skipped. In trusted folders, Git is resolved to an absolute path from PATH and is never loaded from the scanned folder.
Optional local AI review
The deterministic security rules are always the first layer. The optional second layer uses Ollama on the same computer and is disabled by default.
- Install Ollama.
- Download the recommended small code model:
ollama pull qwen2.5-coder:3b-instruct
- Run VibinGuard: Configure Local AI and keep the recommended model name.
- Run VibinGuard: Check Local AI.
Before a local AI request, VibinGuard selects a limited amount of relevant code and redacts common credentials, private keys, JWTs, and authorization tokens. Only loopback addresses such as 127.0.0.1 and localhost are accepted. If Ollama is unavailable, the deterministic checks continue normally.
Private dotenv files such as .env and .env.local are never sent to the AI model. Because secrets are expected there, VibinGuard does not report each value as a hardcoded secret. Instead, it checks Git status and reports one clear exposure warning only when the file is tracked or is not protected by an ignore rule. Committed templates such as .env.example, .env.sample, and .env.template continue receiving normal secret checks.
If Git is unavailable or the file is outside a Git repository, VibinGuard cannot verify dotenv exposure and does not treat individual dotenv values as findings.
When a local rule already blocks generated content, especially a secret, VibinGuard skips the AI call entirely. AI findings must match a strict internal schema and cannot reduce or dismiss a deterministic finding.
For Fix with Local AI, VibinGuard redacts the original content before requesting a complete replacement. The proposed replacement is scanned again by deterministic rules and local AI. A proposal with a blocking finding is rejected; an approved proposal is shown in an untitled preview and changes the target only after explicit confirmation. VibinGuard does not automatically save the edited file.
Installation
Install VibinGuard from the VS Code Marketplace or run:
code --install-extension vibinguard.vibin-guard
Manual VSIX installation
- Open the Extensions view in VS Code.
- Open the view menu and select Install from VSIX....
- Choose
vibin-guard.vsix.
- Run Developer: Reload Window.
Command-line installation:
code --install-extension vibin-guard.vsix --force
Commands
VibinGuard: Guard Clipboard Before Paste
VibinGuard: Scan Current File
VibinGuard: Scan Project
VibinGuard: Show Security Review
VibinGuard: Configure Local AI
VibinGuard: Check Local AI
VibinGuard: Show Output
Settings
vibinguard.scanOnSave: scans supported files after save. Enabled by default.
vibinguard.insertSafeClipboard: inserts clipboard content when no blocking issue is found. Enabled by default.
vibinguard.ai.enabled: enables the optional Ollama review. Disabled by default.
vibinguard.ai.runOnSave: also uses local AI on save. Disabled by default.
vibinguard.ai.model: local Ollama model name.
vibinguard.ai.baseUrl: loopback-only Ollama address.
vibinguard.ai.timeoutMs: local model timeout.
vibinguard.ai.maxInputChars: maximum redacted source characters included in one review.
Supported files
TypeScript, JavaScript, JSX, TSX, JSON, and dotenv files are supported by the MVP.
Safe test
For a complete testing checklist, see the VibinGuard testing guide.
Use only fake values when testing secret detection:
const apiKey = "fake_test_1234567890abcdef";
Copy the snippet, open a TypeScript file, and run VibinGuard: Guard Clipboard Before Paste. The content should be blocked and the full fake value should not appear in diagnostics or logs.
Privacy
VibinGuard does not collect telemetry or send source code to a VibinGuard service. If local AI is enabled, reduced and redacted context is sent only to the loopback Ollama address configured by the user. See the privacy policy.
Current limitation
VibinGuard cannot intercept arbitrary edits made directly by third-party AI extensions. The clipboard guard protects the pre-insertion path; scan-on-save and project scans cover code after it reaches the editor but before commit.
AI review is an additional signal, not proof that code is secure. High-confidence AI findings can block guarded paste, while lower-confidence findings are presented for review.
Support
See the support guide for troubleshooting and reporting guidance. Never include a real credential in a report.