# Licensing Source Code: Real Security Risks | SourceX

Canonical: https://refer.sourcex.si/questions/licensing-source-code-security-risk
Last updated: 2026-10-10

Licensing source code does carry security risk, but the serious risks are specific and controllable: credentials buried in git history, infrastructure details and code the company does not own. Scanning the full history and rotating secrets, excluding client and vendored repositories, stripping environment specifics and scoping by repository and date handle most of it before anything leaves.

## The honest answer on source code security risk

Yes, licensing a private codebase creates real security risk, and an engineering leader who raises it is doing their job. The risk is concentrated in a few artifacts: credentials committed to git history, infrastructure details that map the company's environment, and code the company does not own. Each has a known control, applied by the company's own engineers before anything is delivered.

The overstated risk is the idea that a licensee will rebuild the product from its history. AI developers want code history because it shows how software is written, reviewed, broken and fixed over years; the commercial value of a product also lives in its customers, data, operations and current roadmap, none of which a repository hands over.

## Which risks are real, and which are overstated?

The real risks come from what is buried in the history; the overstated ones come from picturing the licensee as a competitor.

| Concern | Verdict | Why | Control |
|---|---|---|---|
| API keys, tokens and passwords in old commits | Real | Deleting a file in a later commit leaves it readable in history | Scan the full history, rotate every credential found, exclude or rewrite affected history |
| Hostnames, IP ranges, cloud account IDs and deployment configs | Real | They describe the attack surface | Exclude infrastructure-as-code and deployment repositories, or redact environment specifics |
| Code written for clients | Real, as a rights issue | The client may own it under the contract | Exclude client repositories unless the contract clearly says otherwise |
| Vendored or licensed third-party code | Real, as a rights issue | Its license may bar redistribution | Exclude vendored directories and proprietary SDKs |
| Personal data in test fixtures, seed files and logs | Real | Customer or employee details hide in sample data | Scan for personal data and remove it under the agreed redaction rules |
| Known vulnerabilities in old code | Partly real | Old flaws may still run in production | Exclude security-sensitive modules and confirm fixes are deployed |
| A licensee cloning the product | Mostly overstated | History without customers, data and current code is not a business | Scope by date and leave the current core out if that helps |
| Developer names in commit metadata | Minor | Author fields identify employees | Pseudonymize authors if the redaction terms require it |

Ownership deserves a closer look. The US Copyright Office's [circular on works made for hire](https://www.copyright.gov/circs/circ30.pdf) explains that work an employee prepares within the scope of employment belongs to the employer, while work from outside contractors may not belong to the company unless a signed writing makes it so. Agencies and development shops face the reverse problem, covered in [who owns the code a software agency writes](/questions/who-owns-the-code-software-development-agency).

This is general information, not legal, tax or financial advice. Confirm ownership questions with the company's own counsel.

## How do the controls work before anything leaves the company?

The company runs these steps on its own systems. The partner who made the introduction never sees the code.

1. **List every repository.** Mark each as the company's own, built for a client, or containing third-party code. Client and vendored material comes out first.
2. **Scope by repository and date.** Choose which repositories and which years are in scope. Retired products and older history are often easier to license than the current core.
3. **Scan the full history for secrets.** Run a secrets scanner across every commit, branch and tag, not just the latest snapshot. The guide to [scanning git history for secrets](/guides/scan-git-history-for-secrets) walks through it.
4. **Rotate before you redact.** Treat every credential found as compromised and rotate it, whether or not the license goes ahead.
5. **Strip infrastructure specifics.** Remove or exclude deployment configs, internal hostnames and environment files.
6. **Write the redaction rules into the deal.** The company and SourceX settle de-identification and redaction requirements before work begins, and code moves only after an executed agreement and the company's authorization.

Partners who want a quick fit test before raising any of this can run the [company fit checker](/tools/company-fit-checker), which is a preliminary, non-binding screen.

## What to say to a CTO who raises it

> "You're right to ask. The real exposure is secrets in history, infrastructure details and client code, and all three get handled before anything moves: you choose the repositories and years, your team scans and rotates, and the redaction rules are written into the agreement. Nothing leaves without your sign-off."

Then stop. Do not offer to look at the repositories yourself; partners never handle the records.

## What if the security concern is valid?

Sometimes it is, and the right answer is to stop or narrow the scope:

- The team cannot reliably separate its own code from client code.
- Credentials are hard-coded in legacy systems that are still running and cannot be rotated soon.
- Code was written under government or defense contracts with their own data-handling restrictions, which need counsel before anything else.
- The codebase has already been licensed for AI training.

A narrow license, such as one retired product's history, can still work when the full monorepo cannot. The [red flags checklist](/resources/data-licensing-red-flags) covers the broader stop signs, and the page on [who sees the data during a deal](/questions/who-has-access-to-data-in-licensing-deal) answers the question most CTOs ask next.

## Next step

If the engineering lead is comfortable with the controls, [register as a partner](/register) and make the introduction, or have the company apply at [sourcex.si/apply](https://sourcex.si/apply) with your referral link.

## Sources

- https://www.copyright.gov/circs/circ30.pdf
