The paper studies the impacts of an environmental bond, which fully covers waste cleanup costs, on a mining firm's optimal actions when bankruptcy may shift cleanup costs to the government. A firm's stochastic optimal control problem is described by an HJB equation with the resource price modelled as an Ito process. A theoretical result is derived, showing that when a firm does not have the option to declare bankruptcy, the bond has no impact on the optimal controls. In contrast, if a firm does have a bankruptcy option and if no environmental bond is required, the firm produces too much waste relative to a benchmark case, resulting in an efficiency loss and a cleanup liability imposed on government. In the presence of a bankruptcy option, a bond ensures that the firm acts optimally and no efficiency loss is imposed on society. A numerical solution of the HJB equation is implemented for a hypothetical copper mine and results are analyzed for two different models of bankruptcy risk.