I tried this path. The issue is that agents are very creating in coming up with new variations. "uv run pytest", "python3 -m pytest", "bash -c pytest"

It's a never ending game of whitelisting.

this seem solvable if the whitelisting just allows regex