Of _course_ they are training on your shit.
Which is the same law that protects "publicly accessible shit".
In the same way that you can't legally just rip MP3s off the internet[1], or copy movies and distribute them.
[1] unless you're rich.
However for people trying to compromise your system access to your code can be a valuable asset .The worth of that could be well beyond just enterprise value of the organization , it could people’s lives or bring down critical infrastructure.
You don’t just have access to code you created and have complete control to. Organizations have vendors providing code(drivers , libraries…) with narrow licenses that prohibit sharing or leaking in anyway. So this type of leak can open you to a lot of liability.