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!]
Q&A on other exceptions
Mixing the peeled egg/onion/garlic with other foods:
If an onion, garlic or egg stayed overnight may it be eaten if cooked?
Does the prohibition apply if one needs to peel a large amount many days in advance?
Q&A on definition of egg/garlic/onion
One what species of garlic/onion does the prohibition apply?
Chives/green onions: The above prohibition does not apply to chives and green onions.
Does the above hazard garlic/onions apply to both cooked and raw onions/garlic?
Does the above hazard regarding eggs apply to both cooked and raw eggs?
Does the above prohibition apply to crushed onions/garlic/eggs?
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?
Q&A on “leaving peel”
How much of the peel must be left on the garlic/onion/egg?
 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. [Rahsbi 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
 Semak 171; Zivcheiy Tzedek 116/61; Ben Ish Chay Pinchas 2/14; Kaf Hachaim 116/92 and O.C. 505/1; Chazon Ish, brought in Hakashrus 18 footnote 53
 Hakashrus 18/12
 Ben Ish Chaiy ibid
 Badatz Eida Hachareidis and Landa provide Hashgacha to pre-broken eggs in cartons, used by bakeries, and instruct the factory to add sugar or salt to the eggs when they are broken and entered into their carton. [Teshuvos Vehanghagos 3/256 writes this is based on a directive of the Minbchas Yitzchak]
 Kaf Hachaim 116/93; See also Taamei Haminhagim Likkutim Tosefes Chaim that mixing it with spices help after the fact.
 Yad Meir 19
 See Hakashrus 18 footnote 57
 Igros Moshe Y.D. 3/20
 Kaf Hachaim 116/93
 Hakashrus 18 footnote 50
 See Kaf Hachaim 116/93; and previous Q&A regarding if the garlic/onion was mixed with other foods.
 See Hakashrus 18 footnote 50
 Beis Shlomo Y.D. 1/159
 See Darkei Teshuvah Y.D. 116/74; Shevet Halaevi 6/111; Hakashrus ibid
 Yaskil Avdi 7/44; Shevet Halevi ibid; Hakashrus ibid based on previous Q&A!
 Tosafus Shabbos 141a
 Beis Shlomo 1/159; Degel Efraim 28; Sheivet Halevi 6/111-5-7; Yabia Omer 2/7 based on Har Tzevi Y.D. 74; See also Kaf Hachaim 116/93
 The reason: As the food is no longer edible in its current state.
 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