Contamination of crop seeds and feed with Aspergillus flavus and its associated aflatoxins presents a significant threat to human and animal health due to their hepatotoxic and carcinogenic properties. To address this challenge, researchers have screened for potential biological control agents in peanut soil and pods. This study identified a promising candidate, a strain of the nonpigmented bacterium, Achromobacter xylosoxidans ZJS2-1, isolated from the peanut rhizosphere in Zhejiang Province, China, exhibiting notable antifungal and antiaflatoxin activities. Further investigations demonstrated that ZJS2-1 active substances (ZAS) effectively inhibited growth at a MIC of 60 μL/mL and nearly suppressed AFB1 production by 99%. Metabolomic analysis revealed that ZAS significantly affected metabolites involved in cell wall and membrane biosynthesis, leading to compromised cellular integrity and induced apoptosis in A. flavus through the release of cytochrome c. Notably, ZAS targeted SrbA, a key transcription factor involved in ergosterol biosynthesis and cell membrane integrity, highlighting its crucial role in ZJS2-1's biocontrol mechanism. Moreover, infection of crop seeds and plant wilt caused by A. flavus can be efficiently alleviated by ZAS. Additionally, ZJS2-1 and ZAS demonstrated significant inhibitory effects on various Aspergillus species, with inhibition rates ranging from 80 to 99%. These findings highlight the potential of ZJS2-1 as a biocontrol agent against Aspergillus species, offering a promising solution to enhance food safety and protect human health.