The seeds contain nitriles, which are common in the seeds of the rose family. In the stomach, enzymes or stomach acid or both cause some of the nitriles to be hydrolysed and produce hydrogen cyanide, which is a volatile gas. The seeds are only toxic if eaten in large quantities.
