Here we demonstrate that a Gαq-RhoA pathway is required for both behavioral and immune responses to infection in C. elegans. The gene discussed is GNAQ; the disease is infection.