The harbor explosion in Beirut, Lebanon, is the latest cautionary tale about security at ports worldwide. At least 135 people were killed, thousands more injured, and damage estimates topped $15 billion.

The source of the blast was traced to storing a years-old Russian cargo of 2,750 tons of ammonium nitrate, the same potent fertilizer used on a far-smaller scale to bomb the Oklahoma City federal building in 1995.

Although it hasn’t happened in real life, writers and Hollywood often depict catastrophes even larger than the Beirut blast, such as smuggling a nuclear weapon into Baltimore’s harbor in the Tom Clancy thriller “The Sum of All Fears,” or crashing a jetliner into the U.S. Capitol building in Clancy’s “Debt of Honor.”

Beirut re-proves the necessity of security and vigilance at ports of entry.

In the United States, 328 spots are designated as places for goods and people to enter the country. Manning the monitoring points is a thankless and near-impossible task for the Customs and Border Protection service. Today thanks to the Jones Act and homeland security requirements, America’s ports have a private sector and government partnership for our protection.

The need to monitor foreign vessels would be vastly expanded by legislation being floated to repeal the Jones Act.

Customs officials, the Transportation Security Administration, and others in the Department of Homeland Security are overburdened as they work to identify vessels, people and goods arriving from other nations.

Most goods come by ship, since 90 percent of global trade goes by water. And most threats involving terrorism, hazardous material, contraband or counterfeit goods originate in other countries. So the feds have built a huge monitoring network of personnel, data and tracking, relying heavily on “known shipper” programs coordinating with private companies and local governments.

Work is prioritized based on formulas that for security reasons are not fully public, but certainly consider connections to certain countries and entities, and likewise American connections.

It’s impossible to monitor everything among the 11 million containers arriving at U.S. ports each year, but the CBP website states this goal: “CBP uses risk-based analysis and intelligence to pre-screen, assess and examine 100 percent of suspicious containers. Remaining cargo is cleared for entry into the U.S. using advanced inspection technology.”

Only for the fraction identified as “suspicious” can there be 100 percent inspection. A pre-screening process called the Container Security Initiative coordinates with export officials in 59 foreign ports.

Yet it cannot cover all cargo arriving at American ports — cargo that is usually aboard ships that are foreign-owned, foreign-flagged, foreign-built and foreign-crewed. Such vessels are part of our external trade, meaning goods and passengers arriving directly from foreign lands and at one of those 328 ports of entry.

So what’s the link with the Jones Act?

We also have internal trade involving 40,000 vessels working between countless different points within the United States — along our shores, upon our rivers, on the Great Lakes and intra-coastal canals and waterways. What if non-American craft were allowed to operate inside our borders in this manner? Then this internal trade would also need to be vetted by the feds.

Permission to do this is being proposed by those who want the United States to repeal the Jones Act. That’s the law that for 100 years has required that all domestic shipping between places in the United States must be done with vessels built in America, owned and crewed by Americans. Other laws apply similar standards to aviation and trucking.

Should we imagine that removing the Jones Act safeguard could create a national security risk?

According to the official 9/11 Commission Report, “We believe the 9/11 attacks revealed four kinds of failures: in imagination, policy, capabilities and management.”

Nobody in key positions imagined that passenger jets might be used as kamikaze attack planes against the World Trade Center or the Pentagon. Or that small groups of terrorists could create cataclysmic damage.

That’s why Homeland Security periodically invites fiction writers to brainstorm in its hush-hush Red Cell program, to imagine novel ways that attacks can be launched within our borders.

In secret, participants can consider questions like: Since we can only inspect a fraction of the foreign vessels arriving at American ports, how could we monitor them if thousands more were invited to move goods into the heartland?

Nobody imagined that fertilizer offloaded from a Russian cargo ship would decimate Beirut. Only fiction writers imagined how to smuggle a nuke into Baltimore’s harbor. Despite Clancy’s writing about crashing a jet into the Capitol, on 9/11 it remained inconceivable that passenger planes would be used as guided missiles.

Those who scoff as “inconceivable” the dangers from repealing the Jones Act may not realize what that word actually means.