Secondary metabolites often function as antipredator defenses, but when bioactive at low concentrations, their off-target effects on other organisms may be overlooked. Candidate "keystone molecules" are proposed to affect community structure and ecosystem functions, generally originating as defenses of primary producers; the broader effects of animal chemistry remain largely unexplored, however. Here, we characterize five previously unreported polyketides (alderenes A to E) biosynthesized by sea slugs reaching exceptional densities (up to 9000 slugs per square meter) in Northern Hemisphere estuaries. Alderenes comprise only 0.1% of slug wet weight, yet rendered live slugs or dead flesh unpalatable to three co-occurring consumers, making a potential food resource unavailable and redirecting energy flow in critical nursery habitat. Alderenes also displaced infauna from the upper sediment of the mudflat but attracted ovipositing snails. By altering communities, such compounds may have unexpected cascading effects on processes ranging from bioturbation to reproduction of species not obviously connected to the producing organisms, warranting greater attention by ecologists.