When we think of someone who has to make decisions on points of law, adjudicating between competing ends, seeking the truth and handing down rulings, two images come to mind: the judge in the secular courts, whose decisions are based on the state's laws, and the halachic decisor - the posek or dayan - who rules according to Torah law. While many comparisons can be drawn between the two, there are nevertheless salient differences between them. While both functionaries determine law, only halachic decisors frame their task in religious terms. In this context, a prayer to the Almighty before entering this world of halachic inquiry and decision-making is most appropriate. As we embark upon a religious quest, we beseech God for assistance. This is the thrust of the supplication of Rabbi Nehunya ben Hakana (M. Berachot 4:2). The Mishna tells us that he would recite a special prayer upon entering and exiting the beit midrash (study hall). Upon entering he would beseech God that he should not be the agent of any mishap. The talmudic sages quote a longer version of this prayer (B. Berachot 28b): "May it be Your will, God my Lord, that a mishap not come about through me, and I will not stumble in a matter of law, and my peers will rejoice over me. And I will not say regarding something which is impure that it is pure and regarding something which is pure that it is impure. And may my colleagues not stumble in a matter of law and I will rejoice over them." When the role of the halachic decisor in debating law or deciding law is seen as a religious pursuit, it is unsurprising that before embarking on this venture we turn to God to ask for guidance. Evidence of such heavenly assistance in the judicial process is recorded in a number of sources. Our sages vividly describe the process of intercalation, whereby five sages gather to consider and perhaps proclaim a leap year (Vayikra Rabba 29:4). For this meeting, God leaves the heavenly court and joins the deliberations. While God does not seem to take an active role in the discussion, the Holy Presence rests on the convocation. At that time the ministering angels vociferously protest: How could the Almighty - a God dreaded in the great council of holy ones, and revered by all who are near Him (Psalms 89:8) - descend to lowly mortals? The response offered is that should the assembly err, the Almighty illuminates the correct halachic path. Later authorities suggest that people who study Torah for wholesome purposes are granted divine protection against wrong halachic decisions (Rabbi Yehoshua Boaz, 15th-16th centuries, Italy). Indeed, our tradition records a number of stories in which halachic decisors were guarded from wrong decisions. The well-known hassidic master Rabbi Yitzhak Meir Alter of Gur (19th century, Poland) related that an aguna (a woman who cannot obtain a bill of divorce because the whereabouts of her husband are unknown) once came to Rabbi Haim Ben-Atar (18th century, Morocco-Jerusalem), a halachic authority and respected mystic. The woman requested a license to remarry on the grounds that her husband had died. While all the evidence seemed to support her claim, Ben-Atar felt unable to pronounce judgment. While he was unable to explain what was preventing him from ruling, the "deceased" husband presented himself and was reunited with his wife. Thus a wrong decision that would have carried serious consequences was avoided. A sadder tale was related on the other side of the Diaspora by Rabbi Yosef Haim (19th-20th centuries, Baghdad): Two great rabbis - Rabbi Yosef Karo and Rabbi Moshe Alshekh (16th century, Safed) - were divided on an aguna issue that came before them. Alshekh felt that the woman should be permitted to remarry for there was sufficient evidence that her husband had died. Karo demurred and a decision could not be reached. That night, Karo was visited in a dream by a heavenly messenger who concurred with his position: "You are right, for the witnesses mistakenly thought that the deceased they saw was the lady's husband!" Karo, however, was powerless to sway his younger colleague, who sat down to write a decision granting the woman permission to remarry. With the judgment in hand, she remarried. Some time later, word reached Safed that indeed the husband had died, but not as the witnesses had testified; on the very day that Alshekh wrote his verdict, the husband passed away. In tragic circumstances, the judicial process was afforded divine protection. Understandably, Karo rules in his code of Jewish law that Rabbi Nehunya ben Hakana's private prayer should be adopted as the normative ruling (Shulhan Aruch OH 110:8). A later halachic authority, Rabbi David Halevi Segal, more commonly known by his acronym Taz (17th century, Poland), suggested a different text for the prayer: "May it be Your will, God my Lord and the Lord of my ancestors, that You should illuminate my eyes with the light of Your Torah and save me from any stumbling block or error, whether it be in matters of ritual law or whether it be in matters of monetary law; whether it be in practical rulings or whether it be in theoretical study. 'Open my eyes that I may see wondrous things from Your Torah' [Psalms 119:18]. And that in which I have already erred, correct me with the truth. And never prevent truthful words from my mouth. 'For God gives wisdom, out of His mouth comes knowledge and understanding' [Proverbs 2:6]." While the Taz's text clearly echoes the sentiments of Rabbi Nehunya ben Hakana's prayer, it contains a significant addition. The sage's prayer adopted by Karo focuses only on the future; the Taz adds that mistakes of the past should also be revisited and rectified. Deciding Halacha is not merely choosing between options, it is a religious quest for which we beg divine assistance. The writer is on the faculty of Pardes Institute of Jewish Studies and is a rabbi in Tzur Hadassah.