Sunday, April 23, marked the day that techies, geeks, and comedy lovers had been long awaiting: The season premiere of HBO’s Silicon Valley.

Now in its fourth season, the hit series by Mike Judge, creator of Office Space, has been racking up Emmy nominations and garnering critical acclaim. But beyond its reputation as a spot-on satire of the Valley, the show has some valuable insight into the world of startups and entrepreneurs, as well.

Here are 4 business takeaways from Silicon Valley. (Spoiler alert: This article contains sneak peeks into the plot of the first three episodes of the new season.)

1. Get it in writing

When it comes to business agreements, make sure you get any promises in writing. In the season 4 premiere, Richard Hendricks (Thomas Middleditch) hands the reins of Pied Piper (now “Piper Chat”) to Dinesh (Kumail Nanjiani), telling Dinesh that he is the “horse I would bet on.” But a major conflict emerges after Richard and Dinesh make a verbal agreement allowing Richard access to the company’s database. When the database mysteriously disappears, Richard tells Dinesh he “accidentally disabled his access keys for the video chat database repository.”

“No, actually I deleted them on purpose. I purged all our ex-employees,” Dinesh said. “We had an agreement, not a deal.” Ouch.

While it can be a pain, ensuring that all of the terms of the agreement–even if it’s made between friends–is of paramount importance in the launching of your startup.

2. The devil is in the details

As always, in Silicon Valley, what appears as an obstacle can often lead to an unexpected discovery. After Richard goes around Dinesh and gains access to the user data, he discovers a big problem for Piper Chat regarding the age of the platform’s users. An seemingly small oversight about asking users for parental permission poses a big hurdle for the startup to overcome. Moral of the story? Make sure you cross every “t” and dot every “i.”

SEE: How the ‘PayPal Mafia’ redefined success in Silicon Valley (TechRepublic cover story) | download the PDF version

3. Understand the law

Throughout Silicon Valley, understanding the law is a major theme in the adventures of building a business. For instance, a major question in previous seasons centered on ownership of the intellectual property for Pied Piper’s algorithm, which was developed on a computer at Hooli, the startup’s tech giant nemesis. In season 4, the Piper Chat team gets into some major trouble after inadvertently failing to account for a law regarding internet use. And the law comes with a hefty fine.

Before launching your company, make sure you think through any potential scenario that could get you in trouble–and take steps to prevent these from coming to fruition.

4. Check patents

The concept of “who owns it” also applies to an idea that Richard hatches early on in season 4. After a mad search to unearth a “new internet,” a discovery of documents that may lead to some real progress makes the young entrepreneur feel that he has struck gold. A careful look into patent history, however, throws another curveball into the plot, leading Richard struggling to stay hopeful.

Lesson here–just because you think you know who has the intellectual property rights, those could have transferred if the previous creator formed new business partnerships.

Also see…