The answer is obvious. If you want to protect your code, invent a new programming language that does weird things that make it difficult for an llm to learn.
Joking of course. Not sure copywriting code ever survives the AI era.