GO:0006955: immune response
Any immune system process that functions in the calibrated response of an organism to a potential internal or invasive threat.