First, if they are detained, they will be strip searched long before any torture takes place. You either take it early or not at all - odds are everything will be taken away.
Second, the last thing you want in such situation is ambiguity - people don't just commit suicide willy-nilly. Instructions must be very clear.
Thirdly, either the agent has secret information that cannot be divulged, or they don't. This is known upfront before the mission. Any agent at high risk of capture is kept away from sensitive information, to minimise possible damage. Every spy and reconnaissance organisation work like that. As soon as agent is captured, damage control is put in place.
Lastly, orders to commit suicide are not legally possible.
You do realize that we're talking about the CIA here, right?
We are talking about US citizens for whom this is a job, they are not like foreign prisoners. CIA -agents are 'one of their own'.
This is like Taliban-level stuff
This assumes the others would know that it happened. Who would tell them? Certainly not the guy who complied with the request for suicide.
Surely even the CIA has limits on the atrocities they are willing to commit?
Aleksandr Ogorodnik was able to get the KGB to give him his pen, which had a suicide pill in it, to write his confession.
https://en.wikipedia.org/wiki/Aleksandr_Dmitrievich_Ogorodni...
Obviously you don’t order it. You play up the cruelty of the enemy tortourers. This probably is not hard, every secret service probably have enough nightmare fuel on hand to do if they want to. And then you provide the means and let your agent know they can use it uppon capture.
If the pill causes pain, that's an unwanted side-effect. It's unlikely to be as painful as the actions of your torturer, whose goal is to cause as much pain as possible, and who may also want to stretch it out for weeks. And there's a good chance your torturer will kill you anyway.
Sometimes torture is used for punishment or repression, not to obtain information. Arguably that's always the purpose; "information" obtained through torture isn't very reliable.
When it comes down to a quick death by a suicide agent vs being tortured and then likely an unmarked grave it can be a reasonable option. Agents which aren't so likely to be put through the wringer and might be exchanged are another matter--Gary Powers had little reason to use his suicide option. He didn't have great secrets to be tortured for.