A weakened bacterial toxin that stimulates antibody production and immunity against the disease it causes.