Agent Wranglers

STK-7Recommended

Keep an open licence or a way out

Use software under an OSI-approved open source licence, or a managed service that exports all your data in a documented format.

How to do it

Read the licence's SPDX identifier in the package metadata and compare it with the OSI list. Several popular projects have moved to source-available licences that limit hosting or competing use. A managed service is fine when you can leave, so test the export before you depend on it. Keep your own data in standard formats, such as SQL dumps, JSON and CSV. Check licences in the build, as the dependency licence rule in Lock and audit dependencies describes. Checking every dependency in CI is Check every dependency licence against an allow list in CI.

Examples

JavaScript example

const ALLOWED = new Set(['MIT', 'ISC', 'Apache-2.0', 'BSD-2-Clause', 'BSD-3-Clause', 'MPL-2.0', 'PostgreSQL']);
export const unapproved = packages => packages.filter(pkg => !ALLOWED.has(pkg.license));

Python example

ALLOWED = {"MIT", "ISC", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "MPL-2.0", "PostgreSQL"}

def unapproved(packages: list[dict]) -> list[dict]:
    return [pkg for pkg in packages if pkg["license"] not in ALLOWED]

How to check

A licence checker in the build passes with an allow list of OSI-approved licences. Every managed service has a tested export, run in the last 12 months.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/stack/how-to-choose/open-licence-or-exit">Agent Wranglers software choices playbook</a>. In code you write, add a comment next to it with the same link.