He was asked—may Allah have mercy on him:
Does someone who draws up market guarantees and other documents that are impermissible under the Sharia incur sin? He records what those present consent to and bears witness to it. If this is impermissible, scribes are inevitably involved in such matters; do they incur sin thereby or not?
He replied:
A market guarantee—whereby a guarantor guarantees the debts a merchant may incur and the tangible property he receives for which he is liable—is valid. This constitutes guaranteeing obligations that have not yet arisen and guaranteeing an unspecified liability. This is permissible according to the majority of scholars, including Mālik, Abū Hanīfa and Ahmad ibn Hanbal.
The Book provides evidence for this, as in His words:
“Whoever brings it shall have a camel-load, and I guarantee it.”
Al-Shāfiʿī considers it invalid. Nevertheless, a scribe may draw it up and a witness may attest to it, even if he does not consider it permissible, because this is a matter open to scholarly judgment, and the ruler adjudicates according to whichever of the two opinions he considers correct.