Nothing. You protect yourself with hiding your code away from Github. Anyway, when software will be produced WITH LLMs, that will inevitably repeat your code, then you will sue.
Opensource is MADE to be copied. It's meant to be. You WANT it. You just want it to benefit EVERYONE and not corporations who make money out of it, and there are defenses to that.
Opensource, free software, is a philosophy, not a business opportunity per se. Business is just tangential to it.