In this scenario the malware will not be on the device but in an isolated dev environment on a remote machine. So it will have access to whatever was configured in that repo but hopefully the project is isolated enough to ensure containment and prevent cross-pollination.
That’s a big, labor-expensive if.
I don't think the cloud (someone else's computer) is the best solution. The sanitation problem can be mitigated by compartimentization but the cloud aspect also adds brittleness and new attack vectors.
Why not set up proper containers (or VMs) locally? And why not wait a little till local LLMs catch up?
Maybe just a personal itch, but having your dev environment elsewhere feels so gross to me..