I was never really concerned about the ethics, but was more worried that I'd be personally liable for it. I kept thinking about the VW emissions scandal, where the engineer that implemented it was given prison time.
In hindsight, it was probably a stupid thing for me to worry about. I also never should have expected that I'd be able to change the director's mind by refusing to do what he said.