Script policy being ignored

Hey all,

I’m currently having some problems with script policies over the API. The problems are pretty much the same as in this post. When using the terminal to run a script the script inherits all permissions of the issuer. This completely removes the purpose of the policies on scripts, and due to the API needing to execute scripts by terminal commands it’s impossible to restrict script execution permissions. Does anyone know of a workaround or am I missing something? POCs to test this problem are in the linked post.