All authorized officers of the law, while investigating violations of this chapter in performance of their official duties, and any person working under their immediate direction, supervision, or instruction are immune from prosecution under this chapter.