Skip to main content

Coaching — Source Code & Intellectual Property

Why it's risky

Proprietary source code is intellectual property. Sending it to a public LLM means:

  1. Loss of trade-secret status — under most jurisdictions (US Defend Trade Secrets Act, EU Trade Secrets Directive 2016/943), trade-secret protection requires "reasonable measures" to keep the code confidential. Pasting it into ChatGPT may legally void that status.
  2. License contamination — if the model returns code derived from your prompt mixed with training data, the output's licensing is ambiguous. You may be unable to use it commercially.
  3. Architecture leakage — even partial code reveals architecture decisions, internal APIs, security mechanisms, and customer-specific logic to a third party.
  4. Reproduction risk — large public models have been shown to memorise long verbatim sequences. Your competitor's prompt next year could complete with your code.

The Samsung incident (2023) — engineers leaked semiconductor source code via ChatGPT — is the canonical case study. Samsung banned the tool company-wide.

Examples

"This function in our recommendation engine is too slow — can you optimise?

def rank_products(user_id, session):
# 200 lines of proprietary scoring logic, including weights derived
# from 18 months of A/B testing
..."
"Refactor this billing module — pasting our entire Stripe integration
including custom retry logic and tax-jurisdiction handling..."

Best practice

  • Extract the pattern, not the code — describe the algorithm in pseudocode or natural language. "I have a scoring function that combines collaborative filtering with content embeddings; the rerank step is slow."
  • Anonymise identifiers — rename internal classes/functions to generic names before sending.
  • Strip business logic — keep the structural problem, drop the proprietary weights, thresholds, customer rules.
  • Use enterprise endpoints — for code-heavy work, route through a contracted endpoint (Azure OpenAI with no-train + EU residency, or self-hosted models).

Alternative phrasing

❌ Risky:

"Optimise this 300-line rank_products function from our production codebase: [full paste]"

✅ Safe:

"I have a Python function that scores 50K products per request by combining collaborative filtering scores with content-embedding cosine similarity. The bottleneck seems to be the per-product Python loop. Can you suggest a vectorised approach using NumPy/PyTorch?"

References