Show up, swipe in. The routine is familiar to office workers everywhere. In Kuwait, it proved too much to ask.

The government was trying to trim a wage bill that eats up more than half its budget - an outlandish share even by Gulf standards. Last year, it required public employees to swipe their fingers on a biometric reader every morning. The following quarter, about 5,000 quit.

Many of them rarely, if ever, turned up, and were worried they’d get caught under the new rule, according to Khalifa Hamada, the undersecretary at Kuwait’s Finance Ministry.

All Gulf monarchies have some version of this problem. Government is the employer of first resort - even when it has nothing much for its employees to do. That’s part of a tacit agreement between ruling families and citizens. The latter may not get a say in how their countries are run, but at least they get looked after.

Now, after years of lower crude prices, and increasingly aware that the oil will run out one day, Gulf rulers are seeking to repair public finances. The wage bill - by far the biggest spending item in most cases - would be an obvious place to start. But it’s become a kind of third rail, only approached at high political risk.

The historical guarantee of government jobs “is becoming untenable,” said Steffen Hertog, a professor at the London School of Economics. At the same time, he said, “touching the public payroll means tinkering with the core of the Gulf social contract.”

The dilemma is especially acute in the biggest Gulf Arab nation, Saudi Arabia.

Kuwait or Qatar, with much smaller populations and higher energy earnings per capita, can afford to take some time figuring out a solution. Saudi Arabia can’t. About 70 percent of Saudis are below the age of 30. Some 1.2 million will join the workforce by 2022 - four times the total number of Qatari citizens.

Under Crown Prince Mohammed Bin Salman’s ambitious post-oil plan, the crucial role of finding jobs for them is supposed to fall to the private sector.

The government, which employs about two-thirds of Saudi citizens who work, is chipping away at a budget deficit that ballooned to almost 16 percent of GDP after the oil shock of 2014. Last year, Saudi Arabia spent an estimated 440 billion riyals ($117 billion) on wages, nearly half of its total budget expenditure of 926 billion riyals, according to government data.

Like other Gulf rulers, Prince Mohammed - known as MBS - began his cost-cutting drive by scaling back investment projects. Next on the list were subsidies for fuel and utilities, while a value-added tax was also imposed.

But when the crown prince took aim at the allowances paid to state employees, he was forced into a U-turn a few months later, amid rumblings of public discontent and signs the economy was stalling. He proceeded to give them all a monthly $266 cost-of-living award - erasing savings achieved elsewhere.

MBS and other Gulf rulers are ducking the big fiscal challenge, according to Monica Malik, chief economist at Abu Dhabi Commercial Bank. “There’s a limit to how much they can cut back on capital spending,” she said. “They need to tackle the wage bill.”

Those Saudi civil servants aren’t necessarily busier than their Kuwaiti peers.

One employee at a Saudi ministry, who asked not to be identified by name, says her boss has been on an unofficial three-day week for years, and didn’t change that habit even when swiping-in was mandated. When a minister visited her department, several people she’d never seen before turned up. She discovered they’d been on the payroll for years.

Tracking technologies like fingerprinting, swipe-cards and office cameras can identify the absentee “ghost workers.” Dubai’s ruler tried another tack two years ago, making a surprise visit to government offices at the start of the working week - and encountering a lot of empty chairs.

But such methods won’t help eliminate jobs whose holders are fine with showing up and swiping in every day – but have little to do in between. Nor will they address the fundamental distortions in Gulf labor markets. “We’re advocating for structural reforms," said Natalia Tamirisa, IMF mission chief for the United Arab Emirates. “We don’t see that happening yet.”

Many graduates have been comfortable rebuffing offers from private companies and waiting for a government opening. Pay is higher, hours shorter, vacations longer, and allowances or bonuses are plentiful. Walid Al Said, a consultant in Kuwait, once headed a government department and recalls interviewing a 22-year-old job-seeker whose first question was: “What age can I retire?”

Attitudes are gradually shifting, Al Said says. Still, lower-paid private jobs are mostly taken by foreigners. Gulf governments have been trying to edge them out. The Saudis, for example, have forced companies to employ more locals, banned expat workers altogether in some industries, and introduced taxes on them and their dependents.

But pushing foreigners out could just result in lower employment. Many businesses would go bust if they had to take on a local, at pay-rates competitive with government work, to replace each foreigner. Malik calculates that 466,000 expat jobs were cut in Saudi Arabia last year, while only 103,000 Saudi citizens got hired.

What’s more, belt-tightening by governments - especially on investment projects - has slowed job-creation in private sectors that are still largely state-driven (Dubai is a partial exception).

Foreign inflows are supposed to pick up the slack. McKinsey & Co, which has helped draft Saudi economic plans, estimated that $4 trillion of investment would be required to create 6 million jobs by 2030.

But foreign direct investment in Saudi Arabia slumped more than 80 percent last year, according to a UN report. Companies may have been deterred by MBS’s proclaimed crackdown on corruption, which saw dozens of Saudi executives and princes detained and stripped of their assets without due process.

Gulf Arab regimes need to “allow citizens to access the country’s wealth in ways other than jobs,’’ according to Nader Kabbani, director of research at the Brookings Doha Center in Qatar.

He cites Alaska, where a state fund distributes oil profits among residents. Proposals for a universal basic income have gained ground even in countries like Italy that don’t have energy riches to finance it. In the Gulf, Kabbani says that Kuwait – the most democratic of the monarchies, with an elected parliament - would be the best place to start. “The problem is, this conversation isn’t happening," he said.

Instead, Kuwait’s Hamada has watched public employment balloon. The Finance Ministry had about 700 employees when he joined in 1987. There are 3,500 now – but “the workload didn’t increase by even 10 percent."