What did the prison warden initially think was the reason for Yosef’s success?
(39,23) “The prison warden did not see anything in his hand because Hashem was with him, and everything that he did Hashem made successful.”
I saw in a certain sefer that our posuk can be explained according to the teaching of Abayei in Sanhedrin 67b, that the difference between one who does sorcery through the agency of demons and one who does sorcery by himself is that the former is particular about which utensil he uses but the latter is not particular about which utensil he uses. Abayei did not say that one holds a utensil and one does not hold a utensil, and so the implication is that both of them need to hold a utensil in their hand, but the one that employs demons to work his sorcery needs to hold a particular type of utensil, and the other will use whatever utensil comes to hand.
According to this teaching the posuk means that initially the prison warden thought that Yosef’s success was due to sorcery, but when he “did not see anything in his hand” - when he saw that he never held any utensil in his hand - he understood that his success was not due to sorcery but because “Hashem was with him”, and that it was He who made all Yosef’s endeavors successful.