This is one of those questions that really makes you think. If a program could rewrite its own code and start chasing a different objective, it might make decisions its creators never expected. That's why I think setting clear limits and keeping humans involved is so important. On another note, I recently read
here "How to Paraphrase to Avoid Plagiarism in Academic Writing," and actually found it really helpful. The tips are practical, easy to apply, and useful for anyone who wants to improve their writing without accidentally plagiarizing.