When I want to show something running in tmux, or keep an eye on a session from a second screen, I don’t want stray keystrokes to land in it.
tmux attach -r -t demo
-r attaches read-only. You see everything that happens in the session demo, but your keys are ignored, except for the ones bound to detach-client and switch-client. So Ctrl-b d still gets you out.
On recent versions -r is shorthand for -f read-only,ignore-size. The ignore-size part means a watching client with a small window doesn’t shrink the session for the person working in it.
You can also flip it while attached, with switch-client -r from the command prompt. It toggles the read-only flag on your own client.
Read-only is a property of the client, not a security boundary. Anyone who can reach the tmux socket can attach again without -r. For sharing with another user account, tmux 3.3 and later have server-access, which can force a user to read-only.
Further reading: tmux manual page (OpenBSD)