BackgroundNudibranchs comprise a group of > 6000 marine soft-bodied mollusk species known to use secondary metabolites (natural products) for chemical defense. The full diversity of these metabolites and whether symbiotic microbes are responsible for their synthesis remains unexplored. Another issue in searching for undiscovered natural products is that computational analysis of genomes of uncultured microbes can result in detection of novel biosynthetic gene clusters; however, their in vivo functionality is not guaranteed which limits further exploration of their pharmaceutical or industrial potential. To overcome these challenges, we used a fluorescent pantetheine probe, which produces a fluorescent CoA-analog employed in biosynthesis of secondary metabolites, to label and capture bacterial symbionts actively producing these compounds in the mantle of the nudibranchDoriopsilla fulva.ResultsWe recovered the genome ofCandidatusDoriopsillibacter californiensis from theCa.Tethybacterales order, an uncultured lineage of sponge symbionts not found in nudibranchs previously. It forms part of the core skin microbiome ofD. fulvaand is nearly absent in its internal organs. We showed that crude extracts ofD. fulvacontained secondary metabolites that were consistent with the presence of a beta-lactone encoded inCa.D. californiensis genome. Beta-lactones represent an underexplored group of secondary metabolites with pharmaceutical potential that have not been reported in nudibranchs previously.ConclusionsAltogether, this study shows how probe-based, targeted sorting approaches can capture bacterial symbionts producing secondary metabolites in vivo.Video AbstractSupplementary InformationThe online version contains supplementary material available at 10.1186/s40168-023-01560-8.