The non-disclosure agreement always gets mentioned first, but honestly, the thing I've seen cause the most friction is never getting down a clear partnership or co-authorship agreement in writing before a word is written. You can be friends with your collaborator, you can have the same vision, but if you don't define ownership percentages, subsidiary rights splits, and decision-making authority from the start, you're building on sand. A handshake isn't enough when a film option or audiobook deal lands on the table.
What should be in it? The split on advances and royalties is obvious—50/50, 60/40, whatever you agree. But dig deeper. Who controls the social media for the project? What happens if one of you wants to write a sequel and the other doesn't? How are expenses for cover art or marketing handled? Who has the final say on editorial changes if you disagree? The messiest fights I've witnessed weren't about money, but about creative control and the ability to move the project forward unilaterally. A good collaboration agreement acts like a prenup for your book baby—it's not about expecting failure, it's about respecting the work enough to protect it.
Don't just download a template. Spend a few hundred bucks to have an entertainment or publishing lawyer glance at it. That cost is nothing compared to the legal fees you'll pay later to untangle a collaboration gone sour.