“The Lord was with Joseph, and extended him kindness, and placed his favor in the eyes of the commander of the prison” (Genesis 39:21). “The commander of the prison placed in Joseph's charge all the prisoners who were in the prison, and everything that they did there, he would determine” (Genesis 39:22). “The Lord was with Joseph...the commander of the prison placed…”29Rav Huna understands that the commander of the prison was none other than Potiphar himself.

This is based on the fact that Joseph was in the prison of the chief executioner (Genesis 40:3), an appellation earlier applied to Potiphar (Genesis 39:1). Rav Huna asserts that Potiphar still had Joseph go and attend to a variety of tasks in his own home, where his wife would continue to harass Joseph (Maharzu). – Rav Huna said in the name of Rabbi Aḥa: His service was pleasant for his master, and he would go out and rinse his drinking glasses, set the tables, and make the beds.

She would say to him: ‘In this matter, I mistreated [ashaktikha] you. As you live, I will mistreat you regarding other matters.’30She continued to proposition him and to threaten him if he would not submit to her demands. He would say to her: ‘[God] “Performs justice for the oppressed [laashukim]”’ (Psalms 146:7). [She would say:] ‘I will reduce your sustenance.’ He would say to her: ‘[God] “Provides food for the hungry”’ (Psalms 146:7). [She would say:] ‘I will shackle you.’

He would say to her: ‘“The Lord frees the imprisoned”’ (Psalms 146:7). [She would say:] ‘I will cause you to be bent over.’ He would say to her: ‘“The Lord straightens the bent”’ (Psalms 146:8). [She would say:] ‘I will blind your eyes.’ He would say to her: ‘“The Lord opens the eyes of the blind”’ (Psalms 146:8). How far did she go?

Rav Huna said in the name of Rabbi Aḥa: She placed an iron bar beneath his neck until he would direct his glance toward her and look at her. Nevertheless, he would not look at her. That is what is written: “They tortured his legs with chains; his body was placed in iron” (Psalms 105:18). “The commander of the prison did not oversee anything that was in his charge, for the Lord was with him, and everything that he did, the Lord made successful for him” (Genesis 39:23).

“The commander of the prison did not…” – until now, [this has been stated] regarding times of trouble; from where is it derived that [God was with Joseph] even in times of prosperity? The verse states: “And everything that he did, the Lord made successful for him.”