Skip to content

feat(agents): run agent git inside the sandbox with unsigned commits - #172

Merged
furedea merged 1 commit into
mainfrom
feat/run-agent-git-inside-the-sandbox
Oct 17, 2026
Merged

furedea merged 1 commit into
mainfrom
feat/run-agent-git-inside-the-sandbox

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Agent commits ran outside the Claude sandbox only because commit signing needs the SSH agent. That also ran repository git hooks outside the sandbox, so editing lefthook.yml, a script a hook calls, or build settings a hook tool reads could run code outside it at the next commit.

  • Claude env sets commit.gpgsign=false and tag.gpgsign=false for agent git only, next to core.fsmonitor=false.
  • git add, commit, push, and status are no longer excluded from the sandbox. git, its hooks, and push run sandboxed; push authenticates with the agent GitHub App token.
  • The git-workflow skill drops the call-shape restriction and states that agent commits are intentionally unsigned.
  • ADR-0035 records the decision: main stays signed because agent changes reach it through squash merges that GitHub signs, and the dangerous-Git guard refuses pushes to main.
  • The user own commits keep signing and hooks.

Closes #171

Verification

  • uv run --frozen pytest tests/agents: 1512 passed, including new tests that agent git is not excluded and that commit and tag signing are off.
  • lefthook run pre-commit inside the current sandbox: every check passed (ruff, ty, dprint, autocorrect, shfmt, actionlint, stylua, shellcheck, ls-lint).
  • commitlint inside the sandbox accepts the commit message.
  • After merge and switch: a chained git add, commit, and push should run without a prompt, unsigned, with lefthook running sandboxed, and pushed by the App bot.

🤖 Generated with Claude Code

Signing kept agent commits outside the sandbox, so repository hooks ran outside it too.

Agent commits and tags are now unsigned; git, its hooks, and push all run sandboxed.

Main stays signed because agent changes reach it through squash merges GitHub signs.

Closes #171

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@furedea
furedea merged commit c376c5a into main Oct 17, 2026
11 checks passed
@furedea
furedea deleted the feat/run-agent-git-inside-the-sandbox branch October 17, 2026 06:52
furedea added a commit that referenced this pull request Oct 17, 2026
)

Agent git now runs inside the Claude sandbox (#172). Verification showed
that git push -u pushes the branch but then fails to record the
upstream, because the sandbox protects .git/config, so the command exits
with an error and an agent can read it as a failed push.

- git-workflow delivery steps use git push origin <branch> and gh pr
create --head <branch>, and explain why -u is avoided.
- The command rules still allow -u, which stays valid outside the
sandbox.
- Separate commit: agent-harness flake input moves to 7d3ae3d (docs for
unsigned agent commits), committed at the user request.

## Verification

- tests/agents/test_workflow_skill_layout.py: 64 passed; autocorrect and
lefthook passed.
- This branch was pushed from inside the sandbox with git push origin
<branch> and no upstream error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@furedea-agent furedea-agent Bot mentioned this pull request Nov 12, 2026
1 task done
furedea added a commit that referenced this pull request Nov 12, 2026
agent-config 0.1.2(`3b3d9c5`)を取り込みます.#74 のモデル判定まわりの残りがすべて入ります.

| 取り込む変更(furedea/agent-config) | 中身 |
| --- | --- |
| #172 | 「ルールの見本のフォルダ」の判定を 1 か所にまとめる |
| #173 | jev-lint の子プロセスに `GIT_LITERAL_PATHSPECS=1` を渡す(#159) |
| #174 | 時間に頼らないタイムアウトのテスト(#171) |
| #175,#178 | Go と Rust のルールの穴と,境目の見本(#164) |
| #180 | 読み取り専用の GraphQL の問い合わせのあとに `jq` を付けてよくする |
| #177 | Stop のテストの行を,ランナーごとに 1 つの件数にまとめる(Rust は `312 passed` のように合計する)
|

- [x] `darwin-rebuild switch` で反映済み

ほかのセッションが main の古い `flake.lock` で反映すると,これらが取り消されます.早めにマージします.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Run agent git inside the sandbox with unsigned agent commits

1 participant