what's to stop an agent creating an outbound call with the var to a malicious endpoint? (unless you whitelist what it has access to)
You just don't inject the real secret unless hostname/whatever rule matches the request, right? I don't know if that's how this works but it's my assumption.
The replacement is on a url/host basis.
At least for gondolin and microsandbox, you bind a specific secret placeholder to the target host. i.e. your GH token is only replaced/injected for calls to api.github.com, not other hosts. And you can set up both with deny-by-default