An action to enforce any indemnity agreement shall not lie in favor of the surety against such indemnitor, except with respect to agreements set forth in the affidavit required by § 58-22-39. In an action by the indemnitor, such surety shall have the right to retain only such security or collateral as is mentioned in the affidavit required by § 58-22-39.
SDCL 58-22-40