Other people's code

A license and private code do not become yours because a chat retold them.

A model may reproduce someone else's fragment close to the source. If you put that into a product, the license obligations do not go away: copyright, copyleft, a ban on using a piece of a private repository that someone once fed into training or a chat. "An assistant wrote it for me" is a weak defence.

Do not feed the model code you are not allowed to show outside: a customer's private product, an unpublished patch, material under NDA. An assistant is acceptable for such code only where the contract and the service configuration explicitly allow it. By default, assume they do not.

A request like "write it the way project X does, here is their private repository" is a bad setup even if the repository is yours at work and the chat is a corporate one. First find out whether that code may leave its perimeter. A public example with a compatible license is simpler and more honest.

If an answer looks too familiar, word for word like an article or a well-known file, stop and find the source. A short, common idiom of the language is fine. A page of someone else's module rewritten almost in full is a reason to throw the draft away and write your own small piece.

Practice

  1. Whose code is in the answer

    The answer repeats someone else's file almost word for word. What do you do before committing?

    • Merge it, the model wrote it
    • Stop and check the source
    • Rename the functions and keep the text
    • Ask the model whether it is allowed and trust the answer
  2. Private code

    By default, may code under NDA be pasted into a public chat? Answer yes or no.

  3. What is relatively safer

    Select the safer things to lean on.

    • A short example you wrote yourself
    • A customer's private repository without permission
    • A public example with a compatible license
    • An almost complete foreign file with no source given