Vayeira
The pesukim mention that Avraham sent away Hagar and Yishmael. Yishmael was sick, quickly finished up the water and was in need for more. They davened and a malach called out and said, “Don’t worry because Hashem listened to the tefillah of the lad באשר הוא שם, as he is now” and Hashem opened her eyes and she saw a well of water.
Rashi explains באשר הוא שם, as he is now, that he is judged according to the actions which he does now, presently, and not what he will do in the future. The malachim wanted to prosecute and said, “Ribono shel olam, for one whose descendants will kill Your children with thirst will you bring up a well?!” This is referring to when Nevuchadnetzar exiled Klal Yisroel and they were brought next to the Arabs. Yisroel said to their captors, “I beg of you to bring us next to the children of our uncle, Yishmael, and they will have pity on us.” Bnei Yishmael came out towards Klal Yisroel with salty meat and fish, and flasks of air, instead of water. Klal Yisroel thought the flasks were full of water and when they brought them to their mouths the air went inside their bodies and they died.
Hashem answered the malachim, “what is Yishmael now, a tzaddik or a rasha?” They replied “a tzaddik.” Hashem said to them, “I judge באשר הוא שם, according to his actions now.”
Rashi makes mention of “who will kill with thirst” and not just “will kill.” Meaning, Yishmael’s descendants will kill with thirst, will You bring up a well to quench his thirst?!
My father shlita added a similar idea from a Gemara in Bava Kamma. It brings a story about Nechunia who dug pits for the Yidden who went up to the Beis Hamikdash for the shalosh regalim. One day his daughter fell into a big pit. They notified Rabi Chanina ben Dosa who responded after an hour passed “all is well”, after the second hour “all is well,” after the third hour “she came up.” He explained “I know this because something which a tzaddik put in extra effort for it’s not possible that his descendants will be harmed through it.”
We see that Hashem saves according to the type of mesiras nefesh one has, and Hashem punishes according to the type of aveirah one does. So too by Yishmael, if not for באשר הוא שם, how he is now, Hashem would not have provided water to quench his thirst, for his family would sin through thirst.
May Hashem help us be complete in all our ways thereby having a complete shemirah!