WASHINGTON — The federal government has proposed adding a line to forms filled out by visitors to the United States that would ask them to voluntarily disclose their social media accounts, a step that it said would help in screening for ties to terrorism.

Visitors entering the country under the Visa Waiver Program, which allows citizens of some countries to visit up to 90 days without a visa, would not be required to list their social media accounts, and the forms would not ask for passwords. But Customs and Border Protection, which announced the proposal last week in the Federal Register, said the social media information would give it extra investigative tools.

“Collecting social media data will enhance the existing investigative process and provide D.H.S. greater clarity and visibility to possible nefarious activity,” the border agency said, referring to the Department of Homeland Security, its parent organization.

The proposal comes after Congress passed legislation last year to add restrictions to the Visa Waiver Program. The legislation was a response to the November terrorist attacks in Paris, which led to fears that European-born or naturalized citizens with terrorist ties could enter the United States without being properly vetted.