Can an employment NDA prevent me from showing my personal code samples on GitHub?
Can an employment NDA stop you from sharing code on GitHub? Learn the legal risks and how to protect your portfolio with TermScore analysis.
Can an employment NDA prevent me from showing my personal code samples on GitHub?
Yes, an employment NDA or Proprietary Information and Inventions Agreement (PIIA) can legally prevent you from sharing code on GitHub. If the code is considered the employer's intellectual property, trade secret, or was developed using company resources, you are likely prohibited from publishing it publicly.
Key takeaway: Never assume that code you wrote at home is yours. If your contract contains a broad 'Assignment of Inventions' clause, your employer may claim ownership of any software developed during your tenure, regardless of when or where it was written.
Understanding the Legal Framework of Code Ownership
Most employment contracts for software engineers include a PIIA. This document dictates what happens to the code you write. Courts generally look at three specific factors when determining if your code is 'personal' or 'company property':
- Company Resources: Did you use a company-issued laptop, cloud credits, or proprietary APIs?
- Scope of Business: Does the code relate directly to the employer's current or anticipated business, research, or development?
- Time and Effort: Was the code developed during your contracted working hours?
If you answer 'yes' to any of these, the code is almost certainly owned by your employer. Action item: Review your employment agreement for an 'Exclusions' or 'Prior Inventions' section. If you didn't list your personal projects there when you were hired, you may have inadvertently assigned them to your employer.
The Risks of Public Repositories
Uploading code to GitHub is a public disclosure. Once code is on a public repository, it is considered 'published.' This creates several legal hazards:
| Risk Factor | Potential Consequence |
|---|---|
| Breach of Contract | Lawsuits for damages or injunctive relief. |
| Trade Secret Loss | Loss of legal protection for proprietary algorithms. |
| Termination | Immediate firing for cause, often forfeiting equity. |
| IP Ownership | Employer claims copyright, forcing you to delete your work. |
Even if you think the code is 'generic,' if it contains snippets, logic, or patterns that mirror your employer's proprietary stack, you are at risk. Action item: Before pushing to GitHub, perform a 'clean room' audit. Ensure no company-specific variable names, internal URLs, or proprietary logic patterns exist in your code.
How to Safely Maintain a Portfolio
You can still build a strong portfolio without violating your NDA. Follow these steps to ensure compliance:
- Create 'Clean' Projects: Build projects that are entirely unrelated to your employer's industry or tech stack.
- Use Personal Hardware: Never touch company hardware for personal projects. Keep your development environments strictly separated.
- Document Exclusions: If you have existing projects, ensure they are explicitly listed in your employment contract as 'Prior Inventions' before you sign.
- Seek Written Consent: If you want to open-source a tool you built, ask your manager or legal department for a written 'No Objection' letter.
Key takeaway: If you are unsure, do not push. The cost of a potential legal dispute with an employer far outweighs the benefit of having one extra repository on your GitHub profile.
Jurisdictional Nuances
Laws vary significantly by state. For example, California Labor Code Section 2870 provides strong protections for employees, stating that an employer cannot claim ownership of an invention developed entirely on your own time without using company resources, provided it does not relate to the employer's business. However, these protections do not apply in every state. Always verify your local labor laws before assuming your personal code is safe.
Protecting Your Career with AI Analysis
Navigating the fine print of employment contracts is complex, but you don't have to do it alone. TermScore uses advanced AI to scan your employment agreements and identify restrictive covenants, assignment of invention clauses, and potential IP traps. By running your contract through TermScore, you can gain a clear, plain-English understanding of your rights and obligations, allowing you to build your portfolio with confidence and legal clarity.
TermScore Research
Our legal AI analyzes thousands of contracts to surface market standards, common pitfalls, and actionable insights for anyone who signs agreements.