22

Let's say I developed a web app for a personal endeavour of mine. Soon after, I get a job with a tech company, and my first task is to develop a web app for them. Well, it turns out the functionality of this new company web app is similar to my personal web app, and so I use some of the code from my personal web app in the company's web app. Can the company now sue me or take other legal action if I continue developing my personal web app? If so, how can I put a "license" in my code to protect my intellectual property (since I wrote the code BEFORE I even took the job)?

For the programmers out there, the code language is JavaScript and CSS.

user3163495
  • 322
  • 1
  • 2
  • 6

8 Answers8

31

In the US, code that you write in the course of employment is the property of your employer. Otherwise, anything that you create is your property. The gray area is things that you write during your employment but not in the course of your employment (hence the terms of the employment contract are vital).

Something that you write before becoming an employee is not "in the course of employment". However, if you use that code in the in the course of employment, you invite the argument that in fact the code was written in the course of employment. That argument can be squelched if you have an agreement with the employer that acknowledges that you are licensing your code to the employer in exchange for ... some consideration. It could be $1, or a similar unit of currency.

user6726
  • 217,973
  • 11
  • 354
  • 589
23

Is your personal code Published somewhere public? Github?
If not, publish it. Give it a permissible licence.
Then ask your employer/project manager/collegues if they would allow a niche public library you wrote yourself, because it seems to solve the problem.

Thomas
  • 231
  • 1
  • 3
9

If you wrote it before you started your employment, it is your intellectual property.

However, you should not just arbitrarily include intellectual property that the company doesn't own in a project you are building for the company, without their knowledge and agreement.

Often it's expected that you will make use of open source code in the course of building the company's project, but that is explicitly licensed to the company (via being published with an open invitation for anybody to accept the open source license it's published with), and if the company wants you to use open source material it is presumably happy to comply with those license terms. (You also should not include open source material without knowing the company is happy to be bound by the open source licenses for this project; generally it's clear if that's the case because there is already lots of open source code included in the project codebase, but it would never hurt to ask what the policy is explicitly)

Unpublished code you just happen to have access to should never be included in the company's projects. Without a license the company may be on the hook for copyright infringement, and even worse could find itself trapped unable to continue developing its own products because it is unable to make further derivative works of the code it does not own and has no license to use!

Code you just happen to have access to because you wrote it is only slightly different, in that you would be able to enter into a license agreement with the company to ensure the above situation does not happen. But the company will want to have an explicit written license agreement, so you absolutely should not include your own code without talking to your boss. And they are unlikely to accept any license less permissive than an open source license (so you won't be able to keep your code private to just yourself and the company; they will need extensive rights to modify and distribute it after you have left the company).

If you do include this code that is owned by you, rather than by the company, you may also be inviting personal trouble. If there is no evidence of the fact that you wrote it prior to your work for this company they may believe you are stealing their property if you later use it, and then engage legal proceedings against you. Strictly speaking this should come out in your favour, but if there's little documented evidence of exactly the circumstances in which the code was first created, then you can't rely on a court to rule that you should be the owner, even if that is the truth. So you should want an explicit written license agreement before using this code int he company project too, so that you later have proof that the company acknowledged your prior ownership.

But really, the company does not (or at least should not) want to get into that situation of disputed ownership in the first place. They would much rather you only included code that is either created during the course of your employment (so they own it completely) or is clearly licensed to the company (such as widely published open source code). Code you own but haven't published as open source prior to starting with the company, unless it is quite substantial, is probably just not worth the hassle for them of getting it properly licensed. Most likely paying developers to reinvent that wheel is cheaper than paying lawyers to make sure there are no legal issues.

Ben
  • 346
  • 1
  • 5
8

You can be sued for anything. You will likely get sued if someone believes you caused them damage. With the facts as you describe them (you wrote software in your spare time at your own expenses, you "donated" it to your company) you never caused any damage, but if the company doesn't know the details, and all they know is that some code X is both in their product, and in your private product, they are likely to assume that you damaged them.

So I would strongly recommend that you talk to your manager at least before using any of your own code, and be prepared that the company doesn't allow it and that they don't want anything in their products where they are not the copyright owner. Making sure that you can't turn around in two years time and demand that your code gets removed could easily be more expensive than paying you or someone else to write code with the same functionality.

gnasher729
  • 35,915
  • 2
  • 51
  • 94
6

At least once I was asked to provide a list of code I had already written (standard utility stuff that mostly now happens in libraries) at hire. Other times I supplied it myself, unasked.

A prenup is often a good idea.

Andrew Lazarus
  • 1,434
  • 9
  • 12
3

I think the key point here is to talk to your employer early, namely the moment you notice that code you already wrote for your personal project is useful for the task you got from the employer. There is potential for a win-win here because if the code the company needs already exists they can get it cheaper and faster than if you have to rewrite it from scratch. You just have to talk to them and find a mutually acceptable agreement. They get the code (and it is their intellectual property afterwards) and you get something from them, cash or some other work priviledges that you want. As both sides can win here this shouldn't be too difficult.

quarague
  • 4,369
  • 2
  • 15
  • 26
2

The actual problem here is the liability that you are exposing the company to. You are including code in their product that someone other than the company (you) has a prior copyright claim to. You probably signed something saying you wouldn't do this when you joined the company.

I think that making your previously written code public somewhere with an MIT-style open source license (or something else that explicitly says commercial derivatives are fine and obligation-free) would probably eliminate the problem.

It is still best to check. Just tell someone the situation and ask them if it's ok to use your code.

msouth
  • 141
  • 4
1

This has come up numerous times throughout my career, so I will comment specifically, both neutral, positive, and negative experiences.

I formed my own C-Corporation in 2012, so it’s 12 years old now. I then proceeded, over the years, to create numerous PHP and JS open source packages, almost all MIT Licensed, that became somewhat prolific in the Open Source community (over 1 million installs). https://github.com/PHPExpertsInc/ (currently: 70 repos).

I register for official copyright paperwork for every project that more than 50,000 installs with the US Copyright office.

Most importantly, all of the works are owned by my own corporation, which does pay me a very modest salary for them. Thus, they aren’t technically “mine”, but belong to the C-Corp, which I happen to own 100% of and have full control of.

Contractually, the projects revert back to my ownership and copyright if and when the corporation is ever dissolved for any reason (lack of paying corporate dues, lawsuits, willful ending of the business, etc.).

Pre-Employment Contractual Setup: Most businesses I have started working for over the years have an Intellectual Property Disclosure form, where they want to list the works created by me. Well, it’s quite a lot. I’ve written 5 books (3 currently on Amazon), over 150 open source projects, etc. I list them all, at least in passing. Even when employers do not ask (especially for 1099 work), I submit my own IP document, attached to the final employment documents.

It is literally 3-4 pages of small-font lists of each of the projects with GitHub / Amazon URLs and the year started.

Then I add the blurb: Perpetual license is given to this Employer for use of all of the software developed, maintained, and owned by PHP Experts, Inc., persuant to the open source licenses of each project, if the Employee is permitted to work on the project as part of this employment contract.

I strive to only work on the projects before 8 AM and after 7 PM and on weekends, except for jobs that I put the IP and Contract clauses and I know that they have accepted it.

Neutral Outcomes: Most companies don’t really notice that I use my own software (particularly phpexperts/rest-speaker and phpexperts/simple-dto), especially 1099 short-term contract work. Usually nothing ever becomes of it. I don’t even think people notice.

Positive Outcomes: My current employer embraces open source and realizes that my projects bring about 2,000 hours of free labor from the git-go, and that their other devs benefit from usign my open source projects, too.

I’ve been hired primarily because the interviewers personally used my projects, particularly the bash-timer and BashScripts framework.

I’ve also had two employers that hired me at discounted rates on the condition that I create open source projects for my own company and use them in their own business. But that seems outside the scope of this question.

Negative Outcomes:

Story 1:

Not once, but two times, I have successfully inserted my IP clauses into contract documents but things turned very south. First time, I was working for a lawfirm, and I refused to sign the original employment contract without my IP addendum. It went all the way up to the CEO, himself a contract lawyer. He called me into his office, I told him I brought a lot to the table and he should authorize it, as it would let me help his corp immediately in major ways. He was so impressed that we ended up reducing my expected salary by $20,000 on condition that I could build a completely new thirdparty API client and maintain ownership of it while I worked there (using that API client for the business’ core needs).

These IP things are not standard, and no one, certainly not me, told my manager or other developers about this arrangement.

For more than a year, I brought in over 20-30 of my projects into this org’s existing legacy software and really turned things around. But egos ran hot and heavy and the other devs (I was team lead) greatly resented and viewed it as theft of some sort that I was actively contributing to all of these open source projects of mine in my day to day work (all changes necessry for the company’s legacy software to work, for instance, porting some to work on Windows PHP).

Things came to a head when the CTO found out and I found myself in a dark room surrounded by corporate IP attorneys threatening me with all sorts of nastiness. Then I showed them the IP contract with the CEO’s signature dated before I started working there, with lists of every project that was under contention in that discussion.

The CEO was called in, interrupted his day, he was pissed. He said, yes, that he authorized it, and that I must be shrewder than all of them. The lawyers folded their folders and told the CTO that, well, I was completely in the clear.

The next week, the CIO (my boss) and the CTO and HR met me in the same meeting room and told me that I was being let go for no cause. The CIO’s face looked ashen. He told them all, “Theo has saved this company in the 15 months he has been here. I am afraid we won’t survive 6 months without him.”

That was early November 2019. The CTO ordered all my projects be removed from the website. The website crashed. They missed their Black Friday weekend because the devs who remained were really highly incompetent and couldn’t finish the project in time. Then they missed Christmas. Then in January 2020, they had mass layoffs and laid off basically every competent person who remained. Then COVID hit in March, and they were out of business by May. his prophecy came true.

Outcome 2:

I worked for another company for almost 3 years. A huge Fortune 50. They accepted the IP clause but I didn’t actually work on any of my projects during work, always nights and weekends. I was also 1099 hourly and never, ever, not a single time worked on the clock on my projects (any of them).

I was team lead and ended up integrating about 5-6 of my projects into the app. No one really noticed. I guess they just assumed they were just like any other app.

Then one day, someone on another team at the huge company used one of my more popular projects in their own project, at the company. They had discovered it by accidnet. After a while, someone else realized that I was the author. Egos ran hot, and they found out that I was using it in every project I contributed to over there.

Well, as you can imagine, my manager said he felt betrayed. I said, why don’t you look at the git log and find a single time when I worked on this during working hours? So apparently he assigned some junior dev to do just that.

The junior dev used some sort of tool and sure enough, not a single contribution was committed during working hours over the 3 years I worked there.

Still, they put me on unpaid leave and had legal look at it. Legal came bakc and said, “We found this in his legal contract.”

But I wasn’t hired directly, no no, this company was hiring my company, via another third party recruiter. I had/have Accidental Errors & Omissions insurance, and successfully filed a claim for lost income due to the thirdparty being at fault (breach of contract).

The lawyers swiftly replied that, yes, since my company was the actual employer of me, this was all 100% legal even without a contract in the IP clause (becuase my corporation was paying me in addition to the employer paying my corporation).

SO case was dismissed, the insurance paid out 8 business days of lossed wages, and then the insurance company sent the bill to the Fortune 50, which paid them.

My CTO never ever forgot it and for the next year, he urgently tried to find someone to replace me. More than a dozen coders were assigned to work with me (Team of 1) but no one could cut it, and most quit of their own accord after 2-3 weeks and went back to easier projects. After 14 months, finally someone decently competent could actually do about 20% of the amoutn of work I was doing.

3 months later, I was gone. Contract terminated early, with penalty payment. On my last day there, the product manager told the entire division (some 100 people) that he didn’t know how the project would survive long-term without me. Actually, 2 senior devs jumped ship when this was going down, sensing that the project would die. Five months later, he was proven right and the company had to hire an additional 20 testers to replace the product I had single-handedly maintained for 3 years.

But yeah, work for your own c-corp and bring in projects that you started before this new employment, and insert an IP Disclosure paper into your employment contract and you should be good to go.

Oh and never work on your own stuff on company laptop, and try to work off-hours.