(concurring specially).
I agree with the main opinion that Yan-cey has not demonstrated that he is entitled to the writ of mandamus. The doctrine of sovereign immunity does more than offer a defense at trial. Qualified immunity “is an immunity from suit rather than a mere defense to liability; and like an absolute immunity, it is effectively lost if a case is erroneously permitted to go to trial.” Mitchell v. Forsyth, 472 U.S. 511, 526, 105 S.Ct. 2806, 86 L.Ed.2d 411 (1985). See also Siegert v. Gilley, 500 U.S. 226, 232, 111 S.Ct. 1789, 114 L.Ed.2d 277 (1991) (“One of the purposes of immunity, absolute and qualified, is to spare a defendant not only unwarranted liability but unwarranted demands customarily imposed upon those defending a long drawn out lawsuit.”). Therefore, we should be reluctant to send the question of sovereign immunity to the jury, because doing so defeats a fundamental function of the doctrine.
Additionally, sovereign immunity is not intended to be limited to protecting a public actor only when he or she is acting in complete compliance with every statute, rule, and regulation; instead, it is intended to protect the public actor when he or she has a lapse in judgment or imperfectly carries out responsibilities. See, e.g., Ex parte Kennedy, 992 So.2d 1276, 1280 (Ala.2008) (“ ‘State-agent immunity protects state employees, as agents of the State, in the exercise of their judgment in executing their work responsibilities.’ ” (quoting Ex parte Hayles, 852 So.2d 117, 122 (Ala.2002))).
I have previously noted that “to deny teachers State-agent immunity and to require them to defend themselves in civil actions brought by students or parents would discourage them in the performance of their public responsibilities.” Giambrone v. Douglas, 874 So.2d 1046, 1057 (Ala.2003) (See, J., specially concurring). In the case before us, however, Yancey did not display a mere lapse in judgment by allowing Messer to use his own truck to move the trash barrels to the dumpster. *308The record indicates that it was Yancey’s practice to allow the students in his weight-lifting class to use their personal cars and trucks to move the trash barrels to the dumpster — a practice that is a direct violation of a clear school policy stated in the student handbook. There is no suggestion that Yancey had requested or received a variance from compliance with that policy or that the handbook is not binding on Yancey. See Ex parte Cranman, 792 So.2d 392, 405 (Ala.2000) (“Notwithstanding anything to the contrary in the foregoing statement of the rule, a State agent shall not be immune from civil liability in his or her personal capacity ... when the State agent acts willfully, maliciously, fraudulently, in bad faith, beyond his or her authority, or under a mistaken interpretation of the law.”).
Thus, I agree that Yancey has failed to demonstrate that he has a clear legal right to a summary judgment based on his immunity defense. I also agree, therefore, that Yancey is not entitled to the writ of mandamus. Ex parte Nall, 879 So.2d 541, 543 (Ala.2003).