Hiyal (sg. hīla) are "legal devices" or tools used to achieve a certain objective, lawful or not, through lawful means. Although it is generally agreed that hiyal are not merely "evasions of the law," their exact nature and place within Islamic jurisprudence remains an open question. To date, there have been only a few studies devoted to the subject and these have focused almost exclusively upon the Hanafīs, who developed hiyal into a special branch of the law, called makhārij, i.e. "exits". I shall examine here the doctrine of the Hanafīs together with that of the Mālikī/Medinese jurists, who were early witnesses for and against hiyal as conceived by the Hanafīs. On the basis of their understanding of law in terms of utility, the Hanafīs employed makhārij to provide remedies for those who sought them. As a particular transmission of Hanafī doctrine, the genre of makhārij sought to confirm the standard doctrine by discovering "exits" suggested therein. The Hanafī concern for the subject was shared by the Mālikīs, albeit from a different point of view. The Mālikīs discussed hiyal as jurisprudential materials that convey the validity of their doctrine as prescribing appropriate solutions. Thus, I conclude that both the Hanafīs and Mālikīs regarded hiyal as solutions drawn from the materials of jurisprudence in accordance with the spirit of law as interpreted by the jurists of their respective schools.