Peeled eggs, onions and garlic left overnight:
If the food was in a bag or container: The above prohibition applies even if the peeled garlic/onion/egg are wrapped in a cloth and closed shut.
Leaving some of the peel or root and mixing with other foods: If one left the root on the peeled garlic/onion, which is defined as the hair at the head of the garlic and onion, then it is permitted to be eaten. Likewise, if one left some of the peel [or shell] on the garlic/onion [or egg], it may be eaten. [In addition, mixing the garlic/onion/eggs with other foods also evades the issue, as explained in Q&A!]
One may not eat an onion, garlic or egg that was left overnight completely unpeeled, and without its root, even if it was in a closed compartment.
Q&A on “Overnight”
Must the garlic/egg/onion stay peeled over the entire night for it to be forbidden? What if it remained peeled for only part of the night?
Some Poskim rule that the peeled onion/garlic/egg is only forbidden if it passed the entire night, from Tzeis until Alos, in this state. Other Poskim suggest that it is forbidden even if it only passed through part of the night such as if it was peeled at the end of the night.
Q&A on “leaving peel”
How much of the peel must be left on the garlic/onion/egg?
Any amount suffices.
If the garlic/onion/egg was completely peeled/shelled does it help to place some of its peel/shell on it?
Part 2: Other exceptions-Mixing the peeled egg/garlic/onion with other foods.
 Admur Hilchos Shemiras Haguf Vihanefesh Halacha 7; Rashbi Nidah 17a and Rashi there; Derech Eretz Raba 11; Kol Bo 118; Semak 171; Tosafus Shabbos 141a; Peri Chadash 116:9; Zivcheiy Tzedek 116:61; Ben Ish Chay Pinchas 2:14; Kaf Hachaim 116:92; Chofetz Chaim in Likkutei Halachos Niddah ibid; Divrei Yatziv 2:16; See Hakashrus 18:11-14
Other opinions: The majority of Poskim omit the above ruling from their Halachic works, hence implying that it is no longer relevant. [This ruling is omitted from the Michaber:Rama:Tur:Rambam; See Peri Hasadeh 3:61; Kav Hazahav 12; Igros Moshe Y.D. 3:20; Shevet Halevi 6:111] Some Poskim explicitly rule that in truth all the dangers of Ruach Raah written in the Talmud are no longer relevant today and it is not necessary to avoid eating such foods. [Rashal in Perek Kol Habasar 12, brought in Zivcheiy Tzedek 116:61 and Kaf Hachaim 116:92-93 as possible explanation for why people are not particular in this anymore today; Yabia Omer 2:7 that so also rules Hagahos Mordechai that it no longer applies; Shevet Halevi ibid that Min Hadin is permitted as rules Rashal] Some Poskim rule one may be lenient for the sake of a Seudas Mitzvah, such as Seudas Shabbos and the like. [Yaskil Avdi 8:4]
 The reason: As an evil spirit resides on them. [Admur ibid; Rashbi ibid] This evil spirit can cause one danger. [Rashbi ibid]
 Rashbi ibid “He is liable for his life and his blood is on his own head”
 Admur ibid; Nidda ibid; See Rivivaos Efraim 3:495 and 4:51
 Admur ibid; Nidda ibid; See Hagahos Yaavetz, Aruch Laner and Likkutei Halachos of Chofetz Chaim on Niddah ibid
 Hakashrus p 428
 Divrei Yatziv 2:16
 Shevet Hakehasi 2, brought in Hakashrus ibid
 Admur ibid “Some of its peel”; Hakashrus 18:11 footnote 52
 See Hakashrus 18 footnote 52
 Shemiras Haguf Vihanefesh p. 21 in name of Shevet Hamussar
 Olelos Moshe 28 in name of Maharsham