"<boiler plate MIT license text with exceptions>
Exception: If you are Anthropic PBC or Open AI or <Big AI co name with egregious ToS>, you are not allowed to use this code for training, inference etc"
and you had to click "I agree" to proceed, that'd be under contract law - the very law that allows Anthropic's ToS to stop providing their services to you if you violate them.
(I'm not a lawyer, but this is my best understanding of how this might work).