What is the doctrine of sovereign immunity?

What is the doctrine of sovereign immunity? To what extent are today’s correctional officers shielded from civil lawsuits brought by inmates?