Sbt fork + security manager

I have an sbt question that is not getting any traction on Stackoverflow (https://stackoverflow.com/questions/64858727/run-a-forked-jvm-with-a-security-manager-in-sbt). I know it’s not a Scala question, but maybe someone in this forum well versed in sbt could help. I’m copying the question here:

I’m trying to setup a security manager on a JVM forked within sbt. I need to grant permissions to specific libraries. The problem is that sbt copies jar files in temp directories, and loads them from there. Because of this, I cannot specify a proper codebase in my policy file (since I don’t know where the jars will be). Is there a solution? Maybe a way to turn off this copying/caching from sbt?