He put them all in prison for three days.
References for Genesis 42:17
On the third day, Joseph said to them, "Do this and you will live, for I'm a God-fearing man.
If you are honest men, let one of your brothers stay in prison, and the rest of you, go, take grain back to those in your households who are hungry.
But bring your youngest brother back to me so that your words will prove true and you won't die." So they prepared to do this.
The brothers said to each other, "We are clearly guilty for what we did to our brother when we saw his life in danger and when he begged us for mercy, but we didn't listen. That's why we're in this danger now."
Reuben responded to them, "Didn't I tell you, ‘Don't do anything wrong to the boy'? But you wouldn't listen. So now this is payback for his death."
They didn't know that Joseph was listening to them because they were using an interpreter.
He stepped away from them and wept. When he returned, he spoke with them again. Then he took Simeon from them and tied him up in front of them.
Then Joseph gave orders to fill their bags with grain, to put back each man's silver into his own sack, and to give them provisions for their trip, and it was done.
They loaded their grain onto their donkeys, and they set out.
When they stopped to spend the night, one of them opened his sack to feed his donkey, and he saw his silver at the top of his sack.
He said to his brothers, "My silver's been returned. It's right here in my sack." Their hearts stopped. Terrified, they said to each other, "What has God done to us?"
When they got back to their father Jacob in the land of Canaan, they described to him everything that had happened to them:
"The man, the country's governor, spoke to us with a harsh tone and accused us of being spies in the country.
We told him, ‘We're honest men, not spies.
We are twelve brothers, all our father's sons. One of us is gone, but the youngest is right now with our father in the land of Canaan.'
The man, the country's governor, told us, ‘This is how I will know you are honest men: Leave one of your brothers with me, take grain for those in your households who are hungry, and go.
But bring back your youngest brother to me. Then I will know that you are not spies but honest men. I will give your brother back to you, and you may travel throughout the country.'"
When they opened their sacks, each man found a pouch of his silver in his sack. When they and their father saw their pouches of silver, they were afraid.
Their father Jacob said to them, "You've taken my children from me. Joseph's gone. Simeon's gone. And you are taking Benjamin. All this can't really be happening to me!"
Reuben said to his father, "You may put both of my sons to death if I don't bring him back to you. Make him my responsibility, and I will make sure he returns to you."
But Jacob said to him, "My son won't go down with you because his brother's dead and he's been left all alone. If anything were to happen to him on the trip you are taking, you would send me—old as I am—to my grave in grief."