The agent has no access to the secret. It has a placeholder that is replaced at a higher level. When it makes the network request the secret is substituted but that is outside of the caller's worldview.
edit: You may want to look into tokenizing proxies as the general application of this concept.