AbstractWith the popularity of smart meters, the frequent information exchange between smart grids and consumers leads to easy leakage of consumers' electricity consumption data. These leaked electricity consumption data are obtained by some malicious attackers and used to infer consumers' behavioural patterns by non‐intrusive load monitoring (NILM), which seriously threatens consumers' privacy. Therefore, the multi‐agent Hidden Markov energy management model is proposed in this paper to safeguard the privacy of consumers. First, a weighted Bayesian risk model is proposed, which combines privacy leakage risks and energy storage system (ESS) losses in a microgrid with multiple agents. Next, a three‐loop model for lithium batteries is constructed to quantify the capacity degradation and cost issues of the ESS. Finally, the multi‐objective optimization problem is resolved by integrating the Bayesian risk model with a hidden Markov model to simulate attackers. The proposed multi‐agent Markov decision process method is validated on Electricity Consumption and Occupancy (ECO) dataset, and control strategies are evaluated based on different weights in the Bayesian risk model. The results demonstrate that by incorporating the multi‐agent approach and energy storage system capacity degradation into the privacy protection strategy, the lifespan of the energy storage system can be significantly increased.