At the moment, we pass usernames and passwords in inline environment variables embedded in shell commands, like in https://github.com/vyos/vyos-1x/blob/current/src/op_mode/image_installer.py#L576
That approach has some security implications. Since credentials are a part of the command, they are visible in the process list, and can potentially leak into tech supports reports and the like when the stars are right those files are generated exactly at the moment when a download script is running. Not very likely, but not impossible.
Passing them in process environment variables is much safer in that regard.