<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mårten Fitzback</title>
    <description>The latest articles on DEV Community by Mårten Fitzback (@martenfitz).</description>
    <link>https://dev.to/martenfitz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4175011%2F1dee13b0-0091-4925-b239-1d64bb84e0ba.png</url>
      <title>DEV Community: Mårten Fitzback</title>
      <link>https://dev.to/martenfitz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/martenfitz"/>
    <language>en</language>
    <item>
      <title>Check that a package exists before your AI agent installs it</title>
      <dc:creator>Mårten Fitzback</dc:creator>
      <pubDate>Sat, 17 Oct 2026 14:51:51 +0000</pubDate>
      <link>https://dev.to/martenfitz/check-that-a-package-exists-before-your-ai-agent-installs-it-4l9k</link>
      <guid>https://dev.to/martenfitz/check-that-a-package-exists-before-your-ai-agent-installs-it-4l9k</guid>
      <description>&lt;p&gt;AI coding assistants are good at writing code and surprisingly confident about package names. Every so often they suggest one that does not exist. Attackers have noticed: they register the names models tend to invent and wait for someone to run the install command. The practice now has a name, "slopsquatting", next to the older typosquatting.&lt;/p&gt;

&lt;p&gt;If an agent in your workflow runs &lt;code&gt;npm install&lt;/code&gt; or &lt;code&gt;pip install&lt;/code&gt; on its own, one cheap check closes most of that gap: before installing, ask the registry whether the package is real, how old it is, and whether anything is known to be wrong with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to look at
&lt;/h2&gt;

&lt;p&gt;For each package name an agent proposes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Does it exist at all?&lt;/strong&gt; A missing package is the hallucination case. Stop there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How old is it, and how many versions does it have?&lt;/strong&gt; A package first published last week with one version deserves a second look, especially if its name is close to a popular one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is it deprecated or abandoned?&lt;/strong&gt; The last release date tells you whether anyone maintains it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Are there known security advisories?&lt;/strong&gt; Public advisory databases list them per version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How widely is it used?&lt;/strong&gt; On npm, weekly downloads separate the real &lt;code&gt;lodash&lt;/code&gt; from a lookalike.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can do all of this by hand against each registry's API. Each registry has its own format, which is where it gets tedious across npm, PyPI, crates.io, Go, Maven and NuGet.&lt;/p&gt;

&lt;h2&gt;
  
  
  A one-call version
&lt;/h2&gt;

&lt;p&gt;I wrapped those checks into one endpoint that returns the same shape for all six ecosystems:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--request&lt;/span&gt; GET &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--url&lt;/span&gt; &lt;span class="s1"&gt;'https://package-safety-checker.p.rapidapi.com/package?ecosystem=npm&amp;amp;name=lodash'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'x-rapidapi-host: package-safety-checker.p.rapidapi.com'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'x-rapidapi-key: YOUR_KEY'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The answer includes &lt;code&gt;exists&lt;/code&gt;, the latest version and release date, age in days, version count, weekly downloads for npm, licences, deprecation, known advisories with severity, and a &lt;code&gt;verdict&lt;/code&gt; of &lt;code&gt;ok&lt;/code&gt;, &lt;code&gt;caution&lt;/code&gt; or &lt;code&gt;not-found&lt;/code&gt; with the reasons. A second endpoint checks up to 10 packages in one call, which fits the "agent wants to install these five things" case.&lt;/p&gt;

&lt;p&gt;In an agent, the rule is simple: if the verdict is &lt;code&gt;not-found&lt;/code&gt;, refuse; if it is &lt;code&gt;caution&lt;/code&gt;, show the reasons to a human before installing.&lt;/p&gt;

&lt;p&gt;The free tier covers 50 checks a month: &lt;a href="https://rapidapi.com/Splzzze/api/package-safety-checker" rel="noopener noreferrer"&gt;Package Safety Checker on RapidAPI&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;This is screening, not a guarantee. A package can be old, popular and advisory-free and still be compromised tomorrow. Pin versions, use lockfiles, and keep install scripts in mind. The check simply removes the most common and most embarrassing failure: installing something that should never have existed.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>npm</category>
      <category>python</category>
    </item>
  </channel>
</rss>
