You can surely reduce the attack surface with multiple ways, but by doing so your AI will become more and more restricted. In the end it will be nothing more than a simple if/else answering machine
Here is a useful resource for you to try: https://gandalf.lakera.ai/
When you reach lv8 aka GANDALF THE WHITE v2 you will know what I mean
You can use Keepass or most of the password manager software (I think) to save and share wifi username and password. But I don’t think it is possible to auto connect to the saved wifi though.