As high mortgage rates make potential sellers wary of listing a home and buyers feverishly compete for disappearing inventory, some employers are stepping in to offer employees affordable housing solutions. An offer too good to refuse? It may not be as simple as that.

Housing help can come in many flavors. Companies can create planned communities such as Meta Platforms Inc.’s Willow Village in Menlo Park or Elon Musk’s proposed Snailbrook development outside Austin, with housing offered below market rates to attract and retain employees — a strategy not dissimilar to the “company towns” and “utopias” from a century ago. Local governments can provide affordable housing for employees and citizens, like Chicago’s Teacher’s Village, which is focused on city teachers and independently living seniors. Employers can also offer direct financial support, such as a down-payment assistance program and help with closing costs, or guidance on how to access local grants.

Much as when employers started to offer student loan repayment assistance to lure in millennial hires, this trend of employer-subsidized housing will likely expand as affordability declines. The median cost of an existing single-family home has increased nearly $100,000 in two and a half years, according to a National Association of Realtors report. The mortgage rate has doubled in the same period and people’s monthly payments have gone from 14.7% of their income to 26%.

Should employees be tempted by a housing benefit? It depends entirely on whether your company is helping you buy your own place or providing you with accommodation.

Even though prevailing logic suggests we should not look a gift horse in the mouth, it is wise to be at least a little suspicious since many employee benefits function as golden handcuffs. Take for example an employer-matched retirement plan or stock options that come on a graded- or cliff-vesting schedule over years, as opposed to something the employee gets immediately. End-of-year bonuses are designed to retain talent until they can at least earn the full bonus. Company health insurance plans in the US could be seen as the most effective golden handcuffs.

It's already a nightmare that health insurance is tied to employment, lumping in housing would further reduce a worker’s flexibility to leave, which, of course, is the intent. For an employee, handing over this level of control may not be in their best long-term interests.

Of course, employer-sponsored (or subsidized) housing is not a novel idea. Hershey, Pennsylvania — named for the famous chocolate — was once a model town developed by Milton Hershey for his workers and their families. The military operates housing on bases exclusively for soldiers and their families. Even resident assistants on college campuses can work in exchange for free room and board.

The critical concern for employees is the fine print of the deal because not all employer-subsidized housing benefits are created equal.

Employer-Assisted Housing Programs are often quite flexible. Employers offer a bonus to put toward a down payment or closing costs, provide easier access to loans through partnerships with local banks or credit unions, or classes to help employees navigate the complicated world of homeownerships. Depending on the level of assistance, the employer may require an employee to stay with the company for a set period or face a repayment penalty if they quit.

One example is the Dallas Area Habitat for Humanity. The global non-profit’s focus is to help provide everyone a decent place to live, so the Dallas chapter decided to ensure their employees could take the first steps towards homeownership. Employees can receive a $13,500 forgivable loan to put towards a down payment or closing costs. The loan is forgiven on a graded vesting schedule at 20% a year for five years. Johns Hopkins University offers a taxable grant of up to $17,000 for eligible employees to use towards a down payment or closing costs if they buy within a designated neighborhood of Baltimore.

The dynamics with such benefits are quite different from living and renting in company-owned housing. The latter, such as Elon Musk’s proposed Texas community of Snailbrook, would likely mean you’ll be evicted if you quit your job even if you stay in the area with a different employer. It also begs the question: is your base salary being significantly reduced as a byproduct of being offered subsidized housing in a company town?

When weighing the pros and cons of employer-subsidized housing, the primary rule of real estate should be top of mind: location, location, location. Is the location a personal choice or has your company created a community in which they want employees to live? A company community means you will be surrounded by co-workers. Depending on your job, status within the company, and work culture, there is a very real possibility that living around your coworkers and higher-ups will create an unhealthy or even toxic home-life environment. The behavior of your spouse or children could impact your career trajectory. Plus, your company would have leverage to suppress wages because they know exactly how much it costs for housing and might even control on-site grocery stores and other supplies.

To avoid such outcomes, employers should focus on benefits programs that help employees navigate the complex world of applying for a mortgage, and ensure wages steadily increase. We shouldn’t be turning to companies to solve societal problems such as a shortage of affordable housing unless those gifts come with minimal strings attached. No lengthy tenures at the company and, for those situations where a home purchase is involved, no nasty penalties should an employee choose to leave for another job. 

Erin Lowry is a Bloomberg Opinion columnist covering personal finance. She is the author of the three-part “Broke Millennial” series.