Ensuring Safety and Compliance with Test and Tagging Machines