Positive commandment · Mitzvat Aseh #184 of 613
To construct a guard rail
לעשות מעקה
The verse · Devarim 22:8
כִּי תִבְנֶה בַּיִת חָדָשׁ וְעָשִׂיתָ מַעֲקֶה לְגַגֶּךָ וְלֹא־תָשִׂים דָּמִים בְּבֵיתֶךָ כִּי־יִפֹּל הַנֹּפֵל מִמֶּנּוּ
“When thou buildest a new house, then thou shalt make a parapet for thy roof, that thou bring not blood upon thy house, if any man fall from it.”
The Rambam’s words
To construct a guard rail, as [Deuteronomy 22:8] states: "And you shall construct a guard rail for your roof."
לעשות מעקה, שנאמר: "ועשית מעקה לגגך" (דברים כב,ח).
Why · Sefer HaChinuch #546
A parapet
“It is from the roots of the commandment [that it is] since even though G-d, may He be blessed, supervises the details of people’s [lives] and knows all of their deeds, and [that] everything that happens to them — good or bad — is through His decree and His commandment according to their merit or their guilt, and like the matter that they, may their memory be blessed, said (Chullin 7b), “A man does not [so much as] bruise his finger below (i.e. on earth), unless it is announced about him from above (in Heaven)”; nonetheless a person must guard himself from the accidents that are customary in the world.”
Who & when
“And this commandment is practiced in every place and at all times by males and females.”
Where in the Mishneh Torah
Hilchot Murderer and the Preservation of Life הלכות רוצח ושמירת נפש