Exactly. They would have to rewrite all the code in order to make it proprietary. AGPL license ensures that not even an instance owner can (legally) change the code of their own instance without releasing the modified source code.
We need to make sure that any apps that are created for Lemmy, also have a Copyleft license. At the very least they should be Free Software (which doesn't seem to be guaranteed sadly, since most people don't know what that means).