Like any other code, your sandbox implementation should have tests. Sandbox tests are not meant to test the program's correctness, but instead to check whether the sandboxed program can run without issues like sandbox violations. This also makes sure that the sandbox policy is correct.
A sandboxed program is tested in the same way you would run it in production, with the arguments and input files it would normally process.
These tests can be as simple as a shell test or C++ tests using sub processes. Check out the examples for inspiration.