immunity to infectious agent