It does not need access to database itself. Right now, you can simply explain the schema of your database and ask questions. It will simply generate queries.
But yes, the ideal setup would be to have a system that can connect to data sources and figure out the schema, etc. And for that, it needs to have on-prem. I am currently working on this.