Answer: Yes, a landlord must have hard-wired fire alarms in the common areas, and also, smoke detectors inside individual dwelling units.
The state sanitary code says “see the fire regulations”:
410.482: Smoke Detectors and Carbon Monoxide Alarms
(A) Owners shall provide, install, and maintain in operable condition smoke detectors and carbon monoxide alarms in every dwelling that is required to be equipped with smoke detectors and carbon monoxide alarms in accordance with any provision of the Massachusetts General Laws and any applicable regulations of the State Board of Fire Prevention (527 CMR), State Board of Building Regulations and Standards (780 CMR), or the Board of Examiners of Plumbers and Gas Fitters (248 CMR).
The fire regulations are split into multiple parts.
Carbon monoxide detectors are required if there’s gas burned in the building or if there’s indoor parking, see section 31.04:
Smoke detectors are required in all the locations written out here, see 24.07(2). This includes protecting bedrooms inside each dwelling unit.
The only exception seems to be for studios, where you can put a detector in the stairwell for some reason.
Landlords can require tenants to maintain the smoke detectors if it’s written in the rental agreement. There are new smoke detectors with tamper-proof ten year batteries. These should be installed anywhere tenants are not reliable when it comes to replacing batteries. Many tenants will remove the batteries from a beeping detector and just operate without this life-saving equipment.
As a landlord you want to protect tenants who don’t know better by making smoke detector sweeps (always give notice) or installing these tamper-proof or hardwired devices.