Constructing robust electrolyte interphase through inorganic electrolyte additives is an effective strategy to improve the electrochemical performance of lithium metal batteries (LMBs). However, the limited solubility of such additives in electrolyte hinders their further application. Herein, we apply metal–organic frameworks (MOFs) as nanocapsules to sustainably release lithium nitrate (LiNO3) and a novel salt of potassium tetraborate (K2B4O5(OH)4). LiNO3 is inclined to undergo reduction on lithium anode to form a nitride-rich solid electrolyte interphase (SEI) layer; while K2B4O5(OH)4 preferentially decomposes on high-voltage cathodes to create a boron-rich cathode electrolyte interphase (CEI) layer. Although both salts exhibit poor solubility in commercial carbonate electrolyte, they can be continuously consumed on the electrode surface and concurrently replenished from the nanocapsules during long-term cycling process. As a result, a compact lithium deposition is achieved and the dissolution of transition metals is restrained. Upon the sacrifice of LiNO3 and K2B4O5(OH)4, the lifespan of LMBs is remarkbly improved. The Li||LiNi0.5Co0.2Mn0.3 (NCM523) cells at 4.3 V and Li||LiNi0.6Co0.2Mn0.2 (NCM622) cells at 4.4 V can respectively deliver high capacity retentions of 87 % and 80.1 % for 200 cycles.