T cell engineering for immunotherapy has already saved many lives, but it cannot be applied to most patients in need, because it relies on cumbersome and expensive manipulations that can be performed in specialized centers only. In addition, B cell engineering has not shown therapeutic efficacy to date. Here, we develop a novel immunotherapy approach, specifically targeting immune genes into the genome of developing immune cells. Only such developing cells can incorporate the desired receptor or antibody gene. Therefore, only the most young and potent cells are engineered and later selectively expand when fighting their target, for example: the cancer cells. In addition, our engineered cells retain immune memory and thus reduce the risk of relapse. Our approach may revolutionize immunotherapy as it allows safe, efficient and scalable engineering of B cells and T cells, both outside and inside the body.