Civil Code §2772 Indemnity is a contract by which one engages to save another from a legal consequence of the conduct of one of the parties, or of some other person.
Civil Code §2778. In the interpretation of a contract of indemnity, the following rules are to be applied, unless a contrary intention appears:
1. Upon an indemnity against liability, expressly, or in other equivalent terms, the person indemnified is entitled to recover upon becoming liable;
2. Upon an indemnity against claims, or demands, or damages, or costs, expressly, or in other equivalent terms, the person indemnified is not entitled to recover without payment thereof;
3. An indemnity against claims, or demands, or liability, expressly, or in other equivalent terms, embraces the costs of defense against such claims, demands, or liability incurred in good faith, and in the exercise of a reasonable discretion;
4. The person indemnifying is bound, on request of the person indemnified, to defend actions or proceedings brought against the latter in respect to the matters embraced by the indemnity, but the person indemnified has the right to conduct such defenses, if he chooses to do so;
5. If, after request, the person indemnifying neglects to defend the person indemnified, a recovery against the latter suffered by him in good faith, is conclusive in his favor against the former;
6. If the person indemnifying, whether he is a principal or a surety in the agreement, has not reasonable notice of the action or proceeding against the person indemnified, or is not allowed to control its defense, judgment against the latter is only presumptive evidence against the former;
7. A stipulation that a judgment against the person indemnified shall be conclusive upon the person indemnifying, is inapplicable if he had a good defense upon the merits, which by want of ordinary care he failed to establish in the action.
Civil Code §2779. Where one, at the request of another, engages to answer in damages, whether liquidated or unliquidated, for any violation of duty on the part of the latter, he is entitled to be reimbursed in the same manner as a surety, for whatever he may pay.