-
Notifications
You must be signed in to change notification settings - Fork 5k
Harden Oz git credential setup: avoid persistent --global writes and plaintext credential files #11886
Copy link
Copy link
Open
Labels
area:agentAgent workflows, conversations, prompts, cloud mode, and AI-specific UI.Agent workflows, conversations, prompts, cloud mode, and AI-specific UI.area:authAuthentication, login, SSO, session management, and account security.Authentication, login, SSO, session management, and account security.bugSomething isn't working.Something isn't working.repro:highThe report includes enough evidence that the issue appears highly reproducible.The report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.Issue has received an initial automated triage pass.
Metadata
Metadata
Assignees
Labels
area:agentAgent workflows, conversations, prompts, cloud mode, and AI-specific UI.Agent workflows, conversations, prompts, cloud mode, and AI-specific UI.area:authAuthentication, login, SSO, session management, and account security.Authentication, login, SSO, session management, and account security.bugSomething isn't working.Something isn't working.repro:highThe report includes enough evidence that the issue appears highly reproducible.The report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.Issue has received an initial automated triage pass.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
The Oz cloud-agent driver configures git/GitHub auth at runtime in
app/src/ai/agent_sdk/driver/git_credentials.rs.setup_git_config()issues persistentgit config --globalwrites (theurl.<host>.insteadOfSSH->HTTPS rewrites,credential.helper store, and user identity), and the module also writes plaintext credential files directly under $HOME (~/.git-credentials,~/.config/gh/hosts.yml). These are documented as one-time config with no cleanup.Problem
On host-based / self-hosted execution (the oz-agent-worker direct backend, e.g. oz-local), these writes land in and persist in the real home directory: the insteadOf rewrites mutate
~/.gitconfig, and short-lived tokens are written in plaintext to~/.git-credentialsand~/.config/gh/hosts.yml. In container backends this is harmless (ephemeral home), but on a host it pollutes and can clobber the real git/gh configuration. After warpdotdev/warp-agent-docker#109 lands, the driver becomes the sole writer of these entries across all backends.Mitigation already in place
oz-agent-worker now sets
GIT_CONFIG_GLOBALto a per-task file for the direct backend, keeping the git config writes (including insteadOf) out of the real~/.gitconfig: warpdotdev/oz-agent-worker#77. That mitigation intentionally does not cover the plaintext credential files, which still follow$HOME.Proposed hardening
Move runtime auth to a git credential-helper mode (per the REMOTE-1370 specs) so the driver supplies/refreshes tokens on demand instead of writing persistent
--globalconfig and plaintext credential files. This would eliminate both the persistent global writes and the plaintext token files across all execution paths.References
app/src/ai/agent_sdk/driver/git_credentials.rs(setup_git_config,write_git_credentials)Filed via Oz.