Short answer
HubSpot's KB: after setting up your SMS number, you must get explicit consent. Contacts can opt in with keywords in an SMS thread or be opted in manually if you have express, verifiable consent. Opt-out keywords sent to your number unsubscribe them.
1. In HubSpot
The relevant screen in my demo portal.

2. Worth knowing
Keep a record of where manual consent came from.