Add a header value using a SPOE agent variable

Hi community, I’ve been experimenting with SPOE agents and I created a very simple example. I can see how to use the result of a variable generated by an SPOE agent for example to filter traffic, but my needs are a bit different and I wasn’t able to find any example: I want to use the value returned by an agent to set a header key in the incoming HTTP request, but only if this attribute does not exist already. The agent also needs to obtain the current value of this attribute if it’s present. Is it possible? How?