With the aim to develop optimized biochar with minimal contaminants, it is important significance to broaden the understanding of biochar. Here, we disclose for the first time, a highly toxic substance (metal cyanide, MCN, such as KCN or NaCN) in biochar. The cyanide ion (CN -) content in biochar can be up to 85870 mg/kg, which is determined by the inherent metal content and type in the biomass with K and Na increasing and Ca, Mg and Fe decreasing its formation. Density functional theory (DFT) analysis shows that unstable alkali oxygen-containing metal salts such as K2CO3 can induce an N rearrangement reaction to produce for example, KOCN. The strong reducing character of the carbon matrix further converts KOCN to KCN, thus resulting biochar with high risk.However, the stable Mg, Ca and Fe salts in biomass cannot induce an N rearrangement reaction due to their high binding energies. We therefore propose that high valent metal chloride salts such as FeCl3 and MgCl2 could be used to inhibit the production of cyanide via metal interactive reaction. These findings open a new point of view on the potential risk of biochar and provide a mitigation solution for biochar's sustainable application.