14

I have adapted part of a personal project for use in a work project. I want to make sure I retain the right to use my code. Do I need to license it to my employer for this, or is it enough that I used it in my personal project first?

One solution would be to just release the code under MIT license. But I don't actually want to release the whole thing, only the reused parts in their adapted form - so I think that would mean I'd need to extract/adapt the code I want to reuse on my own computer in my own time. Or can I just put a license note in saying it reuses code released under MIT without linking to the original code?

Is there another license that is more appropriate for this?

5
  • I think there is no problem when you use some work from home (I name it "software item") in your job unless you want to get money for it; however if you extend your software item at work and want to bring back those changes back home, your employer may not like it, because you got paid while working on the software item at work. (Back at my university many years ago it was explicitly forbidden to develop software you want to make money with later)
    – U. Windl
    Commented Aug 29 at 8:59
  • Was the personal project released previously as open source somewhere publicly?
    – Brandin
    Commented Aug 29 at 12:26
  • If you ask nicely, the employer might agree to license the improvements made at work back to the project under a free licence (that's a reasonable quid pro quo). But don't risk republishing those changes without a licence agreement in place to permit it! Commented Aug 29 at 16:21
  • 1
    Beware that some employers claim ownership of everything you write while in their employ, whether in the office, or at home "in your own time". Horrible, but I've seen it.
    – Martin
    Commented Aug 30 at 13:52
  • 1
    @Martin: exactly what occurred to me -- I'd try to be explicit in the offer to employer about licensing it to them for inclusion -- where it is used, how it is used, do they get a permanent ability to include it in other projects, develop and change it, call it their own? The advantage to them of a limited license even if you limit some of the IP (Intellectual Property) aspects such as mentioned is that they have that portion now completed and don't have to pay to have someone/you write it now. Depends a lot on the uniqueness and usefulness of the code Commented Aug 30 at 14:18

7 Answers 7

26

For me, question one is whether your employer is happy with this. They may have opinions about code appearing in their codebase to which they do not hold the copyright, so ask them before you do this. If they're happy with the idea, they may well be able to tell you what licence(s) are acceptable to them. I note in passing that your employer may have some awful conditions of employment that give them the right to all the code you generate, even in your own time, depending on whether your jurisdiction permits it; I'm assuming you don't have such a condition, because you'd be foolish to be doing this in the first place if you did.

Assuming your employer is happy with you using your code in this way, then any free licence will allow your employer to use it. MIT would be fine, and your employer will need only to retain your copyright notice and the MIT licence text somewhere in their codebase. You can release it to your employer as-is under MIT without necessarily releasing it to the rest of the world, then the adaptation can be done on your employer's time (again, assuming they're happy with this). Theoretically, your employer could release the code that you gave them under MIT to the rest of the world, but that's probably not much of a risk, if they're in the proprietary software business.

If your employer says they're fine with it provided you assign the rights to them, don't do it: you could then no longer use the code yourself, nor release it under any licence at all.

2
  • 4
    Yes, there is no problem using open source code and no automatic claim to everything we write (though even if there was it wouldn't be applicable, I wrote the code in question before joining the company). Commented Aug 28 at 9:11
  • 3
    That last point seems highly germane to me, and thank you for making it.
    – MadHatter
    Commented Aug 28 at 9:13
7

If you wrote it in your own time, then you are the copyright owner.

But if you work on it or update it during work time using company resources and/or use it in your company's products, and if you release that back to open source on a platform like GitHub, your employer could claim that the business entity (company) owns at least a part of the copyrights, if not all of it.

Next, you may put your employment in jeopardy, as your employer may claim that you are exposing company intellectual property by putting it on GitHub. You could be terminated without financial compensation for disciplinary reasons.

If you work on it or update it during work time using company resources and/or use it in your company's products, but do not release that back to open source on a platform like GitHub, then it's fine. But your employer might consider it some kind of conflict of interest, or try to claim that the business entity has copyrights (although unlikely).

So, I would suggest that you discuss that with your employer and get this understanding in writing (by email for example), before proceeding.

0

I know it's a little more effort and not sure which language this is in but why not simply release this as a library and avoid the confusion and discussion entirely.

That way your library can be licensed as you see fit (assuming it still fits into you companies open source dependency policy) and you can clearly document the dependency on code that isn't owned or maintained by your company (just as you would for any other dependency).

It also means that the next person to touch that code doesn't have to go through the legal rigmarole that you would if you tried to keep the licence on some arbitrary piece of code in someone else's code base.

Push it to your languages package manager of choice (maven central or npm.io etc), pull in the dependency, move on. The upshot of this is that you also get the benefit of learning a worthwhile skill in the process and being a "publisher author" 😉

-1

Like others have said. Your employers can really screw you on this. If you have personal code and you want to use it at work. The best thing to do is license it and plaster it all over in a public domain like github.

I did something similar. It was a project I had worked on 10 years ago. I slapped a license on it an used it at work with manager approvals. When I left they wanted to extend some modules. I was on bad terms with my skip level and my immediate manager had left. When I left they had the FBI raid my house claiming I stole company IP...

Long story short... can't be too safe... and businesses have too much political influence...

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Sep 1 at 7:52
-1

If you work for Amazon and signed the standard paperwork, then you gave them EXCLUSIVE future control over any open source code you may have previously created that you re-use in your work for them. Open-source programmers: DO NOT SIGN ANY AGREEMENTS WITH AMAZON UNTIL THEY FIX THIS!

Now, assumings you don't work for Amazon, you still need to Be careful. Laws may vary from state to state, and I'm not a lawyer and this is not legal advice, but here in California, I would send your employer written notice along the lines of:

"Pursuant to California Labor Code Section 2870, I am notifying you that I have invented on my own time using my own equipment [name of app/library], code which is able to [describe functionality]."

Keep a record of that message on your personal system, better yet, send it from a personal account on a personal system.

THEN, you can have a conversation about licensing your code to you employer under a Non-exclusive license with whatever other terms work for you.

-1

Under copyright law, you wrote the code so you own it

If you wrote something at work then probably something in your contract states "if you did it on work time then the company owns it" - but you didn't so it's yours. Your contract may state something different like "anything you write while employed is the company's" - in which case you do not own it at all, check your contract!

No need to license it if all you want is to retain the right to use your code, as the copyright holder you already have that right.

You should google "copyright [my country]" to find out your exact rights. In the US for example you have the right to reproduce the work, and produce derivative works. In other words you can paste it around as much as you want and you can continue developing your own code. Pretty much every country's copyright law must have similar rights I imagine.

Beware people saying you need to license your work to have ownership of it. Copyright is instant and automatic.

7
  • 1
    There are strange places in the world though, reddit.com/r/gamedev/comments/1phmkr/…, exactly in the USA.
    – tevemadar
    Commented Aug 29 at 15:32
  • 2
    Yes, the point here is that Peter owns it, not the employer. But employer wants to use it and redistribute the object code. So what license is suitable? Commented Aug 29 at 16:18
  • 1
    @TobySpeight that is a question, but the question OP's concern is "I want to make sure I retain the right to use my code." It's good to give a general opinion, but also make sure to answer the OP's question.
    – jgn
    Commented Aug 30 at 6:19
  • 2
    This is not necessarily true. There are many circumstances where something you author while employed can be determined to be a work-made-for-hire. Workers need to be careful and maybe talk to an actual lawyer in your state rather than a rando on the Internet.
    – matt2000
    Commented Aug 30 at 23:54
  • @matt2000 If your contract states ANYTHING you write while employed is the property of the company then you don't own the work in the first place, you CANNOT license it at all. That said, OP wrote the code BEFORE joining the company.
    – jgn
    Commented Sep 2 at 7:50
-2

People have mentioned how things can go wrong - it's always been smooth for me as long as I communicate. I've even gone a step or two further by going the other way around. For code I already have, I just tell my boss that I'm giving the company a free copy of the code. Then cover the license details in a written email. That probably brings better clarity than starting off talking about license details - "I'm giving the company a free copy of the software I wrote two years ago". Same as if they bought software from whomever, just the price is zero dollars.

You can, of course, use any license you want - it's your code. You could choose not to distribute it but use an open source license - that gives the company the right to distribute it, though. I've used a very simple license:

Acme Corp is hereby licensed by John Smith to copy modify, and otherwise use Foo, written by John Smith. This license is perpetual and assignable.

You can pull up on her examples of more detailed proprietary licenses if you wish.

I've also done it more than once with new code written partially for the employer, and I wanted to have it for future use. But only when the code isn't directly related to their core business. For instance, in a company that makes cars or appliances or bedsheets, maybe I write a module that makes querying and cross referencing Active Directory easier. I'll ask my boss if it's okay if I open source that on my Github (so I can have it at my next job). More often than not they say yes, provided there's nothing that references the company. They don't want to become responsible / liable or have any PR concerns or whatever by being connected to something they don't need to have their name on. Or be getting calls and emails for tech support. (That happened once when I accidentally left the internal documentation file in the repo).

Note I would NOT do that if I wrote some driver assist code for Toyota - cars are their core business. Of course they don't want to share that code with their competitors. Toyota management would likely be fine with open sourcing code related to checking that Windows machines have been patched - Windows security isn't the business they are in.

1
  • 2
    I can't endorse this advice. We need more crayon licences like we need holes in the head, and they're often very problematic (the above crayon licence, for example, makes no mention of whether the licence granted is exclusive or non-exclusive, and that's a really important distinction for your right to continue to reuse your own code, plus there's no disclaimer of warranty). If you're going this route, use a mainstream, well-understood free licence.
    – MadHatter
    Commented Sep 1 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.