---
title: "Keep an open licence or a way out · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/how-to-choose/open-licence-or-exit
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep an open licence or a way out

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

For AI agents: [llms.txt](https://agentwranglers.se/llms.txt) is a short guide that sends you to the rules your problem needs, and [rules.json](https://agentwranglers.se/playbook/stack/rules.json) holds every rule of this playbook as JSON.

- Level: Recommended
- Chapter: [How to choose](https://agentwranglers.se/playbook/stack/how-to-choose)
- Rule: Use software under an OSI-approved open source licence, or a managed service that exports all your data in a documented format.
- How: 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](https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup/audit-dependencies) describes.
- 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.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
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

```python
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]
```

## Sources

- [OSI Approved Licenses](https://opensource.org/licenses)
- [SPDX License List](https://spdx.org/licenses/)

## Related rules

- [Lock and audit dependencies](https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup/audit-dependencies) in Security testing
- [Avoid MongoDB as the default database](https://agentwranglers.se/playbook/stack/databases-and-storage/avoid-mongodb-default) in Software choices
- [Avoid HashiCorp tools under the Business Source License for new work](https://agentwranglers.se/playbook/stack/delivery-and-infrastructure/avoid-busl-hashicorp) in Software choices

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/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.

- Previous: [Prefer open source and pay only when nothing open does the job](https://agentwranglers.se/playbook/stack/how-to-choose/prefer-open-source)
- Next: [Keep one tool for each job](https://agentwranglers.se/playbook/stack/how-to-choose/one-tool-per-job)
- [How to choose](https://agentwranglers.se/playbook/stack/how-to-choose)
