You can grant friends access to your computer with permissions set specifically to just the controller, the mouse, the keyboard or some combination of the three. You can change these settings in the friends section of the app.
Click on the friends menu, choose the friend, and grant them different permissions. Please remember, these permissions will be saved and impact every connection from that friend.
On each connection, you can change the permissions for the friend during that connection by clicking on the friend's profile image at the bottom of the page and choosing the permissions you'd like to set for that connection only.
If someone is joining the gaming session as a friend, they will have the permissions you granted by default. If they're joining through a link, they will not have permission to use any input device. You must grant them access to the input devices you'd like to provide in the hosting sidebar.