Microbial communities coat nearly every surface in the environment and have co-existed with animals throughout evolution. Whether animals exploit omnipresent microbial cues to navigate their surroundings is not well understood. Octopuses use “taste-by-touch” chemotactile receptors (CRs) to explore the seafloor, but how they distinguish meaningful surfaces from the rocks and crevices they encounter is unknown. Here, we report that secreted signals from microbiomes of ecologically relevant surfaces activate CRs to guide octopus behavior. Distinct molecules isolated from individual bacterial strains located on prey or eggs bind single CRs in subtly different structural conformations to elicit specific mechanisms of receptor activation, ion permeation and signal transduction, and maternal care and predation behavior. Thus, microbiomes on ecological surfaces act at the level of primary sensory receptors to inform behavior. Our study demonstrates that uncovering interkingdom interactions is essential to understanding how animal sensory systems evolved in a microbe-rich world.