Blog
/
/
October 30, 2023

Exploring AI Threats: Package Hallucination Attacks

Learn how malicious actors exploit errors in generative AI tools to launch packet attacks. Read how Darktrace products detect and prevent these threats!
Inside the SOC
Darktrace cyber analysts are world-class experts in threat intelligence, threat hunting and incident response, and provide 24/7 SOC support to thousands of Darktrace customers around the globe. Inside the SOC is exclusively authored by these experts, providing analysis of cyber incidents and threat trends, based on real-world experience in the field.
Written by
Charlotte Thompson
Cyber Analyst
Written by
Tiana Kelly
Senior Cyber Analyst & Team Lead
Default blog image
30
Oct 2023

AI tools open doors for threat actors

On November 30, 2022, the free conversational language generation model ChatGPT was launched by OpenAI, an artificial intelligence (AI) research and development company. The launch of ChatGPT was the culmination of development ongoing since 2018 and represented the latest innovation in the ongoing generative AI boom and made the use of generative AI tools accessible to the general population for the first time.

ChatGPT is estimated to currently have at least 100 million users, and in August 2023 the site reached 1.43 billion visits [1]. Darktrace data indicated that, as of March 2023, 74% of active customer environments have employees using generative AI tools in the workplace [2].

However, with new tools come new opportunities for threat actors to exploit and use them maliciously, expanding their arsenal.

Much consideration has been given to mitigating the impacts of the increased linguistic complexity in social engineering and phishing attacks resulting from generative AI tool use, with Darktrace observing a 135% increase in ‘novel social engineering attacks’ across thousands of active Darktrace/Email™ customers from January to February 2023, corresponding with the widespread adoption of ChatGPT and its peers [3].

Less overall consideration, however, has been given to impacts stemming from errors intrinsic to generative AI tools. One of these errors is AI hallucinations.

What is an AI hallucination?

AI “hallucination” is a term which refers to the predictive elements of generative AI and LLMs’ AI model gives an unexpected or factually incorrect response which does not align with its machine learning training data [4]. This differs from regular and intended behavior for an AI model, which should provide a response based on the data it was trained upon.  

Why are AI hallucinations a problem?

Despite the term indicating it might be a rare phenomenon, hallucinations are far more likely than accurate or factual results as the AI models used in LLMs are merely predictive and focus on the most probable text or outcome, rather than factual accuracy.

Given the widespread use of generative AI tools in the workplace employees are becoming significantly more likely to encounter an AI hallucination. Furthermore, if these fabricated hallucination responses are taken at face value, they could cause significant issues for an organization.

Use of generative AI in software development

Software developers may use generative AI for recommendations on how to optimize their scripts or code, or to find packages to import into their code for various uses. Software developers may ask LLMs for recommendations on specific pieces of code or how to solve a specific problem, which will likely lead to a third-party package. It is possible that packages recommended by generative AI tools could represent AI hallucinations and the packages may not have been published, or, more accurately, the packages may not have been published prior to the date at which the training data for the model halts. If these hallucinations result in common suggestions of a non-existent package, and the developer copies the code snippet wholesale, this may leave the exchanges vulnerable to attack.

Research conducted by Vulcan revealed the prevalence of AI hallucinations when ChatGPT is asked questions related to coding. After sourcing a sample of commonly asked coding questions from Stack Overflow, a question-and-answer website for programmers, researchers queried ChatGPT (in the context of Node.js and Python) and reviewed its responses. In 20% of the responses provided by ChatGPT pertaining to Node.js at least one un-published package was included, whilst the figure sat at around 35% for Python [4].

Hallucinations can be unpredictable, but would-be attackers are able to find packages to create by asking generative AI tools generic questions and checking whether the suggested packages exist already. As such, attacks using this vector are unlikely to target specific organizations, instead posing more of a widespread threat to users of generative AI tools.

Malicious packages as attack vectors

Although AI hallucinations can be unpredictable, and responses given by generative AI tools may not always be consistent, malicious actors are able to discover AI hallucinations by adopting the approach used by Vulcan. This allows hallucinated packages to be used as attack vectors. Once a malicious actor has discovered a hallucination of an un-published package, they are able to create a package with the same name and include a malicious payload, before publishing it. This is known as a malicious package.

Malicious packages could also be recommended by generative AI tools in the form of pre-existing packages. A user may be recommended a package that had previously been confirmed to contain malicious content, or a package that is no longer maintained and, therefore, is more vulnerable to hijack by malicious actors.

In such scenarios it is not necessary to manipulate the training data (data poisoning) to achieve the desired outcome for the malicious actor, thus a complex and time-consuming attack phase can easily be bypassed.

An unsuspecting software developer may incorporate a malicious package into their code, rendering it harmful. Deployment of this code could then result in compromise and escalation into a full-blown cyber-attack.

Figure 1: Flow diagram depicting the initial stages of an AI Package Hallucination Attack.

For providers of Software-as-a-Service (SaaS) products, this attack vector may represent an even greater risk. Such organizations may have a higher proportion of employed software developers than other organizations of comparable size. A threat actor, therefore, could utilize this attack vector as part of a supply chain attack, whereby a malicious payload becomes incorporated into trusted software and is then distributed to multiple customers. This type of attack could have severe consequences including data loss, the downtime of critical systems, and reputational damage.

How could Darktrace detect an AI Package Hallucination Attack?

In June 2023, Darktrace introduced a range of DETECT™ and RESPOND™ models designed to identify the use of generative AI tools within customer environments, and to autonomously perform inhibitive actions in response to such detections. These models will trigger based on connections to endpoints associated with generative AI tools, as such, Darktrace’s detection of an AI Package Hallucination Attack would likely begin with the breaching of one of the following DETECT models:

  • Compliance / Anomalous Upload to Generative AI
  • Compliance / Beaconing to Rare Generative AI and Generative AI
  • Compliance / Generative AI

Should generative AI tool use not be permitted by an organization, the Darktrace RESPOND model ‘Antigena / Network / Compliance / Antigena Generative AI Block’ can be activated to autonomously block connections to endpoints associated with generative AI, thus preventing an AI Package Hallucination attack before it can take hold.

Once a malicious package has been recommended, it may be downloaded from GitHub, a platform and cloud-based service used to store and manage code. Darktrace DETECT is able to identify when a device has performed a download from an open-source repository such as GitHub using the following models:

  • Device / Anomalous GitHub Download
  • Device / Anomalous Script Download Followed By Additional Packages

Whatever goal the malicious package has been designed to fulfil will determine the next stages of the attack. Due to their highly flexible nature, AI package hallucinations could be used as an attack vector to deliver a large variety of different malware types.

As GitHub is a commonly used service by software developers and IT professionals alike, traditional security tools may not alert customer security teams to such GitHub downloads, meaning malicious downloads may go undetected. Darktrace’s anomaly-based approach to threat detection, however, enables it to recognize subtle deviations in a device’s pre-established pattern of life which may be indicative of an emerging attack.

Subsequent anomalous activity representing the possible progression of the kill chain as part of an AI Package Hallucination Attack could then trigger an Enhanced Monitoring model. Enhanced Monitoring models are high-fidelity indicators of potential malicious activity that are investigated by the Darktrace analyst team as part of the Proactive Threat Notification (PTN) service offered by the Darktrace Security Operation Center (SOC).

Conclusion

Employees are often considered the first line of defense in cyber security; this is particularly true in the face of an AI Package Hallucination Attack.

As the use of generative AI becomes more accessible and an increasingly prevalent tool in an attacker’s toolbox, organizations will benefit from implementing company-wide policies to define expectations surrounding the use of such tools. It is simple, yet critical, for example, for employees to fact check responses provided to them by generative AI tools. All packages recommended by generative AI should also be checked by reviewing non-generated data from either external third-party or internal sources. It is also good practice to adopt caution when downloading packages with very few downloads as it could indicate the package is untrustworthy or malicious.

As of September 2023, ChatGPT Plus and Enterprise users were able to use the tool to browse the internet, expanding the data ChatGPT can access beyond the previous training data cut-off of September 2021 [5]. This feature will be expanded to all users soon [6]. ChatGPT providing up-to-date responses could prompt the evolution of this attack vector, allowing attackers to publish malicious packages which could subsequently be recommended by ChatGPT.

It is inevitable that a greater embrace of AI tools in the workplace will be seen in the coming years as the AI technology advances and existing tools become less novel and more familiar. By fighting fire with fire, using AI technology to identify AI usage, Darktrace is uniquely placed to detect and take preventative action against malicious actors capitalizing on the AI boom.

Credit to Charlotte Thompson, Cyber Analyst, Tiana Kelly, Analyst Team Lead, London, Cyber Analyst

References

[1] https://seo.ai/blog/chatgpt-user-statistics-facts

[2] https://darktrace.com/news/darktrace-addresses-generative-ai-concerns

[3] https://darktrace.com/news/darktrace-email-defends-organizations-against-evolving-cyber-threat-landscape

[4] https://vulcan.io/blog/ai-hallucinations-package-risk?nab=1&utm_referrer=https%3A%2F%2Fwww.google.com%2F

[5] https://twitter.com/OpenAI/status/1707077710047216095

[6] https://www.reuters.com/technology/openai-says-chatgpt-can-now-browse-internet-2023-09-27/

Inside the SOC
Darktrace cyber analysts are world-class experts in threat intelligence, threat hunting and incident response, and provide 24/7 SOC support to thousands of Darktrace customers around the globe. Inside the SOC is exclusively authored by these experts, providing analysis of cyber incidents and threat trends, based on real-world experience in the field.
Written by
Charlotte Thompson
Cyber Analyst
Written by
Tiana Kelly
Senior Cyber Analyst & Team Lead

More in this series

No items found.

Blog

/

/

June 9, 2026

Always On, Always Defending: Inside the AI-Driven SOC

Default blog imageDefault blog image

Today’s SOC: A system under pressure

The SOC has been described as the:

  • Control center for security systems management  
  • Operations center for log analysis and alert response
  • Command center for network monitoring and investigation

But the CISO at a manufacturer of industrial power solutions says today’s SOC is far more dynamic:

“The SOC is an active player in a never-ending chess match where the pieces are always moving, the rules are constantly changing, and we’re continuously adjusting our tactical and strategic approaches to keep up.”

This has created a balancing act for cybersecurity professionals:

  • Support expanding digital estates to fuel innovation…or risk limiting business growth
  • Stop advanced cyberattacks at scale…or risk severe financial and reputational impacts

But balancing these responsibilities is increasingly difficult. Attackers are operating at machine speed and scale using sophisticated, adaptive techniques that overwhelm teams and bypass legacy defenses. At the same time, more than half of cybersecurity teams are understaffed, and 65% have unfilled cybersecurity positions (ISACA).

“The SOC is hitting its breaking point,” admits the VP of IT at a U.S.-based risk management services provider.”

“That’s the hard reality,” affirms a Chief Digital and Technology Officer at a North American financial services organization. “SOC teams are drowning in alerts, wasting time researching the most benign incidents while missing critical threats.”

Traditional tools lack the context and autonomous reasoning needed to determine which ones are truly dangerous, requiring analysts to manually review and respond. But with thousands of alerts hitting SOCs daily, the task exceeds human capacity, with recent industry research revealing that 40% to 42% of security alerts now go uninvestigated.

“Our old governance models of throwing bodies at it, that’s not going to work,” says the Group CIO of a multinational holding company. “Attackers move at machine speed, and our defenses have to operate at the same pace. Using AI for cybersecurity is the only way to do that.”

Why AI is essential

AI is about speed, scale, and context.

SOC teams are still expected to find the proverbial “needle in a haystack”, but the haystack keeps growing. As digital infrastructures expand and threat actors use AI to rapidly scale attacks and exploit vulnerabilities, success isn’t about keeping up but changing the approach.

This is where AI comes in, enabling security teams to operate at machine speed and scale by:

  • Analyzing vast amounts of data and correlating signals across domains within seconds
  • Detecting possible threats in real time and taking immediate action to mitigate risk
  • Prioritizing threats by severity and uncovering contextual details for rapid triage

The power of AI isn’t theoretical; it is transforming how today’s businesses operate.

The Chief Digital and Technology Officer at a financial services firm says within a single month of using Darktrace, the solution tracked billions of network events, autonomously investigated tens of millions of those incidents, and added the equivalent of 1,000 analyst hours of investigation. It also found threats that bypassed traditional tools, autonomously responding to contain or disrupt the threat on over 30,000 emails, including 18,000 the firm’s native email filter missed.

When Darktrace says it “takes action on a threat,” it generally means its platform can move beyond just detecting suspicious activity and automatically respond to contain or disrupt the threat—such as isolating a device, slowing or blocking suspicious network traffic, disabling risky user activity, or triggering security workflows—depending on how the system is configured.

AI isn’t about displacing humans.

AI is a powerful tool for handling large-scale data analysis, pattern detection, and repetitive tasks, but it cannot replace human critical thinking. By removing mindless work that does not require judgment, AI frees analysts to focus on what humans do best: applying reasoning, context, and sound decision-making to complex threats.

“AI is a workforce maximizer,” says the Chief Digital and Technology Officer. “It augments our team by monitoring and detecting threats at a scale beyond human capacity while providing the critical context we need to make faster, more confident decisions.

Rather than replacing people, AI is changing how security professionals work. Analysts can reclaim time previously spent on tedious, manual triage to focus on higher priorities and proactive initiatives like advanced threat hunting, strategic risk management, and security enablement and training.

“Aside from risk mitigation, our biggest ROI is in efficiency,” says the Head of Security at global business services provider. “What used to take 90% of our investigation time is now handled automatically, so we can focus on the final 10%, which requires critical thinking."

For SOC teams under pressure, the impact can be transformative, with security leaders reporting significant real-world outcomes using Darktrace Self-Learning AITM, including:

  • Phishing emails reduced by 99%
  • 1 million+ emails autonomously analyzed each month, with no email-based incidents reported
  • Potential threats autonomously neutralized in under four seconds, on average  
  • 99% of investigations conducted autonomously, surfacing only the high-priority 1% of threats for analyst review

How AI optimizes the SOC

To protect the modern enterprise, you absolutely need the right tools,” says CTO at leading European fashion brand. “Without them you’re a victim. With them, you’re a defender. AI and the machine speed detect/response it enables makes it the most critical tool.”

Replacing chaos with clarity and control  

It’s important to note that different AI solutions address different needs. Companies should clearly understand their specific use case and select the solution that best aligns with their goals, requirements, and operational needs.  

When it comes to choosing cybersecurity in a machine-speed threat landscape, time is the most valuable resource. Organizations require AI that can move from insight to action by:

  • Learning an organization’s unique behavioral patterners
  • Correlating signals across domains to detect anomalous activity
  • Prioritizing events and autonomously responding at scale to the vast majority
  • Quarantining high-impact threats until the SOC can investigate
  • Arming analysts with deep, contextual information to accelerate investigations

“Darktrace AI gives us threat detections based on facts, not guesses,” says the Group CIO. “It moves the SOC beyond alert overload to confident, informed decision-making. When Darktrace flags something, we pay attention. False positives are very rare, so we act with speed and confidence without second-guessing.”

Replacing anxiety with confidence and peace of mind

Every missed alert can have real-world consequences.

The strain of maintaining constant vigilance at scale without holistic visibility and automation is taking its toll on security professionals: 66% report increased stress, and nearly half say it’s the reason they’re leaving the field (ISACA).

The CIO at a professional sports organization says that’s not surprising: “If you don’t know what’s going on, anything could be happening. Operating with that level of uncertainty and control is incredibly stressful.”

AI gives SOCs the power to be proactive by unifying telemetry across network, email, identity, and cloud environments to provide a complete picture and a stronger foundation for action. The benefits for analysts, both personally and professionally, are significant:

  • Achieve greater work-life balance: “Knowing that Darktrace has our backs 24/7 and will take immediate action to stop threats  means we can now work normal hours and take vacations without worrying,” says the Chief Digital and Technology Officer.
  • Feel in control with deeper insights: “It not only stops and quarantines threats but also provides the deep context we need to quickly investigate and respond,” explains the Head of Security.  
  • Gain confidence the business is protected 24/7: “We can sleep at night. With Darktrace I’m confident that even with a small team we can protect the business 24/7,” adds the former retail CIO.

The modern SOC: A system of balance

Elevated to a core pillar of business strategy, the modern SOC is now considered:

  • The nerve center of cyber risk and proactive defense
  • The AI-powered command center for operational resilience
  • The strategic hub for contextual decision-making at scale

The SOC has evolved from a reactive center responsible for managing systems into a proactive, frontline defender and strategic business enabler—integral to innovation and growth.

AI is the key to balancing these responsibilities.

“We can only grow as fast as we can secure the business,” says the Head of Security. “AI gives us the speed, scale, and confidence to do both.”

*Metrics are based on the customer’s interview, data and sourced from its monthly Cyber AI Insights reporting.

Continue reading
About the author
The Darktrace Community

Blog

/

Proactive Security

/

June 3, 2026

Stopping Stealth Attacks with Precision: How Núclea Prevented a Breach Without Disruption

Default blog imageDefault blog image

Núclea is a Brazilian data and technology company that supports the country’s financial system by delivering digital services exclusively to banks and financial institutions. Operating in an environment where trust, availability, and data integrity are critical, the company faces a threat landscape that has evolved rapidly—particularly with the rise of AI-driven cyberattacks.

Brazil has experienced a wave of successful cyber incidents targeting financial institutions, many of them enabled by insiders or compromised credentials. The result was a noticeable shift in attacker strategy: instead of focusing on end customers, threat actors began targeting the institutions and platforms that underpin the financial ecosystem itself.

“Attacks became far more directed and contextual,” explains Guilherme, who leads incident response within Núclea’s security platform engineering team. “They weren’t noisy or obviously malicious—they were precise, patient, and designed to blend into normal operations.”

That precision was on full display in January 2026, when Núclea faced one of the most convincing phishing attacks the team had seen.

A real attack, built on trust and context

The attack began with a seemingly routine email.

It was sent from a real Brazilian government institution, using legitimate infrastructure and valid credentials that were later confirmed to have been compromised. Núclea had an established, ongoing relationship with this organization, and the email’s language, tone, and subject matter aligned perfectly with the type of communication the recipient team handled every day.

Attached to the email was a PDF document containing content that looked entirely legitimate.

The problem? A single URL embedded inside that PDF.

“The message itself was correct. The sender was real. The context was familiar. Even the document content made sense,” Guilherme explains. “There was just one small element that didn’t belong.”

That small detail was enough to initiate a full attack chain.

What the attackers were trying to do

If clicked, the URL would have downloaded a malicious payload designed to:

  • Collect information about the user and device
  • Identify where the system was located within the financial ecosystem
  • Install remote access tools to maintain control
  • Deploy an infostealer to extract sensitive data
  • Execute anti-forensic scripts to erase traces of the intrusion

In other words, it was a carefully engineered operation designed for persistence and stealth, not immediate disruption.

The attack also employed urgency—a classic social engineering technique. When the link didn’t open as expected, employees requested assistance from the security team, insisting the document was important and needed to be accessed quickly.

This is precisely the kind of scenario where traditional security tools struggle: almost everything about the interaction is legitimate.

Where Darktrace made the difference

Instead of blocking the entire message or relying on known indicators of compromise, Darktrace focused on behavioral context.

Darktrace recognized:

  • That the sending organization was normally trusted
  • That the communication pattern matched historical behavior
  • That the PDF content itself was not suspicious

But it also identified that the URL embedded within the document deviated from established behavioral patterns.

Rather than disrupting business operations, Darktrace took precise action: it rewrote the URL, preventing the malicious download while leaving the rest of the email untouched.

“When we analyzed it afterward, it became clear how dangerous the attack would have been,” says Guilherme. “But it never progressed—because Darktrace acted at exactly the right point.”

Subsequent forensic analysis confirmed the payload’s malicious intent. The attack never succeeded.

Precision over disruption

For Núclea, this incident reinforced a critical lesson: modern attacks don’t always look malicious—they hide within normal activity.

“What stands out to me is the precision,” Guilherme says. “Darktrace doesn’t rely on big, obvious signals. It’s effective in situations that fall outside the standard patterns we all know.”

Building resilience in a high trust ecosystem

For Núclea, cybersecurity is not just a defensive measure—it’s a business enabler.

Availability failures or successful breaches in the financial ecosystem can have immediate, large-scale consequences, from financial loss to reputational damage. Preventing those outcomes protects not just Núclea, but its partners and customers as well.

“Cyber resilience means keeping the business running—even under attack,” Guilherme explains. “And that requires people, processes, and technology working together.”

As AI continues to accelerate both attacks and defenses, the role of security is evolving. Precision, behavioral understanding, and intelligent automation are no longer optional—they’re essential.

“The easy days were yesterday,” Guilherme says. “The challenges ahead are bigger. We need to be prepared—internally and with partners that help us build resilience.”

Continue reading
About the author
Your data. Our AI.
Elevate your network security with Darktrace AI