ADR 0019: Python dependency security, pip-audit, and pinning policy

Ratification

Adopted under ADR 0018. Link the discussion Issue and merge PR when they exist. If not, use git history as the record.

Context

Why this matters: Applications depend on thousands of lines of other people’s code. Unpinned installs mean “works on my machine” might pull a different transitive version tomorrow. Known CVEs in public packages are tracked in advisory databases; scanning turns that signal into a failing check instead of a surprise in production.

We pin exact versions in requirements.txt, run pip-audit in Make and CI, and treat severity levels with a written exception path when fixes cannot land immediately—aligned with common supply-chain guidance (for example OWASP and NIST SSDF).

Decision

Pinning and single source of truth

Vulnerability scanning with pip-audit

Severity and response expectations

pip-audit may report vulnerabilities in dev-only tools (linters, test runners). Apply the same severity logic; if a fix would be disruptive, use the exception process instead of ignoring the report silently.

Exception process

Upgrade cadence

Scope

Alternatives considered

  1. Safety / other scanners only.
    • Pros: historical familiarity in some teams.
    • Cons: pip-audit aligns with PyPA and OSV; fewer surprises for Python-centric workflows.
  2. Poetry or uv lockfiles without migrating the repo.
    • Pros: richer dependency resolution metadata.
    • Cons: would duplicate or replace the current requirements.txt-centric Makefile and CI; defer until a dedicated migration ADR.

Consequences

Positive

Trade-offs

Compatibility and migration

Implementation plan

  1. Add pip-audit to the project’s install surface (for example requirements.txt or a documented CI install step).
  2. Implement make deps-audit and document it next to other verify targets.
  3. Run pip-audit in CI after pip install -r requirements.txt; fail on unmitigated Critical/High per team policy above.
  4. Reference this ADR from contributor or engineering-practices documentation.

Validation

References

Page history

Date Change Author
Added Page history section (repository baseline). Ivan Boyarkin