The Ben Ish Hai (Rabbi Yosef Haim of Baghdad, 1833-1909), in Parashat Hukat (Shana Sheniya, 9), discusses the concept of "Bishul Akum," the prohibition enacted by the Sages forbidding the consumption of certain foods prepared by a gentile. He emphasizes that this prohibition does not relate to the Kashrut status of the food. Even if the food is inherently kosher and the gentile prepared the food using a Jew's utensils in a Jew's kitchen, one may nevertheless not partake of this food because it was prepared by a non-Jew.
The Ben Ish Hai explains that this Rabbinic enactment was motivated by two different concerns. Firstly, the Sages enacted this law as a safeguard against intermarriage. Once Jews are forbidden from eating food cooked by a gentile, they are less likely to engage in close social interaction with gentiles, and it is thus less likely that Jews and gentiles will marry one another. Secondly, the Rabbis were concerned that if Jews partake of food prepared by gentiles, they might eventually come to partake of non-kosher food, as well. By forbidding even kosher food prepared by non-Jews, the Sages sought to lessen the possibility of Jews eating non-kosher food.
This prohibition, as the Ben Ish Hai discusses, is subject to two conditions. Firstly, it applies only to foods that are not generally eaten raw. A food that is commonly eaten uncooked may be eaten even if a gentile cooked it. Secondly, this prohibition is limited to foods that are "Ole Al Shulhan Melachim," meaning, worthy of "being brought upon the table of kings." This refers to foods that wealthy and prominent people would normally be served. Foods that are not deemed worthy of being served to such people are not under the prohibition of "Bishul Akum."
The Ben Ish Hai lists a number of common foods that are subject to this prohibition, including rice, truffles and eggs. Even though one could drink an egg yolk without cooking it, nevertheless, since people normally cook eggs, it is included in this prohibition. Thus, one may not allow his non-Jewish housekeeper, for example, to prepare scrambled eggs for him, even if she uses his utensils and prepares the eggs in his kitchen. Similarly, at catered affairs, gentile employees should not prepare omelets and the like for the Jewish guests.
The Ben Ish Hai then proceeds to record a debate concerning the status of coffee with respect to the prohibition of "Bishul Akum." He records that the Arizal (Rabbi Yishak Luria, 1534-1572) forbade drinking coffee prepared by gentiles, whereas others maintained that this is permissible, and the prevalent practice in Baghdad was to allow drinking coffee prepared by gentiles. The Ben Ish Hai concludes that a "Ba'al Nefesh" (somebody who wishes to be especially meticulous in Halachic observance) should be stringent in this regard, but those who are lenient certainly have authorities on whom to rely. In particular, he adds, people who must meet with prominent officials should, in fact, drink the coffee served to them in the interest of good manners and courtesy.
Certainly, however, one should preferably not allow his non-Jewish housekeeper to brew his coffee, and should instead brew it himself.
The Ben Ish Hai mentions that a Jew may eat food prepared by a gentile if a Jew took part in the cooking process. Even if the Jew cooked the food only slightly, and the gentile then completed the process, the food is permissible for consumption. It should be noted, however, that Sephardic custom requires that the Jew participate in the actual process of cooking. It does not suffice for a Jew to simply kindle the flame or turn on the oven; only if the Jew took part in the actual cooking does the food remain permissible despite the gentile's involvement.
Ashkenazim generally follow the view that one may partake of food prepared by a gentile if a Jew kindled the flame used for cooking. According to this view, kindling the flame is considered involvement in the cooking process, and once a Jew is involved in this process, the food is permissible. Sepharadim, however, do not follow this view, and require that the Jew be involved in the actual cooking.
This poses a problem for a Sepharadi who wishes to eat in a restaurant under Ashkenazic Kashrut supervision. Generally, these restaurants rely on a Jew's kindling of the flame, and allow gentiles to perform all the cooking. A Sepharadi who eats in such a restaurant should request that a Jew be involved in the actual cooking of the food he orders. Hacham Ovadia Yosef, in his work Yehaveh Da'at, rules that if this is not possible, then the Sepharadi may nevertheless partake of food in the restaurant.
Summary: One may not partake of food prepared a gentile, even if the food is perfectly kosher. This applies to all foods that are not generally eaten raw and that are deemed respectable enough to be served to wealthy aristocrats. This includes many common foods, including rice and eggs. The authorities are in disagreement as to whether coffee is included in this category, and it is therefore preferable to be stringent. This prohibition does not apply if a Jew participated in some stage of the cooking process. A Sepharadi who eats in a restaurant under Ashkenazic Kashrut supervision should preferably ask that his food be cooked by a Jew, as Sepharadim, unlike Ashkenazim, do not eat food prepared by a gentile over a fire kindled by a Jew. Nevertheless, if this is not possible, the Sepharadi may eat in that restaurant.