can you an example of those kinds of safeguards? asking for a friend :)
So even if you allow for connection to production (sometimes that's allowed for debugging hard-to-reproduce issues), you want to remove any room for human error.
And your code should obviously NEVER be able to connect to anything other than the local test DB when your environment is set to "TEST".