Jessica Stuart learned the hard way the risks of relying on independent contractors. In 2016, her Washington, D.C.-based production company, Long Story Short Media, filmed in 40 states and hired local crews for each project. The next year, it got slapped with an insurance audit, requiring Stuart to get proof from each of her vendors that they all carried workers' compensation insurance -- or be on the hook for back payments. "It took us down this massive rabbit hole," she says, "looking at: Is it 52¢ or $100 that we owe to Montana, because we filmed there for two days?" Many companies rely on employer of record firms -- like TriNet or NPI -- to avoid headaches. But if you plan to handle compliance in-house, here's what to know.

Know your ABCs.

Federal and state worker-classification laws vary widely, so consult with a lawyer who's well-versed in the rules everywhere you operate, says Tracey Diamond, a labor and employment attorney at law firm Troutman Pepper. In some states, independent contractor relationships are subject to the "ABC test," meaning you must show that a) the contractor's work is not under your company's direction and control, b) it is outside the course of your company's usual business, and c) the contractor has an independent business to do that work.

Beware the permalancer trap.

If a contractor works for you full time and has no other clients, and you're exercising control over that contractor's work, it's time to consider reclassification, says Craig Gehring, co-founder and CEO of MasteryPrep, a test-preparation company in Baton Rouge, Louisiana, that employs about 50 staffers and 150 contractors. "Let's say we have this person who's writing items for us every day, and they're following all our guidelines, and they're coming to all of our company meetings. They're just an employee at that point," Gehring says. "Let's not try to figure out how we can color outside the lines."

Gauge your risk tolerance.

Hiring independent contractors instead of employees can save you 15 to 30 percent on payroll taxes and benefits, says Richard Reibstein, co-head of law firm Locke Lord's independent contractor compliance practice. But if you're caught misclassifying, what you'll owe in back taxes, benefits pay­ments, fines, and federal penalties could easily obliterate those savings. And that's if you don't get sued. If you operate in multiple states, Gehring advises mitigating that risk by tailoring your policies to the one with the strictest laws.

As for Stuart? Well, she's found that strict compliance has been well worth the cost. Her company still hires contractors, but it now has 27 full-timers on its staff. Monthly overhead has more than doubled since 2016, but profit margins have also increased. "It was an investment," she says. "But in terms of the trajectory of the company, we've grown exponentially ever since."