Studies related to knowledge hiding prevention are limited and need attention. Hence, the present study attempts to measure the direct impact of workplace friendship and altruistic leadership on preventing the knowledge hiding behavior; and also, in the presence of positive emotions. The study has also checked the mediating role of positive emotions in these relationships. The target population of the study is the employees working in the government sector (sample size of 496). The present study has employed quantitative research techniques for testing the hypotheses. Smart-PLS 3 software has been employed to run the partial least square structural equation modeling. Findings of the study have given major indications about the positive role of workplace friendship and altruistic leadership in preventing the hiding of knowledge among employees. It has also been revealed that positive emotions play a significant role in augmenting the relationship of workplace friendship and altruistic leadership with knowledge hiding behavior. This study adds a significant contribution to the body of knowledge by measuring the mediating role of positive emotions in decreasing the knowledge hiding behavior in the presence of workplace friendship and altruistic leadership.