Skip to content

Harden Oz git credential setup: avoid persistent --global writes and plaintext credential files #11886

@jasonkeung

Description

@jasonkeung

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 persistent git config --global writes (the url.<host>.insteadOf SSH->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-credentials and ~/.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_GLOBAL to 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 --global config and plaintext credential files. This would eliminate both the persistent global writes and the plaintext token files across all execution paths.

References

Filed via Oz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentAgent workflows, conversations, prompts, cloud mode, and AI-specific UI.area:authAuthentication, login, SSO, session management, and account security.bugSomething isn't working.repro:highThe report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions