the captain
Genesis 37:36
And the Midianites sold him into Egypt unto Potiphar, an officer of Pharaoh's, and captain of the guard.
Genesis 39:1
And Joseph was brought down to Egypt; and Potiphar, an officer of Pharaoh, captain of the guard, an Egyptian, bought him of the hands of the Ishmeelites, which had brought him down thither.
Genesis 39:21-23
21
But the LORD was with Joseph, and shewed him mercy, and gave him favour in the sight of the keeper of the prison.
22
And the keeper of the prison committed to Joseph's hand all the prisoners that were in the prison; and whatsoever they did there, he was the doer of it.
23
The keeper of the prison looked not to any thing that was under his hand; because the LORD was with him, and that which he did, the LORD made it to prosper.
Psalm 37:5
Commit thy way unto the LORD; trust also in him; and he shall bring it to pass.