Skip to content

Close out the audit: gdsa --with-git-creds (4.4b), 3.6, 4.2b - #136

Merged
darribas merged 1 commit into
masterfrom
audit/4.4b-git-creds
Sep 10, 2026
Merged

darribas merged 1 commit into
masterfrom
audit/4.4b-git-creds

Conversation

@darribas

Copy link
Copy Markdown
Owner

Implements 4.4b per your call, closes 3.6, and records the #132 and #135 decisions.

--with-git-creds / -git

The agent subcommands no longer mount git/GitHub credentials unless asked. The flag gates one coherent bundle:

  • ~/.ssh (ro)
  • ~/.config/gh (rw)
  • GITHUB_TOKEN / GH_TOKEN env vars

Including the tokens is a judgement I made — gating the mounts while still forwarding a push-capable token would have left the same exfiltration surface open, so they move together. Say the word if you would rather the tokens always flow.

Not gated, deliberately:

Why
~/.gitconfig Identity, not a credential. Without it, commits made in the container carry the wrong author
~/.claude, ~/.copilot What make each harness work at all, and useless for pushing to your repos

Copilot CLI keeps its own auth in ~/.copilot, so gdsa copilot still functions without the GitHub set — that was the wrinkle I wanted to check before implementing.

gdsa shell is unchanged and keeps everything: no harness runs there, so the untrusted-agent argument does not apply and you are the one at the keyboard.

_ensure_gh_auth now no-ops when the creds will not be mounted — otherwise it would prompt you to authenticate a config the container never sees.

Two pre-existing bugs, found by documenting it

You asked for this in gdsa --help, which meant reading _usage:

_usage() { sed -n '2,15p' "$0" | ... }

A hardcoded line range. The header had grown past line 15, so OPENAI_HOST had never appeared in gdsa help — added in #117 and invisible ever since. The header also still said update pulls from main; the code says master. Both fixed, and _usage now prints through to the first non-comment line so it cannot truncate silently again.

Verified against a stubbed docker

Invocation Mounts
gdsa claude ~/.gitconfig only
gdsa claude -git + ~/.ssh, ~/.config/gh, GITHUB_TOKEN, GH_TOKEN
gdsa claude --with-git-creds same
gdsa copilot ~/.gitconfig only
gdsa shell ~/.gitconfig, ~/.ssh — unchanged
gdsa claude --bogus rejected, not treated as a path

shellcheck clean at --severity=style.

3.6 → ✅, and it was already done

The fix offered "document them as manual, or delete them". 2.11's README rewrite in #118 had already documented both — env/py/README.md:7 and env/r/README.md:8 each describe theirs as "a longer, exploratory notebook kept for manual runs". Nobody noticed that closed 3.6. Per your call both stay.

A near-miss worth flagging

My first draft of the #132 comment sat inside the backslash-continued pip install list. That silently truncates the command — bash -n accepts it and shellcheck does not flag it, so CI would have passed and only the build would have failed. Moved above the block, with a note not to move it back.

Tracker

32 of 37 done · 1 partial · 2 open · 2 closed. §5 rewritten: what is left is one workflow run (4.2b), one deferred decision (3.9), and three tracked issues (#126, #132, #135).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dihv4Jd8UL7AiizQ6w1kj9

4.4b -- the agent subcommands no longer mount git/GitHub credentials unless
asked. `--with-git-creds`, short form `-git`, gates one coherent bundle:
~/.ssh (ro), ~/.config/gh (rw), and the GITHUB_TOKEN/GH_TOKEN env vars.
Gating the mounts while still forwarding the tokens would have left the same
exfiltration surface open, so they move together.

Not gated, deliberately: ~/.gitconfig, which is identity rather than a
credential -- without it commits made in the container carry the wrong author;
and ~/.claude / ~/.copilot, which are what make each harness work at all and
are useless for pushing to a repo. Copilot CLI keeps its own auth in
~/.copilot, so it still functions without the GitHub set.

`gdsa shell` is unchanged and keeps the full set: no harness runs there, so
the untrusted-agent argument does not apply. _ensure_gh_auth now no-ops when
the creds will not be mounted, since it would otherwise prompt you to
authenticate a config the container never sees.

Documenting it in `gdsa help` surfaced two pre-existing bugs there: _usage
hardcoded `sed -n '2,15p'`, so OPENAI_HOST had never appeared in the help at
all, and the header still said `update` pulls from `main` where the code says
`master`. _usage now prints the header block through to its first non-comment
line, so it cannot silently truncate again.

Verified against a stubbed docker: default mounts only ~/.gitconfig; both
--with-git-creds and -git add ~/.ssh, ~/.config/gh and the two tokens; shell
is unchanged; an unknown option is rejected rather than treated as a path.

3.6 -- closed. The fix offered "document them or delete them", and 2.11's
README rewrite in #118 had already documented both notebooks as manual-only.
Maintainer confirms that is sufficient; both stay.

1.8 -- recorded as a deliberate deferral with issue #135, which sets out the
ordered steps and notes that purging docs/ from history is a separate
decision, not part of it.

#132 -- jupyterlab_myst kept on purpose; the reasoning now sits beside the
install line. Note the first draft of that comment sat INSIDE the
backslash-continued pip list, which silently truncates the command; bash -n
and shellcheck both accept it, and only a build would have caught it. Moved
above the block with a warning not to move it back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dihv4Jd8UL7AiizQ6w1kj9
@darribas
darribas merged commit ed9b956 into master Sep 10, 2026
6 checks passed
@darribas darribas changed the title gdsa --with-git-creds, off by default (audit 4.4b); close 3.6 Close out the audit: gdsa --with-git-creds (4.4b), 3.6, 4.2b Sep 10, 2026
@darribas

Copy link
Copy Markdown
Owner Author

Added scope (title updated): 4.2b closed by decision, moved to issue #137.

The reasoning, recorded on the finding rather than just in the issue: you build and test both architectures locally, which is strictly stronger than what image_build.yml would give —

Local image_build.yml
Architectures arm64 and amd64 amd64 only (no free Linux arm64 runner)
make test yes optional input
gds_code / gds_agent yes gds only

So a scheduled build would duplicate weaker coverage at the cost of runner minutes and a plausible recurring red X — the exact failure mode image_build.yml's own header warns about. Recorded as a considered no, not a gap.

#137 keeps the disk/time constraints, what would make it worth revisiting (local builds stopping, a contributor without the hardware, release cross-checks), and the cheap sequence if it ever is.

This clears the last partial: 33 of 37 done · 0 partial · 2 open · 2 closed. The two still open — 3.9 and 1.8 — are deliberate deferrals with their reasoning recorded, not pending work. §5 rewritten to say so.

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.

1 participant