<?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: Xihe 曦和</title>
    <description>The latest articles on DEV Community by Xihe 曦和 (@xihegoddess).</description>
    <link>https://dev.to/xihegoddess</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3878419%2F938daacf-cc38-4568-bda7-b55e1639f1de.png</url>
      <title>DEV Community: Xihe 曦和</title>
      <link>https://dev.to/xihegoddess</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xihegoddess"/>
    <language>en</language>
    <item>
      <title>My AI told me to pip install a package that doesn't exist. Turns out someone already weaponized that.</title>
      <dc:creator>Xihe 曦和</dc:creator>
      <pubDate>Tue, 14 Apr 2026 13:28:48 +0000</pubDate>
      <link>https://dev.to/xihegoddess/my-ai-told-me-to-pip-install-a-package-that-doesnt-exist-turns-out-someone-already-weaponized-2eoi</link>
      <guid>https://dev.to/xihegoddess/my-ai-told-me-to-pip-install-a-package-that-doesnt-exist-turns-out-someone-already-weaponized-2eoi</guid>
      <description>&lt;p&gt;Last week I was working on a FastAPI project and Claude recommended a package called &lt;code&gt;huggingface-cli&lt;/code&gt;. Didn't think twice, just pip installed it. Import failed. Nothing worked.&lt;/p&gt;

&lt;p&gt;Spent way too long debugging before I actually went and checked PyPI. The package exists, but it's an empty shell. Some security researcher noticed AI keeps recommending this name, so he registered it first as an experiment. Three months. Thirty thousand downloads. Thirty thousand people did exactly what I did.&lt;/p&gt;

&lt;p&gt;The scary part is he was running an experiment so the package was empty. What if it wasn't?&lt;/p&gt;

&lt;p&gt;After that I got kind of paranoid and went through our entire requirements.txt checking every dependency one by one. Didn't find other fake ones, but the whole process pissed me off. How am I supposed to know next time? Am I going to manually search PyPI every time I add a dependency to make sure it's real? That's insane.&lt;/p&gt;

&lt;p&gt;And while I was at it I noticed something else. A couple places where AI called methods that flat out don't exist on the library. &lt;code&gt;prisma.client.softDelete()&lt;/code&gt; — Prisma doesn't have softDelete. But the way it wrote it looked completely natural. I missed it in review. Who knows how long it's been sitting there.&lt;/p&gt;

&lt;p&gt;And don't even get me started on the tests. Found one that mocked a return value and then asserted the result equaled the mock. What did that test? Nothing. It tested that jest works. Thanks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;spyOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;findById&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;mockResolvedValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// yeah great job&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Coverage looked fine. The test was useless.&lt;/p&gt;

&lt;p&gt;I'm having a bit of a trust crisis with AI-generated code right now. I saw a post on r/ClaudeAI the other day saying "Claude isn't dumber, it's just not trying," and honestly that hit a little too close to home. Like how much of what it writes can I actually trust? I searched around for tools that check for this kind of thing — fake packages, fake methods, useless tests — and couldn't really find anything designed for it. Linters don't check if a package exists. Code review can't keep up with the volume.&lt;/p&gt;

&lt;p&gt;Feels like something that should be automated but nobody's done it yet. Or maybe someone has and I just can't find it?&lt;/p&gt;

&lt;p&gt;Anyone else dealing with this? How do you handle it? If there's a tool I'm missing please tell me before I lose another afternoon to a package that doesn't exist.&lt;/p&gt;

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