Project Info

SlopGuard

Devpost

Inspiration

A fascinating challenge highlighted in a 2025 USENIX Security study. Researchers evaluated 16 code-generation models across 576,000 Python and JavaScript code samples and discovered 205,474 unique hallucinated package names—packages that simply didn't exist. It's called slopsquatting. These fake package names being exploited by attackers as a weapon, register them on npm or PyPI, embed malware, and wait for developers to unknowingly install them. We saw an opportunity to contribute by building an intelligent review layer that automatically validates AI-generated dependencies before code is merged or deployed, helping developers catch hallucinated or malicious packages early. Our view is, if AI is accelerating software development, it should also be accompanied by smarter safeguards that make the ecosystem safer for everyone i.e. SlopGuard. How SlopGuard Works SlopGuard acts as an intelligent security reviewer for AI-generated code by performing the following checks on every Pull Request: Validate AI-Generated Dependencies: Extracts all newly added Python and JavaScript / TypeScript package imports and verifies them against the official npm and PyPI registries. It flags packages that don't exist, were recently registered, or have suspiciously limited metadata. Detect Unusual Code Changes: Identifies Pull Requests that modify significantly more files than described, helping reviewers spot unexpected scope creep. Protect Critical Security Logic: Detects the removal of authentication or authorization checks without an equivalent replacement, reducing the risk of accidental or malicious security regressions. Learn from Previous AI Hallucinations: Maintains a history of previously identified hallucinated package names and alerts reviewers when the same fake dependency appears again across future Pull Requests. Generate AI-Powered Risk Analysis: Sends only structured security findings—not the source code or raw diff—to GPT for analysis, which returns an overall risk score, a plain-language explanation, and actionable recommendations for reviewers. Provide Reliable Pull Request Feedback: Publishes a single, easy-to-understand review comment on the Pull Request. If the AI service is unavailable, SlopGuard automatically falls back to deterministic rule-based checks and clearly informs reviewers that AI analysis was skipped. Complement Existing Security Tools: Works alongside GitHub's Dependency Review and other security scanners, focusing specifically on AI-generated code risks instead of duplicating traditional dependency vulnerability checks. What Makes SlopGuard Different? We recognize that this problem is already being addressed by some excellent tools. For example, Slopcheck (https://github.com/vishal1610kamal/slopcheck) focuses on detecting hallucinated packages across multiple ecosystems, while Open Code Review (https://github.com/marketplace/actions/open-code-review) provides comprehensive AI-powered code reviews. SlopGuard takes a more focused approach instead of replacing these solutions. Our goal is to secure AI-generated code in Pull Requests. SlopGuard concentrates on Python and JavaScript ecosystems (PyPI and npm), validates AI-suggested dependencies, detects unexpected scope changes, identifies missing authentication or authorization checks, and combines all of these signals into a single, easy-to-understand risk assessment using GPT. Instead of presenting reviewers with a collection of isolated findings, SlopGuard provides one clear verdict with actionable insights, helping teams review AI-generated code faster and with greater confidence. How We Built SlopGuard SlopGuard built using Node.js 20, the GitHub Octokit SDK, and the OpenAI SDK, keeping the architecture intentionally simple. Before involving AI, SlopGuard performs its own deterministic security checks—such as validating package names against npm and PyPI, detecting unusual scope changes, and identifying removed authentication or authorization checks. Only these structured findings are sent to GPT for analysis, never the raw Pull Request code or diff. GPT then combines the evidence into a single risk score with a clear explanation and actionable recommendations for reviewers. One of our biggest design decisions was security. Although GitHub provides workflows that can access repository secrets on Pull Requests from forks, we intentionally avoided that approach because it could expose sensitive credentials to untrusted code. Instead, SlopGuard runs only in a secure workflow, uses trusted repository code, and skips forked Pull Requests in the first version. We also leveraged AI tools like Codex to accelerate development by generating the initial scaffolding, test cases, and registry integrations, while the security architecture, review logic, and AI decision-making workflow were carefully designed and implemented by us. Challenges We Faced One of our biggest lessons came while testing SlopGuard on our own Pull Requests. During one test, an invalid API key caused the GPT analysis to fail. However, the GitHub Action still posted a review comment based only on the rule-based checks, making it look as if the AI had reviewed the code successfully. That wasn't the experience we wanted, because transparency is essential when developers rely on AI for security insights. We fixed this by making the behavior explicit. Now, if GPT is unavailable for any reason, SlopGuard clearly states that the review is based only on deterministic rule-based checks and that AI analysis was skipped. We'd rather be honest about what happened than give developers a false sense of confidence. What We Learned One of our biggest takeaways was that AI works best as a decision-support tool, not as a replacement for security checks. SlopGuard first performs reliable rule-based validations, and then GPT brings those findings together into a simple, easy-to-understand risk summary that helps reviewers make faster and better decisions instead of interpreting multiple security signals on their own. We also learned how much AI can accelerate development. Codex helped us quickly build the initial code, registry integrations, and test cases, allowing us to focus our time on the parts that mattered most-designing a secure architecture, deciding what should be checked, and ensuring the tool remained transparent and trustworthy for developers. What's Next This is just the first version of SlopGuard, and we already have a clear roadmap for improving it. In future releases, we plan to suggest the most likely legitimate package when a hallucinated package is detected, use AI-powered tool calling to make package validation faster and more efficient, and leverage GPT with web search to verify packages that exist but appear suspicious or lack enough credibility. We also plan to update the same Pull Request comment instead of creating a new one after every code change, making reviews cleaner and less noisy. We intentionally left these features out of the first release so we could focus on building a solution that is simple, reliable, and trustworthy. Our priority was to get the core security checks right before adding more advanced capabilities.

Analysis

Compare with all teams

View

Metric

No commits on this project resolved to a GitHub account.

Technology

Found in codeClaimed only
  • JavaScriptIn code
  • OpenAIIn code
  • Node.jsClaimed
  • TypeScriptClaimed

2 of 4 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.

AI coding agents

No AI coding agent signals were found in this repository.

Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.

Codebase size

Source size

65 KB

Source files

5

Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.

0 stars