 Excellent question. I know that a lot of people do this, and you see stuff online about First Amendment audits. Yes, you are allowed to record the interaction with the police officer, and the police officer should not tell you to stop recording. If they, quote-unquote, make you stop recording, you have a legitimate beef. But what I warn people about with that is,