There are many kinds:
Immunity
Immunity refers to legal protection that exempts a person from liability, punishment, or legal action that would otherwise apply. Immunity can be granted in various contexts, including criminal and civil cases, administrative proceedings, and legislative inquiries. For example, see "immunity from prosecution"
The concept of immunity has its roots in the common law, but it has been codified in various statutes and legal codes. For example, the U.S. Constitution's Supremacy Clause grants immunity to federal officials performing their official duties.
Qualified immunity is a type of legal immunity. “Qualified immunity balances two important interests—the need to hold public officials accountable when they exercise power irresponsibly and the need to shield officials from harassment, distraction, and liability when they perform their duties reasonably.” Pearson v. Callahan .
Specifically, qualified immunity protects a government official from lawsuits alleging that the official violated a plaintiff's rights, only allowing suits where officials violated a “clearly established” statutory or constitutional right.
The sovereign immunity refers to the fact that the government cannot be sued without its consent.
Sovereign immunity was derived from British common law doctrine based on the idea that the King could do no wrong. In the United States, sovereign immunity typically applies to the federal government and state government, but not to municipalities. Federal and state governments, however, have the ability to waive their sovereign immunity. The federal government did this when it passed the Federal Tort Claims Act, which waived federal immunity for numerous types of torts claims.
Diplomatic immunity is a status granted to a diplomat that exempts them from the laws of a foreign jurisdiction. It must be noted that immunity is a privilege of the state that a diplomatic agent represents. As such, a person cannot allege breach of immunity if the sending state does not contest a violation.