The U.N.'s International Maritime Organization said it would begin enforcing the International Ship and Port Security code when it takes effect July 1, which could disrupt shipping.
"Ships will be detained," said Efthimios Mitropoulos, the agency's secretary general. "There will be disruption."
The code, adopted after the Sept. 11 attacks to protect ports and vessels from terrorism, requires port staff and ships' crews to conduct regular anti-terror drills, restrict the number of weapons and visitors aboard vessels and have attack contingency measures in place.
Commercial vessels are also required to submit security plans to the maritime agency.
Mitropoulos said only 301 of about 5,500 port facilities comply with the security code.
"The situation is not as rosy as it should be," he said, adding that the agency also has accepted only 1,933 security plans out of 12,283 submitted by commercial vessels.
He stressed the deadline won't be extended.
"Shipping handles 90 percent of the world's trade. If anything should happen, half the world would starve," he said.
Washington and Singapore have warned of possible port attacks by so-called "floating bombs" — ships rigged to explode.
Osama bin Laden's al Qaeda network is blamed for the October 2000 attack that killed 17 U.S. servicemen on the USS Cole in Yemen, and the bombing two years later of the French tanker Limburg, which killed one person.
Mitropoulos was on a two-day visit to Singapore to watch an anti-terror exercise in the port, one of the world's busiest. The U.S. Coast Guard and China's maritime authorities also observed Tuesday's simulated terror attack on a container ship in Singapore.
Mitropoulos said he welcomed any proposal to secure the busy Straits of Malacca, a link between oil and trading hubs in the Middle East, Europe and Asia. He said any measures must be made in consultation with nearby countries.
Both Malaysia and Indonesia have rejected any outside patrolling help — particularly from the United States.
Singapore already complies with the security code. The country's Maritime and Ports Authority says it will turn away noncompliant ships.