Legal immunity is a type of legal protection which is offered to certain people in particular circumstances. Essentially, someone with this protection cannot be prosecuted. The most well known example of legal immunity is probably prosecutorial immunity, which is sometimes offered to a witness in exchange for his or her testimony in a case. In return for testifying, the prosecution agrees not to pursue the witness for crimes which he or she discusses in the testimony. This is often used in conspiracy cases where prosecutors are willing to let minor criminals go if it means that they can bring down ringleaders.
There are numerous different types of legal immunity, all of which offer different types of protections. In the case of prosecutorial immunity, for example, a prosecutor may choose to offer blanket immunity or use immunity. In blanket immunity, also known as transactional immunity, the prosecutor agrees not to pursue any sort of legal charges against the witness for past crimes. In use immunity, a prosecutor may not use the testimony of a witness to build a case against him or her, but the prosecutor is allowed to prosecute the witness for past crimes.
In many countries, judges are offered a form of legal immunity which is known as judicial immunity. Recognizing that it is important for judges to be fair and unbiased, nations do not allow certain types of legal cases against judges and court officials so that these people can conduct their jobs without fear of retaliatory legal action. Since a judge can make decisions which could negatively impact someone's life, this type of immunity can be very important. Similar protections are also sometimes offered to members of parliament or legislature.
Diplomats and sovereigns also have a special type of legal immunity. In the case of diplomats, governments recognize that diplomacy is extremely important, and that diplomats might be afraid to serve if they could be prosecuted in their host countries. Under the terms of diplomatic immunity, diplomats can be expelled, but they cannot generally be brought to trial for actions relating to their roles as diplomats. If a diplomat commits a crime such as murder, however, diplomatic immunity is waived. Sovereigns are assumed to be above the law in many nations, and therefore they are granted immunity.
It is important to remember that legal immunity comes in a variety of flavors. Witnesses who are granted immunity, for example, are exonerated of liability for past crimes, but they can still be brought to trial in the future for crimes they did not disclose, or for crimes committed after the trial. Legal immunity for people like diplomats and sovereigns also does not cover major crimes, and legislators and judges are still subject to the law outside the legislature and the courtroom.