The microorganisms in the gastrointestinal (GI) tract can influence the metabolism, immunity, and behavior of animal hosts. Increasing evidence suggests that communication between the host and the microbiome also occurs in the opposite direction, with hormones and other host-secreted compounds being sensed by microorganisms. Here, we addressed one key aspect of the host-microbe communication by studying chemotaxis of a model commensal bacterium, Escherichia coli, to several compounds present abundantly in the GI tract, namely catecholamines, thyroid hormones, and polyamines. Our results show that E. coli reacts to five out of ten analyzed chemicals, sensing melatonin, and spermidine as chemorepellents and showing mixed responses to dopamine, norepinephrine and 3,4-dihydroxymandelic acid. The strongest repellent response was observed for the polyamine spermidine, and we demonstrate that this response involves the low-abundance chemoreceptor Trg and the periplasmic binding protein PotD of the spermidine uptake system. The chemotactic effects of the tested compounds apparently correlate with their influence on growth and their stability in the GI tract, pointing to the specificity of the observed behavior. We hypothesize that the repellent responses observed at high concentrations of chemoeffective compounds might enable bacteria to avoid harmful levels of hormones and polyamines in the gut and, more generally, antimicrobial activities of the mucous layer.