The government enjoys sovereign immunities intort court cases. In addition, public officials also enjoy immunities from certain cases. In combination, sovereign immunity and immunities for public officers, provide for an avoidance of questions of liability for the government.
However, employees of the government may be found liable if they failed to act in accordance with their duties as prescribed by their job description. For example, a police officer that fails to help a woman under duress, may be subject to a tort case based on the job responsibilities of public officials. They would not be able to escape the case based on any of the types of immunities.
There are immunities granted to public officials under Federal and State Statutes. For example, Illinois enacted the "Local Governmental and Governmental Employees Tort Immunity Act." Those types of laws prevent an abuse of actions against the government or government officials.
Immunities for public officials can be waived in cases where employees failed to perform their expected duties. In addition, under very rare circumstances, the government itself may waive immunity depending on the laws in that jurisdiction.
Part of the reason that public officials enjoy immunities that directly result from their employment, is to prevent lawsuits which would continuously disrupt the government and services provided by the government. Tort lawsuits, which are frequently seen as frivolous, often do not apply to any governmental agency or its employees.
Members of Congress cannot be held liable for their actions as a member of Congress, including the manner in which they vote. Those votes may, or may not directly effect an individual but that individual cannot bring an action against that public official because of immunities enjoyed by those individuals.
Prosecutors, as public officials, enjoy certain and specific immunities. For example, prosecutors cannot be held liable for their actions during a Grand Jury hearing. Yet, they can be held liable for issues that arise as a result of their investigation of that case.
Public officials do receive certain immunities in regards to being liable. However, the immunity is not absolute and it can be waived directly or indirectly. Immunities may be waived if a public official acts in opposition of law, with the knowledge that they are doing so.
The law states that the public official must have been warned about the breach of law, or must have had previous knowledge of the law, in order for the government to waive any immunities. The immunities granted to public officials are not an explicit right in cases where their conduct was obviously contradictory to the law or to public safety.