A shortcut you share as a file gets signed, and the signing mode decides who can import it. You can do that from the Export dialog in the Shortcuts app, but the shortcuts command line tool on the Mac has a sign subcommand for it too, which is handy when you keep your shortcuts in a folder or a Git repo.
shortcuts sign --mode people-who-know-me --input "Share me.shortcut" --output "Share me signed.shortcut"
You give it a shortcut you exported earlier with --input, a name for the signed copy with --output, and a mode. There are two modes. Anyone means anyone can import the shortcut. People who know me means only people who have you in their contacts can import it.
Example: you made a shortcut for your family that resizes photos before sending them. Sign it with the people-who-know-me mode, put the signed file in a shared folder, and only the people who have your contact card can import it. For a shortcut you’d offer as a download on a blog, the Anyone mode is the one you want.
Now the privacy part, because from here in the EU I always want to know what leaves my Mac. Apple says that when you sign a shortcut, Apple receives a copy for validation, to prevent tampering when you share it. And with people-who-know-me, your contact info is included in the shortcut file. That makes sense for the check, but don’t sign a shortcut with an API key or a home address typed into one of its actions, and don’t hand a people-who-know-me file to strangers.
Further reading: Apple: Run shortcuts from the command line, Apple: Share shortcuts on Mac