Genesis 42:18 NKJV
Then Joseph said to them the third day, “Do this and live, for I fear God:
When Joseph saw his brothers and recognized them, but acted as a stranger to them, it may have started out of bitterness or even in jest, but things took another turn in Joseph’s heart when on the third day he said to his brothers that he feared God.
Though he used the generic word “Elohim”, YHWH (Yahweh or Jehovah) must have had a “talk” with him. I know that name was revealed later to Moses, but I use it here to make a point.
Joseph would have at least realized that all this fooling around could make him fall into sin because of the fallen human need to exact vengeance.
Luke 6:29 NKJV To him who strikes you on the one cheek, offer the other also. And from him who takes away your cloak, do not withhold your tunic either.