In all cases of bonds, for the prosecution of original suits, or where security is taken or recorded in any court, sufficient security shall be taken by the clerk to pay all costs that may be at any time adjudged against the principal, in the event they are not paid by the principal. Notwithstanding any other law to the contrary, where an attorney undertakes to serve as surety after July 1, 1999, such surety shall only be obligated for amounts required by law or included in the clerk's bill of costs, and shall not be responsible for discretionary costs. In such instances, the clerk may require an additional surety other than the attorney as may be necessary to secure payment for discretionary costs.