编写企业开源依赖使用政策
梳理许可证分级、审批流程与依赖清单责任,起草内部政策及落地计划,提示需法务确认。
完整提示词
<context>
Open-source policies fail in two opposite ways. Some require legal approval for every package, so engineers route around them and nobody knows what is in the product. Others say nothing until an acquisition's due diligence or a customer's SBOM request finds AGPL code in the shipped app. A policy that works sorts licences into a few categories whose meaning depends on how the company ships (AGPL in an internal tool differs from AGPL in a SaaS backend or a distributed app), makes the common case automatic, and saves human review for the cases that matter: strong copyleft in distributed products, network copyleft in services, source-available or custom licences, no licence at all, and copying code snippets. Licence is only half: abandoned, single-maintainer or newly published packages carry security and supply-chain risk, and an automated check in CI is what keeps the inventory true.
{{> guardrails/professional-limits}}
Company:
<company>
{{company}}
</company>
{{#current_state}}Current state: {{current_state}}{{/current_state}}
</context>
<task>
1. State three to five principles (use open source by default, know what ships, review only where risk is real, give back where it helps).
2. Define licence categories as a table by shipping model: allowed without review, allowed with conditions (for example notice duties or no modification), needs review, and not allowed. Fill it for the shipping models this company actually has, with common SPDX ids as examples.
3. List review triggers beyond licence: no licence, source-available or custom terms, dual licences, copying snippets from other projects or Q&A sites, AI-generated code that reproduces existing code, licence changes on upgrade, and packages that bundle other code.
4. Design the approval route: who reviews what, inside what time, where requests are logged, and what an engineer does while waiting. Keep it to the minimum the company's size supports.
5. Set dependency health expectations: maintenance signals, how new and unknown packages are vetted, pinning and lockfiles, and what happens when a dependency is abandoned.
6. Set inventory and SBOM duties: a CI licence and vulnerability check, which SBOM format, who produces it for customers, and how notices are shipped.
7. Write the policy text ready to publish internally, one to two pages.
8. Plan the rollout: a first scan of existing products, handling of findings already in production, tooling, and communication to engineers.
</task>
<constraints>
- Do not classify a licence as permitted for a shipping model without stating the reason; where the treatment is debated, put it in needs review.
- Do not invent laws, regulations or customer contract terms; mention that specific regulations or contracts may add duties and should be checked.
- Keep the review load proportionate: if the policy would send more than a small share of new dependencies to manual review, simplify it.
- The final classification of licences and the policy text should be approved by the company's legal counsel; say so once.
</constraints>
<output_format>
Use the contract's section headings in order. Licence categories as a table: Licence type | Examples | Internal tools | SaaS backend | Distributed product. Policy text in a fenced markdown block. Rollout as a numbered list with owners as roles.
</output_format>可替换内容
- {{> guardrails/professional-limits}}
- {{company}}
- {{#current_state}}
- {{current_state}}
- {{/current_state}}
分类与标签
办公效率、开源治理、内部制度、许可证审查、依赖管理