Upon those contracts of indemnity which are taken in legal proceedings as the security for performance of an obligation imposed or declared by the tribunals, and known as undertakings or recognizances, the sureties are called bail. SOURCE: CC § 2780.