Guard-AI – A security linter for AI-generated code Guard-AI, a new security linter from developer Karthik VK, automatically catches AI-generated code vulnerabilities such as hallucinated dependencies, hardcoded secret placeholders, and truncated code comments before production. The tool supports Python, JavaScript/TypeScript, and package.json, features SQLite-backed caching for zero rate-limit hits, and integrates with CI/CD pipelines and pre-commit hooks. Automated linter that catches AI-generated vulnerabilities, hallucinated dependencies, and code truncations before they hit production. Large Language Models LLMs write great code, but they also introduce distinct security risks: Slopsquatting Hallucinated Packages : LLMs frequently invent non-existent PyPI and NPM dependencies e.g., fake llm helper 12345 . Attackers register these hallucinated names to execute supply-chain attacks. Hardcoded Secret Placeholders: LLMs fill missing keys with patterns like openai key = "your openai key here" , which developers often accidentally commit. Truncated Code Comments: AI models often output incomplete snippets containing ... rest of code here or // ... existing code , breaking logic in production. guard-ai runs directly in your CLI and CI/CD pipelines to block these issues instantly. - ?? Multi-Language Support: Scans Python .py , JavaScript/TypeScript .js , .ts , .jsx , .tsx , and package.json . - ?? High Performance Caching: SQLite-backed local registry lookup engine 24-hr TTL to query PyPI & NPM without hitting rate limits. - ?? Zero False-Positives: Smart filtering for Python standard libraries, Node built-ins, and local module structures. - ?? CI/CD Ready: Custom exit thresholds --fail-on HIGH and structured --json output for automated pipelines. - ?? Ignore Rule Engine: Seamless support for default ignores .venv , node modules , .gitignore , and .guardignore . Install locally using pip : pip install . --- ?? Pre-Commit Hook Integration Want to catch AI risks before you even commit? Add guard-ai to your project's .pre-commit-config.yaml : yaml repos: - repo: https://github.com/Karthikvk1899/guard-ai https://github.com/Karthikvk1899/guard-ai rev: v1.0.0 hooks: - id: guard-ai args: "--fail-on", "HIGH" ?? Pre-Commit Hook Integration Want to catch AI risks before you even commit? Add guard-ai to your project's .pre-commit-config.yaml: yaml repos: - repo: https://github.com/Karthikvk1899/guard-ai https://github.com/Karthikvk1899/guard-ai rev: v1.0.0 hooks: - id: guard-ai args: "--fail-on", "HIGH"