Among the forbidden activities that were listed at the beginning of Massekhet Karetot as making one liable to receive karet was the consumption of blood. The fifth perek of this tractate is entitled Dam Sheḥita, and it is devoted to clarifying this prohibition.
The Mishna teaches that it is only for consuming the blood of birds or animals that come out at the time that the animal dies that would make someone liable for karet. The baraita teaches that although the passage in Sefer Vayikra (7:26) appears to forbid all types of blood, in fact, blood that is found in eggs, fish blood, kosher grasshopper blood and even human blood is not forbidden on a biblical level.
The Gemara differentiates between these different types of blood that are not forbidden by the Torah. There is no prohibition at all against consuming fish blood or grasshopper blood, although Rav rules that if the blood was collected in a cup it would be forbidden for reasons of mar’it ha-ayin – it has the appearance of forbidden blood. Thus, the Gemara explains, were one to leave fish scales in the blood so that it is clear that it is not animal blood, it would be permitted. Regarding human blood, once the blood has left the body, there is a rabbinic prohibition against consuming it. Therefore, someone whose gums are bleeding need not be concerned if he swallows some blood, as there is no prohibition whatsoever. If, however, someone is eating and realizes that he has bled on his food, he must remove the blood before completing his meal.
Rashi explains that a person can swallow blood in his mouth because no one sees him doing so. This is a difficult explanation since we have a general principle that when something is forbidden for reasons of mar’it ha-ayin, even if no one will see him it remains forbidden. Tosafot explain that this rule applies only when dealing with mar’it ha-ayin connected with a biblical prohibition, which is not the case we are dealing with regarding human blood.