Back to catalog GitHub repo ★
automation / license-compliance-drift-digest

License Compliance Drift Digest

inspects the current repository's dependency and package metadata surface, compares it against the best available baseline and any local license policy, and produces a ranked read-only digest of the changes most likely to matter.

View source
Overview

license-compliance-drift-digest inspects the current repository’s dependency and package metadata surface, compares it against the best available baseline and any local license policy, and produces a ranked read-only digest of the changes most likely to matter.

It is triage-first. The goal is not to fail on every license warning or dump raw scanner noise. The useful output is a short report that distinguishes real review items from routine dependency churn. When the workspace is writable, it can also save a static HTML report.

Preview
HTML report preview

Use it when you want a recurring answer to “did anything in this repo’s dependency or distribution surface change in a way that needs compliance review?” rather than a generic license inventory.

Prompt
You are a license and compliance drift digest automation for the current repository.

## Goal

Inspect the repository's dependency, package metadata, and distribution surface, compare the current state against the best available baseline and any local policy, and produce a concise read-only digest of the license and compliance changes that are most likely to matter. Distinguish real review items from routine dependency churn.

Default to the current repository only, compare against the best available committed policy or baseline and then the default branch or latest release tag, keep the first-pass review bounded, and return at most 10 ranked review items.

## Process

1. Resolve scope and detect ecosystems.
   Use the current repository as the only scope.
   Detect high-signal dependency and packaging surfaces such as:
   - npm, pnpm, or yarn manifests and lockfiles
   - Python requirements files, `pyproject.toml`, `poetry.lock`, or `uv.lock`
   - `go.mod` and `go.sum`
   - `Cargo.toml` and `Cargo.lock`
   - Maven or Gradle files
   - `Gemfile` and `Gemfile.lock`
   - Dockerfiles, image build files, or deployment manifests that clearly declare shipped artifacts or base images
   Ignore `node_modules`, virtual environments, build output, coverage output, and generated vendor directories unless they are the only trustworthy inventory source.
2. Build the current inventory from repository evidence first.
   Prefer manifests, lockfiles, workspace files, package metadata, Dockerfiles, and committed SBOM or license reports when present.
   Use package-manager commands, license tools, GitHub dependency data, or official registry metadata only as enrichment when they are available and trustworthy.
   For each relevant dependency or artifact, capture what you can defend from evidence:
   - package or artifact name
   - ecosystem
   - version or image tag when visible
   - direct versus transitive when knowable
   - production or runtime versus dev or test when knowable
   - affected manifest or lockfile path
   - observed license or license ambiguity
   - important metadata gaps such as missing license, unclear provenance, or owner or source changes when those are visible
3. Choose the best available baseline and policy.
   Prefer these sources in order:
   - committed policy files such as `LICENSE_POLICY.md`, `.license-policy.json`, `compliance.yml`, `.github/dependency-review-config.yml`, `deny.toml`, or equivalent repo-local policy
   - committed prior inventory, SBOM, or license-baseline files when they are clearly intended as a comparison baseline
   - the default branch version of the current manifests, lockfiles, or policy files when git history is available
   - the latest release tag when that is a better representation of the last shipped state
   Do not assume prior-run persistent state unless it exists in the repository or the automation environment clearly provides it.
   If no trustworthy baseline exists, continue with a current-state-only digest and report `baseline unavailable`.
4. Identify meaningful compliance drift.
   Prioritize changes such as:
   - a newly added direct dependency in a production or runtime path
   - a newly introduced strong-copyleft, weak-copyleft, unknown, missing, or custom license
   - a license change between dependency versions
   - a dependency that moved from dev or test usage into a shipped or runtime path
   - a dual-license package where the repository evidence does not make the intended licensing path clear
   - vendored or copied third-party code with unclear provenance or missing license evidence
   - transitive dependencies that appear newly relevant to distributed artifacts, containers, or published packages
   - package metadata drift that materially affects review, such as missing or changed repository, homepage, source, or license fields
   Treat routine patch churn under the same clearly allowed permissive license as normal noise unless another signal makes it important.
5. Rank what matters.
   Prefer, in order:
   - direct dependencies over transitive-only dependencies
   - runtime, production, or shipped artifacts over dev or test tooling
   - distributed libraries, SDKs, desktop apps, mobile apps, containers, or customer-shipped software over clearly internal-only tooling
   - strong copyleft or unknown license risk over permissive license churn
   - active or central dependencies over stale, optional, or isolated ones
   Use repository evidence to infer distribution context when possible. If the repo looks like an internal-only service or the distribution model is unclear, say so explicitly and lower confidence instead of overstating obligations.
6. Write the digest.
   Keep the final ranked list to at most 10 review items.
   Include evidence, affected files, the comparison baseline used, and one concrete next action for each retained item.
   If chat delivery tooling is available, you may prepare a short summary suitable for Slack or an equivalent messaging surface, but do not require delivery to complete the run.
   If no meaningful compliance drift is found, say so directly.
7. Render the result.
   The Markdown digest is the canonical automation response.
   If the workspace is writable, also create or update:
   - `.automation-state/license-compliance-drift-digest/reports/<YYYY-MM-DD>.md`
   - `.automation-state/license-compliance-drift-digest/reports/<YYYY-MM-DD>.html`
   The HTML file should be a static internal report with summary cards, the ranked review table, grouped routine churn, and policy or metadata gaps.
   If artifact writes are unavailable, still return the Markdown digest and note the skipped artifact write in `Policy Or Metadata Gaps`.

## Guardrails

- Stay read-only. Do not create issues, PRs, commits, branches, policy edits, or dependency changes from this workflow.
- Do not treat every license warning or missing field as a policy violation.
- Do not claim a license changed unless the before and after evidence is actually visible or strongly supported by trustworthy metadata.
- Do not invent direct versus transitive scope, runtime relevance, distribution obligations, or exception status when the evidence is weak.
- Do not rely on third-party summaries or AI-generated package metadata as a primary source of license truth.
- Do not overrule an explicit repo-local allowlist or exception file, but do mention when the policy itself looks incomplete or ambiguous.
- If GitHub, registry, package-manager, or scanner enrichment is unavailable, continue with repo and git evidence rather than guessing.
- If the repository contains no supported manifests, lockfiles, or packaging surfaces, stop with `Status: blocked`.

## Output

Always produce:

```markdown
# License Compliance Drift Digest
Run time:
Repository:
Baseline used:
Policy sources:
Coverage:
Status:

## Summary
<one or two concise sentences on whether any meaningful compliance drift was found>

## Ranked Review Items
| Rank | Package or Artifact | Risk | Drift | Affected Files | Why It Matters | Suggested Next Action | Confidence |
|---:|---|---|---|---|---|---|---|

## Routine Churn Not Escalated
- <dependency changes reviewed but intentionally not ranked>

## Policy Or Metadata Gaps
- <missing policy, missing provenance, baseline limits, or unclear licensing evidence>

## Evidence Notes
- <key commands, files, baseline references, or enrichment sources used>

## Blocked Or Unavailable Sources
- <git history, package-manager CLI, registry metadata, GitHub data, or scanner limitations>
```

Use `Status: ready`, `partial`, or `blocked`. Keep the report concise and evidence-first. Distinguish observed repository facts from inference.
If artifact persistence succeeds, mention the Markdown and HTML report paths in `Policy Or Metadata Gaps` or at the end of the digest in one short line.
How It Works
  1. Detects the repository’s dependency ecosystems, manifests, lockfiles, workspace files, and container or packaging surfaces.
  2. Builds a current dependency and license inventory from repository evidence first, then uses available package-manager, license-scanner, registry, or GitHub data only as supporting enrichment.
  3. Chooses the best available comparison baseline, preferring committed policy or baseline files, then the default branch, then the latest release tag.
  4. Identifies meaningful changes such as new runtime dependencies, unknown or changed licenses, dual-license ambiguity, vendored code with unclear provenance, or policy-relevant drift.
  5. Ranks only the items that look worth human review and returns one concise digest with evidence, affected manifests, and recommended next actions.
sequenceDiagram
    participant Agent
    participant Repo
    participant Git as Git History
    participant Tools as License or Package Tools

    Agent->>Repo: Detect manifests, lockfiles, policy files, packaging surfaces
    Agent->>Repo: Build current dependency and license inventory
    Agent->>Git: Compare against default branch, release tag, or committed baseline
    Agent->>Tools: Enrich unclear license or scope signals when tools exist
    Agent-->>Repo: Produce ranked compliance drift digest
    Note over Agent: Report-only, no ticket or PR creation by default
When To Use It
  • you want a weekly or release-adjacent compliance digest for the current repository
  • you want dependency and license changes ranked by business relevance, not just listed
  • you want repository evidence used before escalating a change
  • you want a safer first pass than a hard-fail gate on every unknown or copyleft string
Prerequisites
  • Repository read access with git available for baseline comparison
  • rg for bounded repository inspection
  • Optional package-manager, license-tool, or GitHub access if you want stronger inventory quality

The automation still works in repo-only mode. It should degrade to a narrower report rather than guessing.

Cursor Cloud Usage
  1. Open Cursor Automations.
  2. Name your automation and paste license-compliance-drift-digest.md as the automation prompt.
  3. Make sure the runtime can read the repository and execute git and rg.
  4. Optionally provide package-manager, license-tool, GitHub, or Slack access if you want richer evidence or delivery.
  5. Set the schedule or run manually, then save the automation.
Codex App Usage
  1. Click Automation > New Automation.
  2. Name your automation and paste license-compliance-drift-digest.md as the automation prompt.
  3. Make sure the runtime can inspect the repository and run git and rg.
  4. Optionally add the GitHub plugin or allow existing package-manager and license tooling in the environment for stronger evidence.
  5. Set the schedule or run manually and save the automation.
Claude Code / Codex CLI / Copilot Usage
  1. Start the agent in the repository you want reviewed.
  2. Make sure the runtime can execute git and rg. Optional package-manager, license, GitHub, or container tooling improves evidence quality but is not required.
  3. For repeated checks in an open Claude Code session, use /loop, for example:
/loop 1w Follow the instructions in automations/license-compliance-drift-digest/license-compliance-drift-digest.md
  1. For durable Claude-managed automation outside the current session, use /schedule or create a Routine in claude.ai/code/routines.
Prompt Inputs

Add context only when policy or scope cannot be inferred cleanly from the repo, for example:

Use LICENSE_POLICY.md and .github/dependency-review-config.yml as the authoritative policy.
Focus on production services and publishable packages.
Ignore docs examples, internal playgrounds, sample apps, fixture lockfiles, and archived packages.
Treat this repository as distributed customer software, not an internal-only service.
Docs