Prior to any local agency receiving payment or reimbursement pursuant to Section 12585.5 or 12585.7, for projects authorized on or after January 1, 2001, the agency shall enter into an agreement with the department or Reclamation Board pursuant to which the agency agrees to indemnify and hold and save the state, and its officers, agents, and employees, harmless from any and all liability for damages, as provided in Sections 12642 and 12828.