Biologists have modeled the hagfish's gag-inducing defense mechanism mathematically.