Vibe Codebase Audit

Comprehensive automated and multi-model AI security audits for AI-generated codebases, checking vulnerabilities, secrets, dependency risks, and config issues.

Terry S Fisher

@43622283

What This Skill Does

Multi-agent security auditing tool for AI-generated codebases. Scans for vulnerabilities, secrets, dependency risks, and configuration issues using automated pattern matching and optional multi-model AI consensus. Supports agent-native audit with zero setup, plus integration with OpenAI, Claude, DeepSeek, and local models.

Replaces manual code review and single-tool vulnerability scanners by combining static analysis with multi-model AI consensus for comprehensive, automated security audits.

When to Use It

  • Audit an AI-generated codebase for secrets, credentials, and API keys before publishing
  • Scan for dependency vulnerabilities and outdated packages in npm, pip, or cargo projects
  • Check configuration files for exposed .env, CORS misconfigurations, or debug mode enabled
  • Run a pre-deployment security review on vibe-coded projects to catch injection and path traversal risks
  • Integrate continuous security monitoring into CI/CD pipelines with incremental and diff audits
  • Define custom security rules for project-specific compliance or severity thresholds

Install

$ openclaw skills install @43622283/li-vibe-codebase-audit

๐Ÿ”’ Vibe Codebase Audit - Multi-Agent Security Audit Skill

Comprehensive security auditing for AI-generated codebases - Automated vulnerability scanning and multi-model AI consensus auditing.

Supports OpenCode, Hermes, OpenClaw, and other agentic AI systems with standardized MCP tool interface.


โญ NEW: Enhanced Features (v2.0)

๐Ÿค– Agent-Native Audit (Zero Setup!)

  • No API key required! Use your current agent's LLM connection directly
  • Seamlessly integrates with OpenCode, Hermes, OpenClaw
  • Leverages existing context and capabilities
  • Lower cost, better integration

๐Ÿ”Œ Multi-Provider Support

  • Agent LLM (Primary) - Use current agent's connection
  • OpenAI - GPT-4, GPT-4-turbo, and compatible APIs
  • Claude - Claude-3 Sonnet/Opus
  • DeepSeek - Cost-effective alternative
  • Qwen/Tongyi - Alibaba's models
  • Ollama - Run local models (Llama2, Mistral, etc.)
  • OpenRouter - Access to 100+ models

๐Ÿ“ฆ Dependency Security Scanning

  • Check for known vulnerabilities (CVE)
  • Detect outdated dependencies
  • License compliance checking
  • Support for npm, pip, maven, cargo, go mod

โš™๏ธ Configuration Security Checks

  • Exposed .env file detection
  • CORS misconfiguration detection
  • Authentication configuration review
  • Debug mode detection

๐Ÿš€ Performance Features

  • Smart Caching - Don't re-scan unchanged files
  • Incremental Audit - Only audit changed files
  • Diff Audit - Compare security state between commits
  • Parallel Processing - Multi-threaded scanning
  • History Tracking - Monitor security trends

๐Ÿ›ก๏ธ Custom Rule Engine

  • Define custom security patterns
  • YAML/JSON rule definitions
  • Severity customization
  • Project-specific rules

๐Ÿ“‹ Skill Overview

This skill provides comprehensive security auditing capabilities for "vibe coded" projects (AI-generated code) through multiple approaches:

  1. Automated Pattern Scanning - Fast local analysis for common security issues
  2. Multi-Model AI Consensus - Independent review by multiple AI models
  3. Agent-Native Audit - Use current agent's LLM (NEW!)
  4. Dependency Scanning - Check for vulnerable dependencies (NEW!)
  5. Configuration Audit - Check for config security issues (NEW!)

Use Cases:

  • Pre-publish security audits for open-source projects
  • CI/CD integration for continuous security monitoring
  • AI-generated code validation before deployment
  • Compliance checking for security standards

๐ŸŽฏ What This Skill Detects

Secrets & Credentials

  • โœ… API keys (OpenAI, Anthropic, AWS, GitHub, etc.)
  • โœ… Authentication tokens and bearer tokens
  • โœ… Database credentials and passwords
  • โœ… SSH keys and certificates
  • โœ… OpenRouter API keys

Personal Data Exposure

  • โœ… Email addresses
  • โœ… Phone numbers
  • โœ… SSN and credit card numbers
  • โœ… File paths revealing user directories
  • โœ… Obsidian vault references

Security Vulnerabilities

  • โœ… Command injection risks
  • โœ… SQL injection patterns
  • โœ… Path traversal vulnerabilities
  • โœ… Unsafe deserialization
  • โœ… Weak cryptography usage
  • โœ… Debug mode enabled

Code Quality Issues

  • โœ… Security-related TODOs/FIXMEs
  • โœ… Incomplete security implementations

๐Ÿ› ๏ธ Available Tools

1. vibe_audit_scan - Automated Pattern Scanner

Description: Fast local security scan using pattern matching and static analysis.

Parameters:

  • project_path (string, required): Path to the project directory to audit
  • output_format (string, optional): Report format - "json", "markdown", or "console" (default: "json")
  • severity_threshold (number, optional): Minimum severity to report (1-5, default: 3)

Returns:

{
  "risk_score": 0-100,
  "risk_level": "SAFE|LOW|MEDIUM|HIGH|CRITICAL",
  "total_findings": number,
  "findings_by_severity": {
    "critical": number,
    "high": number,
    "medium": number,
    "low": number
  },
  "detailed_findings": [...]
}

Risk Score Calculation:

  • Critical findings: 20 points each
  • High findings: 10 points each
  • Medium findings: 5 points each
  • Low findings: 2 points each

Example Usage:

# In OpenCode/Hermes/OpenClaw
result = vibe_audit_scan(
    project_path="/path/to/project",
    output_format="markdown",
    severity_threshold=3
)

2. vibe_audit_multi_model - AI Consensus Auditor

Description: Multi-model AI audit using Claude, GPT-4, and Gemini via OpenRouter API.

Parameters:

  • project_path (string, required): Path to the project directory to audit
  • models (array of strings, optional): AI models to use - default: ["claude", "gpt4", "gemini"]
  • openrouter_api_key (string, optional): OpenRouter API key (or use env var OPENROUTER_API_KEY)
  • consensus_mode (string, optional): How to determine consensus - "conservative" (max score) or "average" (default: "conservative")

Returns:

{
  "consensus_risk_score": 0-100,
  "consensus_risk_level": "SAFE|LOW|MEDIUM|HIGH|CRITICAL",
  "private_data_found": boolean,
  "publish_safe": "YES|NO|WITH_FIXES",
  "model_results": {
    "claude": {...},
    "gpt4": {...},
    "gemini": {...}
  },
  "all_findings": [...]
}

Prerequisites:

  • OpenRouter API key (set as OPENROUTER_API_KEY environment variable)
  • Internet connection for API calls

Example Usage:

result = vibe_audit_multi_model(
    project_path="/path/to/project",
    models=["claude", "gpt4"],
    consensus_mode="conservative"
)

3. vibe_audit_full - Complete Security Workflow

Description: Automated scan followed by multi-model consensus audit.

Parameters:

  • project_path (string, required): Path to the project directory to audit
  • auto_fix_suggestions (boolean, optional): Generate fix suggestions for findings (default: true)

Returns: Combined results from both audit methods plus actionable recommendations.

Workflow:

  1. Run automated scan
  2. If risk_score > 20, flag for review
  3. Run multi-model audit
  4. Generate comprehensive report with fix suggestions

๐Ÿ“Š Understanding Risk Levels

Risk LevelScore RangeAction Required
โœ… SAFE0-19Safe to publish
๐ŸŸก LOW1-19Minor issues, review recommended
๐ŸŸ  MEDIUM20-49Review and fix issues before publishing
๐Ÿ”ด HIGH50-79Significant issues, fixes required
โ›” CRITICAL80-100DO NOT PUBLISH - severe security risks

๐Ÿ”ง Agent Integration

OpenCode Integration

{
  "tools": ["vibe_audit_scan", "vibe_audit_multi_model", "vibe_audit_full"],
  "context": "security_audit",
  "auto_invoke": "pre_publish"
}

Hermes Integration

skill: li_vibe_codebase-audit
capabilities:
  - static_analysis
  - multi_model_consensus
  - security_patterns
triggers:
  - pre_commit
  - pre_publish

OpenClaw Integration

from skills import VibeCodebaseAudit

audit = VibeCodebaseAudit()
result = audit.scan("/project/path", mode="full")

Generic MCP Integration

All tools follow the MCP (Model Context Protocol) specification:

  • Input schema validation
  • Structured output format
  • Error handling with context
  • Tool discovery metadata

๐ŸŽ“ Recommended Workflow

Step 1: Initial Scan

vibe_audit_scan(project_path=".")

Review findings. If risk_score > 20, investigate flagged issues.

Step 2: Fix Critical Issues

  • Remove API keys and secrets
  • Redact personal file paths
  • Address security vulnerabilities

Step 3: Multi-Model Validation

vibe_audit_multi_model(project_path=".")

Get AI consensus on publish-readiness.

Step 4: Final Review

  • Check that all models agree (or understand disagreements)
  • Verify "private_data_found: false"
  • Confirm "publish_safe: YES"

Step 5: Publish

Once all audits pass, publish with confidence.


๐Ÿ” Privacy & Security

Automated Scan (vibe_audit_scan)

  • โœ… Runs entirely locally
  • โœ… No data transmitted
  • โœ… No external dependencies

Multi-Model Audit (vibe_audit_multi_model)

  • โš ๏ธ Code sent to AI providers via OpenRouter
  • โš ๏ธ Use ONLY on code you're comfortable sharing
  • โš ๏ธ OpenRouter privacy policy applies
  • ๐Ÿ’ก Best practice: Run automated scan first, fix issues, THEN run multi-model audit

๐Ÿ“ Output Formats

JSON Format

Structured data for programmatic use and CI/CD integration.

Markdown Format

Human-readable report for documentation and review.

Console Format

Colored terminal output for interactive use.


โš™๏ธ Configuration

Environment Variables

# Required for multi-model audit
export OPENROUTER_API_KEY="sk-or-v1-..."

# Optional: customize behavior
export VIBE_AUDIT_VERBOSE=true
export VIBE_AUDIT_MAX_FILE_SIZE=1000000  # 1MB default

Custom Patterns

Add project-specific security patterns:

{
  "custom_patterns": {
    "MyAPI Key": "my_api_key_pattern_here",
    "Internal Token": "internal_token_regex"
  }
}

Ignored Paths

Default ignored directories:

  • .git/, node_modules/, __pycache__/
  • .DS_Store, venv/, .venv/
  • dist/, build/

๐Ÿš€ Advanced Features

CI/CD Integration

# GitHub Actions example
- name: Security Audit
  run: |
    vibe_audit_scan project_path="." output_format="json"
    if [ $(jq '.risk_score' audit-report.json) -gt 50 ]; then
      echo "Risk score too high!"
      exit 1
    fi

Batch Processing

projects = ["~/project1", "~/project2", "~/project3"]
for project in projects:
    result = vibe_audit_full(project_path=project)
    print(f"{project}: {result['risk_level']}")

Custom Severity Thresholds

# Only report HIGH and CRITICAL issues
result = vibe_audit_scan(
    project_path=".",
    severity_threshold=4  # 4=HIGH, 5=CRITICAL
)

๐Ÿค Supported Agents

AgentIntegration TypeFeatures
OpenCodeNative skillAll tools, auto-discovery
HermesPluginStatic analysis, consensus
OpenClawModuleFull API, custom workflows
Generic MCPProtocolStandard MCP interface
ClaudeTool callingVia OpenRouter integration
GPT-4Tool callingVia OpenRouter integration
GeminiTool callingVia OpenRouter integration

๐Ÿ“š Examples

Example 1: Pre-Publish Audit

# Quick check before publishing
result = vibe_audit_scan(project_path=".")
if result['risk_score'] > 20:
    print("โš ๏ธ Issues found - review before publishing")
    for finding in result['detailed_findings']:
        print(f"- {finding['severity']}: {finding['issue']}")
else:
    print("โœ… Safe to publish")

Example 2: CI/CD Gate

# Block deployment if critical issues found
- vibe_audit_scan(project_path=".")
- condition: result.risk_level != "CRITICAL"
  then: deploy()
  else: alert_team()

Example 3: Multi-Model Validation

# Get consensus from multiple AI models
result = vibe_audit_multi_model(
    project_path=".",
    models=["claude", "gpt4", "gemini"],
    consensus_mode="conservative"
)

if result['publish_safe'] == "YES":
    publish()
elif result['publish_safe'] == "WITH_FIXES":
    apply_fixes(result['required_fixes'])
    re_audit()
else:
    halt_publish()

๐ŸŽฏ Real-World Scenarios

Scenario 1: Tea App Incident Prevention

The 2023 Tea dating app incident (database credentials leaked in public repo) would have been prevented:

  1. vibe_audit_scan would flag database credentials immediately
  2. Risk score would be CRITICAL (80+)
  3. Developer alerted before publishing

Scenario 2: Obsidian Vault Leak

Developer uses AI to generate code that references their Obsidian notes:

  1. vibe_audit_scan detects /Users/name/obsidian/vault paths
  2. Multi-model audit confirms private data exposure
  3. Paths redacted before publishing

Scenario 3: API Key in Config

AI-generated code includes hardcoded API key:

  1. Automated scan detects sk-or-v1-... pattern
  2. Severity: CRITICAL (API key exposure)
  3. Fix suggestion: Use environment variable instead

๐Ÿ” Troubleshooting

Common Issues

Issue: "No files found to scan"

  • Cause: Path doesn't exist or all files are ignored
  • Fix: Check path validity and ignored patterns

Issue: "OPENROUTER_API_KEY not set"

  • Cause: Multi-model audit requires API key
  • Fix: Set environment variable or pass key directly

Issue: "Risk score seems too high"

  • Cause: False positives from example/placeholder values
  • Fix: Review findings - example keys have reduced severity

Issue: "Models disagree on risk level"

  • Cause: Different security perspectives
  • Fix: Use "conservative" consensus mode (takes highest risk)

๐Ÿ“– Additional Resources


๐Ÿ“œ License

MIT License - Use freely for personal and commercial projects.


๐ŸŽฏ Roadmap

Future enhancements:

  • GUI interface for non-technical users
  • VS Code extension for real-time scanning
  • Pre-commit hooks for automatic auditing
  • Additional AI model support
  • Custom reporting templates
  • Team/enterprise features

Ship with confidence. Audit with rigor. Vibe in peace. ๐Ÿš€


๐Ÿ’ก Quick Reference

ToolSpeedAccuracyBest For
vibe_audit_scanFast (seconds)Pattern-basedQuick checks, CI/CD
vibe_audit_multi_modelSlower (minutes)AI-poweredPre-publish validation
vibe_audit_fullComprehensiveBoth methodsComplete workflow

Choose based on your needs:

  • Quick check โ†’ vibe_audit_scan
  • Thorough validation โ†’ vibe_audit_multi_model
  • Complete audit โ†’ vibe_audit_full

Top skills in this category

Skill Vetter

@spclaudehome

Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.

1.3k271k

Skill Vetter - Pre-Install Security Review

@donovanpankratz-del

Security vetting protocol before installing any AI agent skill. Red flag detection for credential theft, obfuscated code, exfiltration. Risk classification L...

2726k

google-slides

@byungkyu

Google Slides API integration with managed OAuth. Create presentations, add slides, insert content, and manage slide formatting. Use this skill when users want to interact with Google Slides. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Calls run through the `maton` CLI with OAuth login; default to read and list calls, and confirm every write or new connection with the user.

3320k

google-workspace-admin

@byungkyu

Google Workspace Admin SDK integration with managed OAuth. This is a write-capable administrative integration for users, groups, organizational units, roles, and domain settings. Only connect with a least-privileged Google admin account, restrict OAuth scopes to the specific resources needed, and revoke the connection after use. All write operations require explicit user approval showing the exact HTTP method, endpoint path, and target resource identifier before execution. Use this skill only when users need Google Workspace administration. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Calls run through the `maton` CLI with OAuth login; default to read and list calls, and confirm every write or new connection with the user.

2118k

OpenClaw Token Optimizer

@asif2bd

OpenClaw Token Optimizer v3.2.0 โ€” practical cost-control toolkit for OpenClaw agents. Lazy context loading, Sonnet/Opus-aware routing, heartbeat scheduling,...

3013k