What the rules say
In Germany, student data is governed by each federal state's school laws and data protection regulations, alongside the GDPR. Many states and school authorities also issue guidance on AI tools. The common denominator: students' personal data does not belong in tools that have not been approved for it.
Anonymized texts are a different matter, provided no conclusions about the child remain possible. Besides names, watch for special features such as support needs, background or family situation in small classes.