How to define a short lived and sensitive environment variable WHILE the job is already running to benefit from log sanitation?

I have trouble to understand how I can influence the log sanitation in Travis WHILE the job is already running. I’m aware of the environment variable feature, but I would need to define them on-the-fly.

My use case:
I have my .travis.yml file, which calls source , and that script contains among others this line export TOKEN=$(curl <artifactory-create-secret-token>) . The env var TOKEN is sensitive and only valid for a very short time and must be created on the fly every time, so I can’t put it into the Travis settings as sensitive env var. I’d like to let Travis know that this needs to be treated as sensitive, so that echo $TOKEN gets sanitized in the Travis logs with *** or [secure] .

How can I do that?