https://en.wikipedia.org/wiki/Chilling_effect
Another related term is "the panopticon", a prison designed so that you always felt like you were being watched.
https://en.wikipedia.org/wiki/Panopticon
https://journals.sagepub.com/doi/10.1177/1461444818801317
https://journals.sagepub.com/doi/10.1177/1461444818801317