Skip to content

fix(filters): always drop .netrc/_netrc credential files from lineage#135

Open
christophergeyer wants to merge 2 commits into
mainfrom
fix/filter-credential-files
Open

fix(filters): always drop .netrc/_netrc credential files from lineage#135
christophergeyer wants to merge 2 commits into
mainfrom
fix/filter-credential-files

Conversation

@christophergeyer
Copy link
Copy Markdown
Member

What

Always filter .netrc / _netrc from provenance — reads and writes — regardless of filter config. These hold machine login tokens (wandb, huggingface, curl/requests) and are not reproducibility-relevant.

Why

A nanochat e2e run on Lambda (verifying #133 + #134 against dev) surfaced ~/.netrc as a tracked artifact: wandb reads it at startup, so the tracer captured it. Only the path+hash reach GLaaS (not contents), but a credential file appearing in lineage is undesirable and confusing. It belongs in the same always-dropped bucket as .git metadata and roar-internal files — not gated behind filters.* config (a user clearing ignore_paths must not re-expose it).

Change

New credential_files filter category (parallel to roar_internal / git_metadata):

@staticmethod
def _is_credential_file(path: str) -> bool:
    basename = path.rsplit("/", 1)[-1]
    return basename in (".netrc", "_netrc")

Applied in both categorize_read (inputs) and the written-files loop (outputs). Surfaced in run-report verbosity output like the other categories.

Tests

  • test_file_filter.py: .netrc and _netrc dropped from reads + writes.
  • test_verbosity.py: credential-files count rendered in the report.

Scope

Deliberately minimal — just the netrc family (the observed leak). Follow-ups could add .aws/credentials, .ssh/id_*, .config/gcloud/, etc., but those merit their own discussion (some are already covered by system-path filters; SSH keys are trickier since pubkeys are sometimes legitimately tracked).

🤖 Generated with Claude Code

chrisgeyertreqs and others added 2 commits May 27, 2026 19:07
Credential files (.netrc, _netrc) were being recorded as run inputs whenever
a tool (curl, requests, huggingface_hub, wandb) read them for auth — e.g. the
nanochat ClimbMix download recorded /home/ubuntu/.netrc as an input. They hold
secrets, not reproducibility-relevant data.

Filter them from inputs and outputs unconditionally, mirroring _is_git_metadata,
i.e. independent of filters.ignore_paths so a user clearing that list cannot
re-expose them. Adds a credential_files filter category (count + "creds" label).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants