Skip to content

Add automated dependency and code scanning (Dependabot, pip-audit, CodeQL) #205

Description

@dgenio

Summary

Introduce supply-chain and static-analysis automation: Dependabot (or equivalent)
for pip and GitHub Actions version updates, a pip-audit step in CI for known-vuln
detection in the dependency tree, and CodeQL scanning for the Python source.

Why this matters

A security kernel is held to a higher supply-chain standard than the average
library: adopters will (and should) check whether the project scans itself. The
runtime dependency set is admirably small (httpx, pydantic), but extras pull in
larger trees (mcp, otel, yaml, tiktoken), CI actions are a moving dependency, and
none of it is monitored today. These are low-effort, high-signal controls that also
future-proof releases (a known-vulnerable pin caught before publish, not after).

Current evidence

  • No .github/dependabot.yml; no pip-audit/CodeQL/security-scanning workflow exists (only ci.yml and publish.yml).
  • ci.yml uses floating action tags (actions/checkout@v4) — update automation pairs with pinning (ISSUE 56).
  • pyproject.toml extras: mcp, otel, policy, tiktoken — real third-party trees beyond the minimal core.

External context

Dependabot/pip-audit/CodeQL are the standard GitHub-native security baseline (OpenSSF
Scorecard checks measure exactly these).

Proposed implementation

  1. .github/dependabot.yml: weekly pip (with grouped minor/patch updates to limit
    noise) + github-actions ecosystems.
  2. CI step (or separate workflow): pip-audit over the dev environment; decide
    policy for failures (block on HIGH+, warn otherwise) and document it.
  3. CodeQL workflow with the Python query pack on PRs + schedule.
  4. Document the security automation in SECURITY.md when [Community] Add issue templates, SECURITY.md, CODE_OF_CONDUCT, and a curated good-first-issue set #144 lands (or in README
    until then) — neutral wording.

AI-agent execution notes

Acceptance criteria

  • Dependabot opens grouped update PRs for pip and actions ecosystems.
  • CI fails (per documented policy) on known-vulnerable dependencies.
  • CodeQL runs on PRs and a schedule with the Python pack.

Test plan

Verify first Dependabot PRs, a seeded pip-audit failure in a branch, and a CodeQL
run completing. Run make ci.

Documentation plan

README security section note (until SECURITY.md exists via #144); CHANGELOG Added (CI).

Migration and compatibility notes

Not expected to require migration.

Risks and tradeoffs

Update-PR noise (grouping mitigates); CodeQL minutes on a small repo are negligible.
Failure-policy tuning needs one iteration to avoid blocking unrelated work.

Suggested labels

security, reliability, contributor-experience

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions