STRATAGenesis
SittingNarrativeGenesis 39

Potiphar’s wife

A slave in Egypt, Joseph rises by his integrity and is brought down by it. He refuses his master’s wife, she lies, and he goes to prison for doing the right thing, with the LORD still, somehow, with him.
39:2–21narrative
The cloak left behind
The history
The chapter is framed at both ends by a single refrain, the LORD was with him, said as plainly over the prison as over the master’s house. In between, Joseph rises to run Potiphar’s entire estate, refuses the master’s wife on the grounds not of getting caught but of sinning against God, and is destroyed by her lie when she is spurned. The cloak left in her hand becomes the false evidence, the second time a garment of Joseph’s is used to tell a lie about him.
Sarna · Alter · Westermann

2And the LORD was with Joseph, and he became a successful man, serving in the household of his Egyptian master. 6So Potiphar left all that he owned in Joseph’s care; he did not concern himself with anything except the food he ate. Now Joseph was well-built and handsome, 7and after some time his master’s wife cast her eyes upon Joseph and said, “Sleep with me.” 9No one in this house is greater than I am. He has withheld nothing from me except you, because you are his wife. So how could I do such a great evil and sin against God?” 12She grabbed Joseph by his cloak and said, “Sleep with me!” But leaving his cloak in her hand, he escaped and ran outside. 20So Joseph’s master took him and had him thrown into the prison where the king’s prisoners were confined. While Joseph was there in the prison, 21the LORD was with him and extended kindness to him, granting him favor in the eyes of the prison warden.

A common misreading
If Joseph had really been faithful, God would have kept him out of prison.
The text says the opposite in the very same breath: the LORD was with him, and he went to prison. The faithfulness and the suffering are both true at once. The story is built specifically to deny that doing the right thing buys you safety, and to claim something stranger and sturdier instead.
Meaning
Joseph does exactly the right thing and is punished for it. He refuses, not out of fear of discovery but because it would be a sin against God, and his integrity costs him the cloak off his back and lands him in a cell on a lie. The story flatly refuses the bargain we keep wanting, that doing right will keep you safe. It does not. And yet the sentence that brackets the whole disaster never wavers: the LORD was with him, in the house where he rose and in the prison where he fell. God’s presence, the text insists, is not the same as God’s protection, and it will not pretend otherwise.
Theological+
The LORD was with him is said as loudly over the prison as over the palace, and that is the book quietly redefining what it means to be blessed: not exempt from injustice, but accompanied through it. Joseph’s faithfulness is real and it is not rewarded with safety. It is met with company in the dark, which turns out to be a different and harder kind of grace.
Archetypal+
A garment of Joseph’s is turned into a lie about him for the second time, first the bloodied coat and now the seized cloak, the same motif the story keeps folding back on itself. The descent is not finished; the gifted one is stripped again and sent lower still, because in this kind of story you go down twice before you come up. (The repeated garment, the second descent.)One way to hear it, not the final word.
The turnnames you
You know the bitter version of doing the right thing, the kind that costs you and is not rewarded, and the question of whether God is really with you when it does.
Being accompanied is not the same as being spared. It may be the better promise.
Where has doing the right thing cost you, and what would change if presence, not protection, were what God was offering in it?
He does the right thing and it costs him his freedom. And the one line that frames the whole disaster does not change: the LORD was with him, in the fine house and in the prison alike.