It has adopted what is known as a "limited-duration shareholder rights plan", also known as a "poison pill".
The move will prevent anyone from having more than a 15% stake in the company.
It does this by allowing others to buy additional shares at a discount.
The Twitter board detailed its defence plan to the US Securities and Exchange Commission and put out a statement saying it was needed because of Mr Musk's "unsolicited, non-binding proposal to acquire Twitter".
A takeover bid is considered hostile when one company tries to acquire another against the wishes of that company's management - in Twitter's case, its executive board.
Josh White, former financial economist for the Securities and Exchange Commission, told the BBC that a poison pill is "one of those last lines of defence against a hostile bid takeover".
"We call it the nuclear option," he said.
Mr White says the board has made it clear "that they don't feel like it's a high enough value for the company".