Comment by kec
Fair use and the 4 criteria for determining if it applies to usage is literally written into the letter of the law, passed by congress in 1976: https://www.law.cornell.edu/uscode/text/17/107
Its squishy and specific application relies on interpretation guided by precedent, but that's true of just about everything in legal systems guided by common law.