One major hindrance that alloy design for additive manufacturing (AM) faces nowadays is hot tearing. Contrary to the previous works which either try to reduce solidification range or introduce grain refinement, the current work presents a new approach of employing segregation engineering to alter the residual stress states at the interdendritic and grain boundary regions and consequently prevent hot tearing. Here, in situ Al alloying is introduced into an existing hot-cracking susceptible highentropy alloy CoCrFeNi. It is found that within a certain range of compositions, such as Al0.5CoCrFeNi, the hot crack density was drastically decreased. During the solidification of this specific alloy composition, Al is firstly ejected from the primary dendritic face-centred cubic (FCC) phase and segregates into the interdendritic regions. Spinodal decomposition then occurs in these Al-enriched regions to form the ordered B2 NiAl and disordered body-centred cubic (BCC) Cr phases. Due to the higher molar volume and lower homologous temperatures of these B2/BCC phases, the inherent residual strain is accommodated and transformed from a maximum 0.006 tensile strain in CoCrFeNi to a compressive strain of ~0.001 in Al0.5CoCrFeNi. It is believed that this grain boundary segregation engineering method could provide a new pathway to systematically counteract the hot tearing problem in additive manufacturing of metals and alloys, using available thermodynamic and kinetic database information.