Shift changes at Yellow Cab Cooperative in the Bayview have an unvarying rhythm: Workers line up outside the cashier's booth, each clutching a small wad of bills. One by one, they hand over a $5 tip, which some drivers call a "kickback." The cashier gives them a set of keys and a waybill to log their hours. Engines sputter in the parking lot, fluorescent lights zap in the break room, taxis glide out the gates onto Mississippi Street. Thousands of dollars change hands in the course of an hour. Much of that money is unreported.

Cabs operate within a giant cash economy, many transactions happening under the radar. Tipping cashiers is de rigueur at both Yellow and Luxor Cab companies, and it rakes in hundreds of dollars under the table. Luxor's Assistant Manager Charles Rathbone says that while he doesn't encourage such practices, he also has no way to stop them.

But shady dealings in the industry go well beyond the bill-wads passed through the cashier window. Last fall, the San Francisco Municipal Transportation Agency busted three brokers who had each amassed a pool of medallions and launched an underground business within an established company, renting out taxis at far above the regulated gate fee.

One such broker, Mohammed Iqbal Khan, allegedly "managed" between 25 and 30 taxi permits — called "medallions" — within Luxor Cab Co., according to a complaint filed with the SFMTA. That meant he rented medallions from outsiders for a monthly fee that was at least commensurate — but probably much greater — than the $2,500 industry standard. He then purchased his own small fleet of cabs, paid Luxor for rights to the cab color scheme and the dispatch service, and hired his own drivers, charging an undisclosed gate fee per shift.

Because some brokers don't play by the rules, they have the spending power to outbid regular companies, says DeSoto Cab President Hansu Kim. Whereas a company like DeSoto is constrained by the hundred-dollar regulatory gate fee that keeps it from grossing more than $6,270 per cab a month, a broker won't abide by such regulations. Some of them offer more than $3,000 a month per medallion, says Kim. They then rent the color scheme of a company — usually at $400 a month per cab — to make their operations look official. They recoup that money by skimping on overhead and extorting drivers.

Such backdoor deals are common in the cab industry, says Kim, who had to clean house when he and Matt Gonzalez took over the famously corrupt DeSoto in 2011. Kim explains that since medallions confer all the power in the industry, anyone who wants to be a mogul has to commandeer as many of them as possible. That's not easy with the SMTA's tightly managed wait-list system, which prohibits anyone but seasoned cab drivers from purchasing the $300,000 permits.

While companies fight for any medallion that comes on the market, it's often more enticing for a medallion-holder to lease it out to a third party, or to buy his own taxi, license the color scheme of a company, and go it alone. Meaning many cabs tooling around the city may bear the colors and logos of Yellow or Luxor or Town Taxi, but they're actually run by outside operators, which worries regulators. Competition for medallions has provoked a lot of sweetheart arrangements that are hard for lawmakers to pin down. SFMTA records show that company managers are often complicit.

Many drivers, too, are willing accomplices in their own exploitation. Some turn to brokers to get a cab without a credit card machine so they don't have to report their income, Kim says. Some pay through the nose to snag the more lucrative Friday and Saturday night shifts, which are in shorter supply at regular companies. Others work for brokers if they're fired by regular companies for getting in an accident or having an altercation with a customer. In other words, brokers keep a lifeline for the worst drivers in San Francisco.

They've also opened the door for a subterranean medallion market within an industry that San Francisco is struggling to regulate. Like just about everything else in the taxi industry, it's fueled by untraceable cash deals.

"The problem is [brokers] don't care if you have a taxi permit when they give you the keys to the car," Kim explains, adding that a typical broker might charge $300 for a 24-hour day, which induces the person renting the cab to drive all 24 hours. (SFMTA sets a 10-hour cap on regulated cab shifts.) Many of them switch shifts at each others' houses, rather than at a dispatch lot, says one former Luxor employee who didn't want to be named. That makes them a lot harder to monitor.

Worse yet, for medallion holders who don't want to drive the 800 hours per year that SFMTA requires, brokers make it look like the holder is doing all that driving by forging waybills. That's harder to detect in an underground market, says SFMTA taxi investigator Eric Richholt, though the agency gets complaints about it all the time: He just wrapped up an investigation of a medallion holder who served as a CEO of one German and several American companies, while supposedly only operating a cab.

Nonetheless, large companies often turn a blind eye to brokers, and it's not immediately clear why. Luxor handled the Khan complaint by putting Khan on its payroll, which made his brokering activity legal, even though Rathbone isn't sure what he officially does at the company. Two other companies that received similar complaints also hired their brokers.

The question then, is why these companies would go through the trouble of protecting brokers rather than eradicating them. Even with the cost of overhead, the earning potential from a traditional "gas-and-gate" model dwarfs that of a backdoor company that merely rents its color scheme. While Rathbone says Luxor actually charges more than $400 to rent the company's identifying colors to a broker — the company's full "basket of services" is worth "something in the four figures," he says — he still admits it's more profitable for the company to outfit its own cars and rent them directly to drivers — if you stick to regulations, that is.

But many companies (more than half, according to Kim) have found a way to make brokering profitable. In a 2008 affidavit for San Francisco's now-defunct Taxi Commission, medallion holder Scott Van Leuven said that Luxor's owner, John Lazar, connected him to an illegal broker named Driss "Kiki" Elassali, who paid $2,500 a month in cash to rent Van Leuven's medallion — more than the market rate at that time. Lazar's critics accuse him of colluding with other brokers as well, and pocketing some of the cash as a kickback. Rathbone declined to address those accusations, but says Luxor currently divides its business between gas-and-gate, and an outsourcing program that Khan helps oversee.

Kim says he has to compete daily with companies that spend nothing on infrastructure because they're just serving as middle-men to medallions. "They don't have any dispatch orders, they don't purchase the vehicles and run them," he says. "They're just outhouse operations."

He and other gas-and-gate companies have found a receptive audience at the SFMTA, whose deputy director of taxis, Christiane Hayashi, is working on legislation that would curb third-party brokering. Richholt says he's also cracked down on absentee medallion holders who profit only by leasing to brokers, and ignore their 800-hour cab-driving requirement. In the past year he's submitted six investigations for hearings and opened six more. Meanwhile, the SFMTA shifted to an electronic waybill system that should hinder waybill forgery, though it's still possible for drivers to log in with someone else's password.

Yet it may be impossible for SFMTA to completely clean up the taxi industry, since so much business still happens off the books. Kim insists that many San Francisco companies have no idea who drives their cabs. Richholt agrees that the taxi cash economy has created ample opportunities for extortion, and myriad ways to conceal it. "Wherever there's a rule," he says, "there's someone figuring out ways to get around it."