Skip to content

Per-run agent credential copies instead of read-write host credential mounts #3759

Done

Description

@integry

Provider OAuth/config dirs (~/.claude, ~/.codex, ~/.gemini, OpenCode, Vibe) are bind-mounted read-write into every agent container so CLIs can refresh tokens. This lets any agent run read or modify the host's credential store and blocks remote runtimes (no shared filesystem).

Acceptance:

  • A credential broker materialises a per-run copy containing only the files a provider needs, mounted/injected into the run.
  • After the run, only refreshed token files are written back to the canonical store, with conflict handling (newer-wins + lock) for concurrent runs.
  • Works for DockerRuntime now (copy into a per-run temp dir) and exposes a transport-neutral API (list of files in/out) remote runtimes can use.
  • API-key providers can be supplied via env/secret instead of files.
  • Docs: execution-safety.md updated; regression tests for token refresh round-trip per provider.

Implementation

Add packages/core/src/agents/credentials/{broker.ts,providerManifests.ts}. Each provider declares required credential files and which are refresh-writable. DockerRuntime mounts the per-run copy; on completion broker diffs and writes back under a file lock. Keep a feature flag to fall back to the legacy direct mount during rollout.

Activity

  1. propr-dev commented on Nov 24, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3759/claude-opus-5-5-per-run-agent-credential--20261124-0506-bul
    • Base Branch: 3758-epic-runtime-abstraction-sc0
    • Worktree: issue-3759-20261124-0506-claude-opus-5-5-bul

    🔍 Track Task Execution

  2. ScDor commented on Nov 28, 2026

    @ScDor

    Host Codex profile ownership changes on ProPR 0.9.3

    I observed a host-side permission failure on Ubuntu 24.04 with Docker, ProPR CLI 0.9.3 and propr/app:0.9.3. The API, worker, and indexing worker all had read-write bind mounts of the same host ~/.codex directory used by interactive Codex.

    Steps to reproduce with a disposable host user and Codex profile:

    1. Sign in to Codex under the host user. Confirm interactive Codex works and record the owner with stat -c '%u:%g %a' "$HOME/.codex".
    2. Configure a ProPR 0.9.3 stack so that propr-api, propr-worker, and propr-indexing-worker each bind-mount that same host profile read-write. Start the stack and run a Codex-backed Docker job.
    3. Recheck the host profile owner and launch interactive Codex again.

    Expected behavior: the host profile stays owned by its original account and interactive Codex continues to work.

    Observed behavior: the profile ownership repeatedly changed from UID/GID 1002:1002 (interactive account) to 1000:1000 (a different local account). Interactive Codex then failed with Permission denied. Stopping ProPR and restoring the original ownership recovered interactive access. I did not isolate which container or code path performed the ownership change.

    Verified workaround: remove the interactive ~/.codex bind mounts from all three services, use ProPR's managed agent credentials store (~/.propr/agent-credentials), and authorize Codex there with a separate subscription login session. Codex-backed worker jobs and automatic reviews then completed with subscription authentication. The interactive directory metadata stayed stable in the isolation checks, and the key-file content checks matched across the review verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions