The noncanonical inflammasome is critical for cytosolic sensing of Gram-negative pathogens. Here, we show that bacterial infection induces caspy2 activation in zebrafish fibroblasts, which mediates pyroptosis via a caspase-5-like activity. Zebrafish caspy2 binds directly to lipopolysaccharide via the N-terminal pyrin death domain, resulting in caspy2 oligomerization, which is critical for pyroptosis. Furthermore, we show that caspy2 is highly expressed in the zebrafish gut and is activated during infection. Knockdown of caspy2 expression impairs the ability of zebrafish to restrict bacterial invasion in vivo, and protects larvae from lethal sepsis. Collectively, our results identify a crucial event in the evolution of pattern recognition into the death domain superfamily-mediated intracellular lipopolysaccharide-sensing pathway in innate immunity.