You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spec/construct-agents-md.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ not override a project-level `AGENTS.md` or `CLAUDE.md` in the workspace.
90
90
91
91
| File | Change |
92
92
|---|---|
93
-
|`internal/runner/runner.go`|`CONSTRUCT=1` always injected; `generatedEntrypoint()` always writes `~/.config/opencode/AGENTS.md`, appending port rules only when `CONSTRUCT_PORTS` is set; also writes git identity hook and sets `core.hooksPath` (see `docs/spec/git-identity.md`)|
93
+
|`internal/runner/runner.go`|`CONSTRUCT=1` always injected; `generatedEntrypoint()` always writes `~/.config/opencode/AGENTS.md`, appending port rules only when `CONSTRUCT_PORTS` is set |
94
94
|`internal/runner/runner_test.go`| Tests updated to reflect always-present `CONSTRUCT=1` and always-present `AGENTS.md`|
95
95
|`docs/spec/construct-agents-md.md`| This document |
The hook appends a `Generated by construct` trailer to every commit message,
79
-
following the git trailer convention (a blank line separates the body from the
80
-
trailer block). The hook is idempotent: it checks for the presence of the
81
-
trailer before appending, so amend and rebase do not produce duplicates.
82
-
83
-
Resulting commit message format:
84
-
85
-
```
86
-
feat: add user login
87
-
88
-
Implement OAuth2 flow with token refresh.
89
-
90
-
Generated by construct
91
-
```
92
-
93
-
### 4. Scope
61
+
### 3. Scope
94
62
95
63
This is a runner-level change. It applies to all tools.
96
64
@@ -104,7 +72,7 @@ No files are written to the host or to the workspace repo.
104
72
105
73
| File | Change |
106
74
|---|---|
107
-
|`internal/runner/runner.go`|`hostGitIdentity()`: resolves author/committer separately, honouring host env vars with committer falling back to author; `buildRunArgs`: injects resolved values; `generatedEntrypoint()`: writes `/home/agent/.githooks/commit-msg` and sets `git config --global core.hooksPath`|
75
+
|`internal/runner/runner.go`|`hostGitIdentity()`: resolves author/committer separately, honouring host env vars with committer falling back to author; `buildRunArgs`: injects resolved values |
Copy file name to clipboardExpand all lines: docs/threat-model.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,7 @@ The agent does **not** have access to:
179
179
|**Mitigation**| No git credential helper is wired up by construct. The agent would have to discover the token from its environment and construct the remote URL manually (e.g. `https://x-access-token:$TOKEN@github.com/...`). This is non-trivial but not difficult for a capable model. SSH keys are **not** mounted into the container, so SSH-based remotes are unreachable. |
180
180
|**Residual risk**| No token with git push scope is injected by default. If a user supplies a GitHub token via `config set`, the agent could use it for HTTPS git operations. |
181
181
|**Recommendation**| Use a token scoped to the minimum required permissions. A GitHub fine-grained PAT with read-only or repo-specific access limits blast radius. Avoid using tokens that have push access to repositories beyond the one you are actively working on. Note: recommending SSH remotes is **not** a useful mitigation here — SSH keys are not mounted, so the attack surface is HTTPS+token only. |
182
-
|**Attribution note**| construct injects the host user's real git identity (`user.name` / `user.email`) as `GIT_AUTHOR_*` and `GIT_COMMITTER_*`. Any commits the agent makes — including any it pushes — will carry the developer's real name and email, plus a `Generated by construct` trailer. Users should be aware that agent-authored commits are attributable to them in git history. |
182
+
|**Attribution note**| construct injects the host user's real git identity (`user.name` / `user.email`) as `GIT_AUTHOR_*` and `GIT_COMMITTER_*`. Any commits the agent makes — including any it pushes — will carry the developer's real name and email. Users should be aware that agent-authored commits are attributable to them in git history. |
183
183
|**vs. host baseline**| On the host, the agent has access to the user's full git credential store (`~/.gitconfig`, credential helper, SSH keys, `~/.netrc`), giving push access to every repository the user can reach. construct limits this to explicitly injected tokens only. |
0 commit comments