Isolate autonomous release subprocesses from parent credentials #333

Closed
opened 2026-08-08 19:29:06 +00:00 by timmy · 0 comments
Owner

Problem

The release worker starts coding-agent, test, and Git subprocesses from a copy of the complete parent environment. The parent must contain a write-capable GITEA_TOKEN, so issue-influenced code and repository-controlled tests can read release credentials even though commands now avoid shell interpolation.

Vertical slice

Introduce explicit subprocess environment policies: coding receives only a minimal runtime environment, an operator-approved allowlist, and the five RELEASE_* context values; tests receive only the minimal runtime environment; Git receives only the minimal environment needed for credential-helper operation. Gitea API authentication remains parent-process-only. Document the boundary and configuration.

Acceptance criteria

  • A sentinel GITEA_TOKEN and unrelated parent secrets are invisible to coding-agent and test subprocesses.
  • Coding receives the five existing RELEASE_* values. Tests receive no issue context.
  • An explicit agent environment allowlist passes only valid requested names; reserved or malformed names fail before claim.
  • Git, timeout, failure, and durable resume flows preserve behavior.
  • Focused tests and the full suite pass.

Non-duplication evidence

All 169 historical issue titles and recent origin/main commits were reviewed. #307 removed shell interpretation but intentionally retained os.environ.copy() in ShellRunner; #329 and #331 cover deadlines and checkpoint resume. No issue or recent commit isolates inherited subprocess credentials.

## Problem The release worker starts coding-agent, test, and Git subprocesses from a copy of the complete parent environment. The parent must contain a write-capable `GITEA_TOKEN`, so issue-influenced code and repository-controlled tests can read release credentials even though commands now avoid shell interpolation. ## Vertical slice Introduce explicit subprocess environment policies: coding receives only a minimal runtime environment, an operator-approved allowlist, and the five `RELEASE_*` context values; tests receive only the minimal runtime environment; Git receives only the minimal environment needed for credential-helper operation. Gitea API authentication remains parent-process-only. Document the boundary and configuration. ## Acceptance criteria - A sentinel `GITEA_TOKEN` and unrelated parent secrets are invisible to coding-agent and test subprocesses. - Coding receives the five existing `RELEASE_*` values. Tests receive no issue context. - An explicit agent environment allowlist passes only valid requested names; reserved or malformed names fail before claim. - Git, timeout, failure, and durable resume flows preserve behavior. - Focused tests and the full suite pass. ## Non-duplication evidence All 169 historical issue titles and recent `origin/main` commits were reviewed. #307 removed shell interpretation but intentionally retained `os.environ.copy()` in `ShellRunner`; #329 and #331 cover deadlines and checkpoint resume. No issue or recent commit isolates inherited subprocess credentials.
timmy self-assigned this 2026-08-08 19:29:06 +00:00
timmy closed this issue 2026-08-08 19:36:01 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#333
No description provided.