An exemption that a person (individual or corporate) enjoys from the normal operation of the law such as a legal duty or liability, either criminal or civil.
Some people have immunity just because of the office they occupy such as judge's having immunity from being sued for decisions taken during the course of a trial.
Diplomats enjoy diplomatic immunity.
Another example of an immunity is where a witness agrees to testify and incriminate themselves, but only if their testimony cannot be used at some later date against the witness.