How borders are drawn and enforced has far-reaching consequences, whether we live on either side of them or halfway across the world.

With the unveiling last week of all 6,000 pages of the Trans-Pacific Partnership (TPP), fans of abstruse trade law can spend some time digging into the meaty goodness of tariff schedules and regulatory harmonization designed to boost trade.

But there is one chapter health-care advocates are focused on—and they say it will likely make vital medicine more expensive in the poorer countries involved in the pact.

The TPP was agreed to earlier this year by 12 nations including the US, Mexico, Canada, Japan, Vietnam, Peru, and Chile, and now awaits ratification; South Korea and Indonesia are expected to join in the coming years. Though the US in the end relented on some of its demands to protect its drug makers from competition—to the point where some US trade boosters threatened to pull their backing for the deal—the TPP still obliges signatory countries to accept many of the patent rules that help drug firms keep prices high in the US.

The origins of these new rules in the entangled worlds of high-tech medical businesses and government regulation illustrate the compromises that have to be made in reconciling market forces with the public good. And they show how a powerful industry has a habit of ending up on the winning side of those compromises.

US drugs already have strong patent protections

US patents on traditional drugs last 20 years; once they expire, competitors can apply for permission to market a generic version. Generic manufacturers don’t have to repeat the entire costly process of clinical trials, though; a 1984 law called the Hatch-Waxman Act lets them rely on the brand-name drug’s clinical data if they can prove their generic drug is an equivalent.

Brand-name drug makers were aghast at the idea of allowing rivals to use their expensive clinical data to start robbing them of market share, of course. So Hatch-Waxman also contains a compromise: five years of “data exclusivity” after the 20-year patent expires, during which no one else can use brand-name clinical data to get a drug approved.

Generic drugs developed under this system have helped consumers in the US and around the world. But there is a strong case that 25 years of protection for traditional drugs is too long—and ultimately, a way for investors to extract rents (like the infamous case of Martin Shkreli, who bought a drug and raised the price 5,000%) rather than an incentive for innovation.

Obamacare made some protections even stronger

Nonetheless, certain kinds of drug patents ended up even better protected under the Obama administration’s Affordable Care Act (ACA).

The president and his team knew well that to pass a comprehensive overhaul of the health-care system, they’d need the health industry’s powerful players—big hospital chains and pharmaceutical makers, mainly—on their side, even as they found ways to spend less money on them.

To gain pharma’s support, the administration not only agreed not to use the government’s negotiating power to drive down drug prices, but also endorsed a 12-year period of data exclusivity for “biologics”—a class of drugs based not on inert chemical compounds but instead created from living cells, and seen as the next big thing in medical research. This concession was made despite arguments in a 2009 Federal Trade Commission report that biologics don’t need that kind of protection (pdf) because generic versions of them, known as biosimilars, are more difficult to develop than traditional generics.

Now the TPP is exporting those protections

The US sought to accomplish a half-dozen sometimes conflicting goals with the TPP: Open new markets for US exports and especially services; deepen economic linkages with Pacific states in a bid to contain China; convince China to continue liberalizing its economy; and generally raise economic standards, such as labor rights and environmental regulations, at a time when the main forum for doing this, the World Trade Organization, was deeply deadlocked.

Even supporters of the pact in America concede that it will result in low-skilled manufacturing jobs leaving the US for other countries. Though US negotiators included worker protections in the treaty, including the right to unionize, the wage gap between the US and, say, Vietnam or Peru, is just too large for many manufacturers to ignore.

But that sacrifice will be balanced out by benefits to US service industries, particularly those that make their money off intellectual property. When it comes to tech companies or Hollywood films, the higher prices these protections bring can be onerous to consumers, but arguably a lot more so when they involve prices not for entertainment but for health and medicines.

With Republicans in control of Congress, gaining approval of the TPP would in part be contingent on the support of pharma. So US negotiators presented demands opposed by every other country in the talks. The 12-year data exclusivity proposal for biologics was the most controversial, since it was new, well beyond global norms, and considered unnecessary by well-respected authorities. In the end, it was wrangled down to a range of five to eight years.

Get ready for higher drug prices in other TPP countries

While the final agreement was significantly less restrictive than some advocates feared, trade lawyers who reviewed the intellectual property chapter (pdf) say it protects pharmaceutical patents more than previous trade deals do—in particular the Agreement on Trade-Related Aspects of Intellectual Property Rights (TRIPS), a global floor on patent rules that has loopholes to ensure cheap access to medicines.

As well as the five to eight years of data exclusivity for biologics, the TPP has two other key patent protections. One requires countries to allow the practice known as ”evergreening”—letting drug companies request patent extensions for new uses of old drugs. (Opponents of evergreening say it allows companies to extend their lucrative monopoly on drug sales for flimsy reasons.) The other provision makes it easier for drug makers to request extensions on their patents if it takes more than five years for an application to be granted or rejected.

“I am sure it will increase the prices of medicine,” Judit Rius Sanjuan, a legal adviser to Médecins Sans Frontières (MSF), tells Quartz. “It will take components of US law and export them to other countries, and create a new global norm that will change the way the TRIPS agreement was negotiated.”

The effects are unpredictable

Rius notes that MSF, for example, mostly uses generic medicines. Thanks to the rise of generics, she notes, the yearly cost of treating one HIV/AIDs patient has fallen from about $10,000 in 2000 to $100 now.

Before the TPP’s final text was released, AIDS research groups argued (pdf) that the new rules would make such dramatic falls in price impossible. The final draft, however, is less restrictive than they feared and does make exemptions for public-health emergencies; it specifically mentions HIV/AIDS, tuberculosis, and malaria.

So it’s hard to say exactly what all this will do to drug prices around the world in the long run. But that doesn’t mean the rules won’t have real health costs. One study that looked at drug prices in Guatemala after the Central American Free Trade Agreement went into effect in 2005—the pact included the US and five Latin American countries—found that drugs available as cheap generics in the US were still sold under expensive brand names in Guatemala. Price gaps were substantial; one protected insulin cost eight times as much as a generic version, and there were antibiotics costing three to five times as much as their generic equivalents.

One biologic drug that the TPP could have big consequences for is Herceptin, a popular breast cancer treatment from Roche. A full course of it can cost more than $30,000. An Indonesian national drug company recently announced a partnership with a German firm to develop a cheap biosimilar for Herceptin. If they act before Indonesia enacts TPP, they could significantly undercut Roche; but any country where the TPP’s rules are enacted would likely need to wait at least five years before approving a generic version.

The benefits for America are dubious

It’s a testament to the drug industry’s power—and also the US economy’s power—that a deal to expand health insurance for America’s poor will end up raising drug prices for the global poor.

For US negotiators, the ultimate argument for the patent protections in the TPP is national interest. US firms control much of the world’s valuable intellectual property and are well positioned to develop more of it in the years ahead, so protecting it is a no-brainer. But the benefit to the US may not be all that great. Even as these firms demand that the US set stricter IP standards, they are using corporate structures and tax loopholes to move their profits abroad, shrinking their contributions to the US economy.

Of course, the US Congress may fail to enact the TPP in a vote expected next year, which would likely unravel the whole project. Ironically, because support from Democrats is already minimal, the treaty’s death may not come at the hands of its critics, but rather supporters, such as the influential senator Orrin Hatch of Utah, who feels the final version does not protect drug companies enough.

Regardless of whether Congress ratifies the TPP, this won’t be the last time the US government, or the world, takes on pharmaceutical IP rules. As US health-care costs continue to climb, cost controls will have to be found, whether through patent reform or using the government’s market power to negotiate lower prices.

Time may moderate the TPP’s effects

It’s important to note that even if the TPP is ratified, there will be transition periods before the rules go into effect, in some cases as long as a decade. If the extra trade brought by the TPP boosts local economies, then the costs of belonging will be at least partially absorbed. Apparently, the governments in these countries think the trade-off is worth it—but if even a vibrant democracy like the US can sacrifice so much general welfare to drug-company profits, an autocracy like Vietnam is unlikely do better.

Perhaps more importantly to the global poor, the biologic data exclusivity rules in the TPP are up for review by TPP members 10 years after they come into force—which, perhaps not coincidentally, is the exact amount of extra time that Vietnam, the poorest country in the TPP, can delay adopting them. A decade from now, a TPP country like Vietnam may be strong enough to weather the trade pact’s strict rules—or strong enough to fight them.