The legislation comes after recent federal records controversies where officials lost or deleted messages, like the missing Jan. 6 Secret Service texts.