The purple pigment violacein is well known for its numerous biological activities including antibacterial, antiviral, antiprotozoan, and antitumor effects. In the current study we identify violacein as the antinematode agent produced by the marine bacterium Microbulbifer sp. D250, thereby extending the target range of this small molecule. Heterologous expression of the violacein biosynthetic pathway in E. coli and experiments using pure violacein demonstrated that this secondary metabolite facilitates bacterial accumulation in the nematode intestine, which is accompanied by tissue damage and apoptosis. Nematodes such as Caenorhabditis elegans utilise a well-defined innate immune system to defend against pathogens. Using C. elegans as a model we demonstrate the DAF-2/DAF-16 insulin/IGF-1 signalling (IIS) component of the innate immune pathway modulates sensitivity to violacein-mediated killing. Further analysis shows that resistance to violacein can occur due to a loss of DAF-2 function and/or an increased function of DAF-16 controlled genes involved in antimicrobial production (spp-1) and detoxification (sod-3). These data suggest that violacein is a novel candidate antinematode agent and that the IIS pathway is also involved in the defence against metabolites from non-pathogenic bacteria.