(Istanbul) -- As the EU bends over backward to get Turkey to accept a deal to prevent Syrian and other refugees, asylum seekers, and migrants from leaving its shores or crossing its western borders, it’s worth thinking hard about what’s at stake.

Whatever short-term gains such an agreement might offer the EU and President Recep Tayyip Erdoğan, such a deal may come at the expense of efforts by the EU to address Turkey’s long-term human rights problems that threaten regional stability. It risks trapping ever greater numbers of asylum seekers in Turkey, which lacks a functioning system to protect them. And it sacrifices much of the EU’s remaining leverage with Ankara at a time when Human rights and the rule of law in Turkey are at the worst level I’ve seen in the 12 years I’ve worked on Turkey’s human rights.

Far from being a safe country for refugees, as the EU deal contends, Turkey is also an increasingly unsafe country for its own population -- not least because its political leaders have opted for a repressive and intimidating campaign against all political rivals and critics.

Turkey is generously hosting over two million Syrian refugees under a “temporary protection” system. Many others, including Iraqis and Afghans, lack even that status in Turkey even though they too come from refugee-producing countries.

Turkey could certainly benefit from financial help from the EU to cope with this reality, not least to help provide education for the refugee children living in Turkey’s cities, 80 percent of whom are not going to school. But leaving aside financial enticements, the reality is that beyond generosity, Turkey does not possess a functioning asylum system.

When it signed up to the UN Refugee Convention, Turkey failed to lift the original World War II geographical limitation that applied the treaty only to European refugees. As a result people arriving from the south and east of its borders -- such as Syrians, Iraqis, and Afghans -- have no right to asylum or full refugee status in Turkey. They can only be processed in Turkey for future resettlement in third countries or, as the Syrians have been, granted temporary protection as an exercise of political discretion.

Turkey has no provisions in law to grant non-European refugees full rights or to ensure that they will not be sent back to places where they are at risk, even though Turkey’s international human rights obligations require such protection.

The crux of the EU action plan is that Turkey should keep asylum seekers and migrants within its borders. A brief glance at a map should show that Turkey’s long coast and proximity to Greek islands means that it is highly unlikely that Turkey could keep everyone who wishes to from leaving the country. Sealing its eastern and southern borders to prevent people from even reaching Turkey, a stated goal of the draft action plan, might be easier to accomplish but would put many lives at risk.

Beyond a crackdown on smuggling gangs, keeping people in Turkey would entail a draconian regime of police controls all around the coastline and mass preventive detention of people who might be assembling to leave.

This is a grim prospect for anyone who knows anything about the record of abusive policing in Turkey and it should alert us to major concerns about Turkey, which the EU is conveniently choosing not to mention.

In a bid to hang onto power after indecisive elections earlier this year, the Justice and Development Party government presided over by President Erdoğan has cracked down ruthlessly on the media in the run up to the November 1 general election, done little to distance itself from violent attacks on the pro-Kurdish Peoples’ Democratic Party (HDP) and on the Doğan media group and one of its well-known journalists, and used the courts to pursue and lock up enemies.

Over the summer the government willingly resumed an armed conflict with the armed Kurdistan Workers’ Party (PKK) after abandoning a peace process that many in Turkey welcomed after decades of fighting and deaths. As the hostilities are being played out in the towns, the cost to civilians has been huge, with hundreds of deaths on all sides over less than three months. On top of that, a bombing in Ankara killing over 100 people shows the closeness of the Syria war and Turkey’s failure to tackle the ISIS threat.

It is scandalous and short-sighted that the EU is willing to ignore the huge crackdown under way in Turkey in its attempt to secure a deal to keep out refugees. Beside opening negotiations that dangle the carrot of visa liberalization for Turkish citizens, the European Commission has proposed a regulation to designate Turkey a safe country of origin. This means that Turkish citizens, such as journalists and Kurds fleeing state abuse, would presumptively be assumed not to face persecution if they apply for asylum in the EU. This, despite a 23 percent approval rate for asylum applications from Turkish nationals in the EU in 2014, the same year the European Court of Human Rights found 94 violations of human rights by Turkey.

And delaying of the publication of the annual European Commission Progress Report on Turkey’s steps towards EU membership until after the Turkish elections, suggests the EU is willing to soft-pedal Turkey’s abusive rights record in exchange for its cooperation in stopping asylum seekers and migrants.

Keeping refugees in a country that cannot be described as safe for them, and limiting access to asylum in Europe for Turkey’s own citizens when they may need it most, risks contributing to greater instability within Turkey. Will this be the EU’s poisonous contribution to Turkey’s future?