It writes and fixes its own code, in a sealed room.
The agent has never seen your schema. It writes Python, runs it in a CreateOS micro-VM and reads what comes back. When a query fails, it reads the error and rewrites the script. Nobody is typing.
The VM can reach api.stripe.com and your database host. Everything else is dropped by a rule on the host, outside the VM, so code inside cannot change it.
api.stripe.comallowedyour database hostallowed- anything elsedropped