Security given for faithful performance of an act or agreement pursuant to Section 19835 shall be released immediately upon the performance of the act or final completion and acceptance of the required work and performance of the act, or the legislative body may provide for the partial release of the security upon the partial performance of the act or the acceptance of the work as it progresses, under rules established by the legislative body.