Much has been written about kanaut, and see for example the famous brother and sister Leibowitz, writing separately, but mine is a purely-halachik question: If someone replicates Pinchas's action, under similar conditions - surely the claim "I am a kanai" would not suffice to prevent being arrested by the Sanhedrin's police, nor enough to immediately dismiss charges during the mishpat, so I assume that there must be some process whereby a kanai would be challenged by a sanhedrin to somehow prove that he meets certain criteria. מואשם ברצח בועל ארמית (בפרהסיה, 10 עדים, עם התראה וכו') שטוען בהגנתו שפעל לפי הלכת קנאי, איך הסנהדרין חוקר/קובע אם הוא זכאי לסיווג הזה, ופטור - ז"א בכדי להיחשב 'קנאי' האם ישנם קריטריונים מקובלים בהלכה פסוקה (לא מוסר/השקפה, אלא הלכה למעשה בפוסקים)? האם היה מקרה כזה, מובא בנ"ך או בתלמוד? ............. Re the point made about hasro'oh: Can someone killing a boel aramis save themselves from the death penalty by simply mouthing the following self-fulfilling prophecy "I am a kanai (and therefore I am sure I am permitted to do this, so I am sure I am not liable for the death penalty) and therefore your hasro'o doesn't work and therefore indeed I will not be liable for the death penalty for doing what I am doing this second, killing this bo'el aramis". I imagine that such a person WOULD get the death penalty UNLESS they could somehow prove that they qualify as a kana'i, otherwise noone could ever be killed for killing a bo'el aramis. Indeed, any murderer could say to the witnesses giving hasro'o "I believe you are not a kosher witness, or you are actually not Jewish or etc, and so I don't believe your testimony will be upheld by Sanhedrin, so I believe I will not be laible for the death penalty" and presto, the hasro'oh doeesn't work, and the killer can't get the death penalty, as they predicted (unless one can prove that the murderer was lying, and did not think the witness was non-Jewish or etc). [It would not be reasonable to ask Sanhedrin to prove that the murderer indeed did NOT think they were a kanai, since it is impossible to prove that at that moment this was not his belief. Unless one thinks the person truly believes it, and tha tthis is a symptom of mental ilness, and then they can be exempted from the death penalty for that reason.] Also: someone could kill a Jewish husband having relations with his Jewish wife in public and not get the death penalty , by saying to the witnesses "this woman is an Aramis" and so as a kanai I can kill him" and the hasro'oh wouldn't work, etc, unless one can prove he didn't in fact believe she was an Aramis...Maybe the wife could claim she is actually an aramis, and then SHE can kill her husband claiming SHE is a kanai?... ] Since this first scenario above is a good way to murder and escape the death penalty, I believe the question IS realistic [now try and prove I don't believe that ! :) ], certainly far more so that some rather exotic scenarios discussed in the gemoro. In any case, my question still stands "Is there any halachic discussion of this". I assume the commenter believes there is not, but is this known for a fact?
The Rambam states that in order for someone to be found guilty in court of murder he must first (immediately before his action) be warned that his action will be met with the death penalty and must reply that he accepts the punishment but will commit the crime anyway (saying 'I know' would not be enough). In a case of kanaut he wouldn't explicitly accept the punishment.
While it is not explicit in the Rambam, I understand that the courts will simply not deal with a case of someone who killed in a case of "kanaim pogim bo", and there is no need to prove anything. I believe that even if we have no good reason to think the killerwas acting out of "kanaus" he would still not be punished, because the rule is that anyone who commited said crimes simply does not have any protection under the law if he was killed in the act.
Even if that is not true, The rule of "Kanaim pogim bo" is only in a public setting, with at least 10 other people watching. It would be clear from the context if he was acting out of religious zeal or personal malice. Either way, the burden of proof would be on the court to show that he acted out of personal malice. The burden is always on the court to prove that an act needs to be punished, it is not on the defendant to convince them of his innocence.