Cross References → Genesis 40:4

The captain of the guard assigned them to Joseph, and he became their personal attendant. After they had been in custody for some time,

The captain of the guard

Genesis 37:36
Meanwhile, the Midianites sold Joseph in Egypt to Potiphar, an officer of Pharaoh and captain of the guard.
Genesis 39:1,21-23
Meanwhile, Joseph had been taken down to Egypt, where an Egyptian named Potiphar, an officer of Pharaoh and captain of the guard, bought him from the Ishmaelites who had taken him there. ... the LORD was with him and extended kindness to him, granting him favor in the eyes of the prison warden. And the warden put all the prisoners under Joseph’s care, so that he was responsible for all that was done in the prison. The warden did not concern himself with anything under Joseph’s care, because the LORD was with Joseph and gave him success in whatever he did.
Psalms 37:5
Commit your way to the LORD; trust in Him, and He will do it.