I haven’t tried but I believe you can do either. You can use their api and tooling and it will connect to agents in your infra.
In that deployment model, the Depot control plane passes changes to make in the customers environment via a small agent they run in their account. Here is some docs we put together for anyone that wants to go into a bit more of the details: https://depot.dev/docs/self-hosted/architecture