One Saturday morning a few weeks ago, my friend Caitlin texted me an odd message. “My neighbors are having a really weird yard sale,” she wrote. “You should come check this out.” She’d walked out her front door one weekend morning in the Seattle neighborhood of Wallingford and found a table full of beets and chard set up in her neighbors’ front yard. It was much like a roadside produce stand one finds in rural America — except it was smack in the middle of a 3.3-million-strong metropolis. Turns out it happens every Saturday from May until Thanksgiving: Her neighbors are running a farm stand out of their front yard.

There are peas growing along the sidewalk, compost bins stacked along the side of the house, and raised beds in the back. On a table in the front yard lie bunches of spinach and fat radishes. Becky Warner, one of the farmers, stands on the sidewalk in muck boots and flannel. A guy walks up with a chubby Scottish terrier to pick up his CSA share. “Hank the tank!” Warner greets them. When a farm is this local, apparently you know your farmer and they know your dog.

Warner and four other urban farmers grow food in five backyards in north Seattle. Since 2011 they’ve been selling it at their front yard farm stands and through a CSA. They call their dispersed urban farm City Grown, and it’s exactly that: Food both grown and sold in the city.

But not everyone with a backyard full of extra kale can sell it like summer lemonade. Seattle remains largely ahead of the curve: City Grown can sell food because in 2008, the city council passed a citywide food action plan, Resolution 31019, to encourage urban agriculture. In 2010, they updated it to allow urban farmers to sell their products onsite, even if those sites weren’t zoned for commercial use, which made operations like City Grown viable. “If it’s not following the exactly letter of the law, it’s pretty close,” Warner says.

Grist thanks its sponsors. Become one.

That letter of the law is where transactional urban agriculture gets tricky. Because of local zoning laws, in a lot of places, selling the food you grow onsite can be illegal, or at least not explicitly legal. Most cities aren’t as farmer friendly as Seattle: In Orlando, Tulsa, and St. Louis, front yard farmers have been threatened with fines and even jail time for violating ordinances that prohibit farming. It varies significantly city to city and state by state, and penalties are not always that drastic. Fortunately, other cities are slowly rewriting zoning codes to encourage urban farms and to allow farmers to profit from what they’re producing.

The process is slow and complicated because cities need to consider zoning neighborhoods for both agriculture and for commercial use; historically, those two haven’t overlapped. It gets even more nuanced with outfits like City Grown, where farms exist in implicitly residential areas: It’s tough to precisely parse when a garden becomes a farm, and how they should be treated differently.

In Chicago, which passed a zoning ordinance allowing urban farms in 2011, the delineation comes down to dollars. There, “gardens” are defined as plots where the food is donated or eaten by the growers, and “farms” are plots that make money. Urban farms, no matter how small, require a business license if they’re going to sell food. The city’s goal (and the overarching goal of urban farms) is to build a financially self-sustaining, hyperlocal food system, so that not all urban food sources are run by volunteers or outside-funded community groups.

Grist thanks its sponsors. Become one.

In January, Boston passed Article 89, a zoning ordinance that allowed transactional agriculture within the city. Edith Murnane, director of the Mayor’s Office of Food Initiatives, says they wanted to make it legal and make sure it made sense: Urban farms should bring both food and income to their neighborhoods. “The people who came to the table articulated different interests,” Murnane says. “There were points of debate: If we bring urban ag to the city, is this going to create a livable wage? If you have compost, how does that impact your neighbors?”

It hasn’t been straightforward. It took Boston’s politicians more than four years to get Article 89 passed, because they wanted to hold urban farms to the standards of working farms — namely, that each had built-in longevity and scalability. They tried to address every issue they could foresee, from waste removal to soil toxicity to water use. “It’s not a very intuitive process,” Murnane says. “We wanted to lay out for the farmer every city department that could possibly impact a parcel of land.”

Other cities, like Austin and San Francisco, have fought similar long battles to get policy changed. They’ve all done it slightly differently. In Chattanooga and Minneapolis, specific neighborhoods are zoned for commercial ag. California passed a statewide Urban Agriculture Incentive Zones Act in September, and San Francisco is currently in the process of approving an ordinance that would give landowners a tax break if they turned over vacant lots for urban farming.

In Seattle, Warner says she hopes things trend that way, too. In an urban farming pilot program, the city leased them a plot of public land, so this summer they’re expanding beyond backyards. They’re also focusing more on their neighborhood. For the past two years, they’ve brought their veggies to the local farmers market, but this year they’re skipping it in favor of opening another farm stand at one of their other plots. In finding some success, farm stands could become another tool beyond the farmers market as cities build viable options for local sustainable food systems. “We’re small enough that we just need a little community,” she says.