Elon Musk has agreed to more specific oversight on his tweets about Tesla, and a court has now approved the deal. After weeks of negotiation, Musk and the Securities and Exchange Commission decided last Friday that Musk must have a company lawyer pre-approve tweets about Tesla’s financial health, sales, or delivery numbers — estimated or otherwise — as well as other specific subjects, according to a court filing.

The two sides filed late last Friday to amend the settlement agreement reached last year over the “funding secured” debacle, which originally prompted the SEC to attempt to install oversight over Musk’s tweets. US District Court Judge Alison Nathan, who presided over the case, has approved Friday’s amendment as of today, April 30th.

According to the filing, Musk now needs Tesla’s securities lawyer to pre-approve any public, written communication containing information about:

Tesla’s financial condition, statements, or results, including earnings or guidance

potential or proposed mergers, acquisitions, dispositions, tender offers, or joint ventures

production, sales, or delivery numbers (actual or estimated) that haven’t been shared, or ones that differ from Tesla’s official guidance

new or proposed lines of business unrelated to Tesla’s existing businesses (defined in the filing as “vehicles, transportation, and sustainable energy products)

changes in the status of Tesla’s securities, credit facilities, or financing / lending arrangements

nonpublic legal or regulatory findings or decisions

anything that would require the filing of an 8-K form with the SEC, including changes in control of the company, or to its executive officers and directors

any other topic that Tesla — or a majority of its independent members of the company’s board of directors — believe needs pre-approval

This change to the settlement agreement came after, on February 19th, Musk tweeted Tesla would make “around” 500,000 Model 3s this year. This appeared to clash with the company’s official guidance of delivering 360,000 to 400,000 cars total in 2019 — including Model S and Model X — since Tesla usually delivers almost every car it makes. (This past week, though, the company said it expects to wind up with more inventory in 2019, with production being “significantly higher” than deliveries.)

Musk previously said the SEC was attempting an “unconstitutional power grab”

Musk corrected himself with a tweet a few hours later, but the SEC used this opportunity to ask Tesla for proof that he was complying with the settlement. The agency found out that Musk had not, in fact, had any of his tweets about Tesla pre-approved by the in-house lawyer since the settlement went into effect in December.

On February 25th, the SEC asked to hold Musk in contempt of court for allegedly violating the settlement. Musk and the SEC spent the next few weeks filing scathing responses, with Musk saying the SEC was attempting an “unconstitutional power grab,” and the agency saying the Tesla CEO was in “blatant violation” of the settlement.

Eventually, Judge Nathan called Musk and the SEC to court on April 4th for a hearing where she ordered them to work things out. “Take a breath,” she said that day, “[and] come back with your reasonableness pants on.”

The Tesla CEO originally got in trouble with the regulatory agency last September after he tweeted in August that he was considering taking Tesla private once the company’s shares reached a price of $420. (Tesla has been a publicly traded company since 2010.) Musk said on Twitter that he had “funding secured” to pull off the deal and buy out any shareholders who didn’t want to stick with the company. He published these tweets during the afternoon while trading was still happening, and the company’s stock price jumped in response.

The SEC swiftly began an investigation into Musk’s tweets. The commission ultimately found out that, while he had held a few meetings with Saudi Arabia’s sovereign wealth fund, Musk “had never discussed a going-private transaction at $420 per share with any potential funding source, had done nothing to investigate whether it would be possible for all current investors to remain with Tesla as a private company via a ‘special purpose fund,’ and had not confirmed support of Tesla’s investors for a potential going-private transaction.”

“Musk’s tweets caused market chaos and harmed Tesla investors,” prosecutors said last year

“Musk’s tweets caused market chaos and harmed Tesla investors,” prosecutors said.

The SEC approached Musk with a settlement in late September that he ultimately rejected. On September 28th, the SEC charged Musk with securities fraud in the Southern District of New York over his “false and misleading” tweets. Two days later, the two sides reached a settlement. Musk was forced to step down as Tesla chairman for three years, pay a $20 million fine, and agree to grant an in-house lawyer oversight on any public communications about the company, including his tweets, that could affect Tesla’s stock price (and, in turn, its shareholders).

One thing we learned in March as the two sides fought over whether Musk should be held in contempt is that, in the original settlement that the Tesla CEO turned down, the SEC wanted all of his public communications to be vetted — material or not. This was a sticking point for Musk, and the language ultimately got softened in the version of the settlement he agreed to.

Last Friday’s filing brings the language closer to what the SEC originally sought. Musk will now be subject to oversight on a rash of specific topics related to Tesla, but he won’t need to have every off-handed tweet about the company approved.

Update, April 30th at 7:29 PM ET: The court has now approved the settlement between Tesla and the SEC. In a previous update, we clarified that Tesla’s guidance was for 360,000-400,000 deliveries in 2019.