Many hands make light work: An LLM-based multi-agent system for detecting malicious PyPI packages

Malicious code in open-source repositories such as PyPI poses a growing threat to software supply chains. Traditional rule-based tools often overlook the semantic patterns in source code that are crucial for identifying adversarial components. Large language models (LLMs) show promise for software analysis, yet their use in interpretable and modular security pipelines remains limited. This paper presents LAMPS , a multi-agent system that employs collaborative LLMs to detect malicious PyPI packages. The system consists of four role-specific agents for package retrieval, file extraction, classification , and verdict aggregation , coordinated through the CrewAI framework. A prototype combines a fine-tuned CodeBERT model for classification with LLaMA 3 agents for contextual reasoning. LAMPS has been evaluated on two complementary datasets: D 1 , a balanced collection of 6,000 setup.py files, and D 2 , a realistic multi-file dataset with 1,296 files and natural class imbalance. On D 1 , LAMPS achieves 97.7% accuracy, surpassing MPHunter and TD-IDF stacking models–two state-of-the-art approaches. On D 2 , it reaches 99.5% accuracy and 99.5% balanced accuracy, outperforming RAG-based approaches and fine-tuned single-agent baselines. McNemar’s test confirmed these improvements as highly significant. The results demonstrate the feasibility of distributed LLM reasoning for malicious code detection and highlight the benefits of modular multi-agent designs in software supply chain security.

Authors

Institutions

Publication Details

Journal
Journal of Systems and Software
Published
2026-01-22
DOI
https://doi.org/10.1016/j.jss.2026.112792
Primary Topic
Advanced Malware Detection Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Many hands make light work: An LLM-based multi-agent system for detecting malicious PyPI packages

Claudio Di Sipio, Phuong Thi Lan Nguyen, Motunrayo Osatohanmen Ibiyo, Muhammad Umar Zeshan
Journal of Systems and Software
Advanced Malware Detection Techniques
article

Many hands make light work: An LLM-based multi-agent system for detecting malicious PyPI packages

Claudio Di Sipio, Phuong Thi Lan Nguyen, Motunrayo Osatohanmen Ibiyo, Muhammad Umar Zeshan
article en

Abstract

Malicious code in open-source repositories such as PyPI poses a growing threat to software supply chains. Traditional rule-based tools often overlook the semantic patterns in source code that are crucial for identifying adversarial components. Large language models (LLMs) show promise for software analysis, yet their use in interpretable and modular security pipelines remains limited. This paper presents LAMPS , a multi-agent system that employs collaborative LLMs to detect malicious PyPI packages. The system consists of four role-specific agents for package retrieval, file extraction, classification , and verdict aggregation , coordinated through the CrewAI framework. A prototype combines a fine-tuned CodeBERT model for classification with LLaMA 3 agents for contextual reasoning. LAMPS has been evaluated on two complementary datasets: D 1 , a balanced collection of 6,000 setup.py files, and D 2 , a realistic multi-file dataset with 1,296 files and natural class imbalance. On D 1 , LAMPS achieves 97.7% accuracy, surpassing MPHunter and TD-IDF stacking models–two state-of-the-art approaches. On D 2 , it reaches 99.5% accuracy and 99.5% balanced accuracy, outperforming RAG-based approaches and fine-tuned single-agent baselines. McNemar’s test confirmed these improvements as highly significant. The results demonstrate the feasibility of distributed LLM reasoning for malicious code detection and highlight the benefits of modular multi-agent designs in software supply chain security.

Journal of Systems and SoftwareVol. 236
University of L'Aquila (IT)
Peace, Justice and strong institutions
Openalex Percentile: Top 82%
Advanced Malware Detection Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.