As long as you are sure that the string passed to
vm.ExtCode is just JSON and not arbitrary Jsonnet then it can have no side effects such as reading files etc. Just make sure you can parse the JSON string with a standard JSON parser before giving it to vm.ExtCode. Then the JSON is not really "run" because it's just a constant Jsonnet value.
Beyond that, it's like with other programming languages.
The size of the input could be an issue. What happens if someone gives you a gig of JSON? It would be prudent to put a bytes limit on it.
Then it's up to whatever the rest of your code does -- does it have safe behaviour for arbitrary input? Or will it go into an infinite loop if some input parameter is less than 0 or whatever. Make sure you validate the input if you can't handle arbitrary inputs.