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/developer-experience/copilots.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,4 +68,8 @@ Chat AI tools are only as good as the prompts you give them. The quality and app
68
68
69
69
## Considerations
70
70
71
-
It is important when using AI tools to understand how the data (including private or commercial code) might be used by the system. Read more about how GitHub Copilot handles your data and code [here](https://resources.github.com/copilot-for-business/).
71
+
If you make use of AI tools, consider the following:
72
+
73
+
* It is important when using AI tools to understand how the data (including private or commercial code) might be used by the system. Read more about how GitHub Copilot handles your data and code [here](https://resources.github.com/copilot-for-business/).
74
+
75
+
* You may want to consider how you will handle [attribution of AI-generated code](../source-control/git-guidance/README.md#ai-assisted-code-authorship) for accountability, code review, and auditing purposes.
When using AI tools to generate code, it can be beneficial to maintain transparency about authorship for accountability, code review, and auditing purposes. This can be done easily by using [Git trailers](https://git-scm.com/docs/git-interpret-trailers) that append structured metadata to the end of commit messages.
276
+
277
+
#### Agentic Code Authorship
278
+
279
+
When using agentic AI tools to generate code, such as the GitHub Coding Agent feature where a GitHub issue (such as a story or task) can be assigned to a software engineering bot that analyzes the request, creates a branch, writes commits, and opens a pull request, authorship is typically attributed using tool-specific mechanisms that follow conventions similar to pair programming. For example, the GitHub Coding Agent creates its commits using the agent as an author with the supervising person acknowledged using the `Co-authored-by` trailer in the commit message. This allows AI-generated code to be attributed to the agent while still giving credit (and accountability) to the person who supervised or initiated the task.
280
+
281
+
#### IDE Assistant Attribution
282
+
283
+
When using an AI coding assistant inside an IDE, such as GitHub Copilot in Visual Studio Code, consider providing attribution in cases when the commit consists of primarily AI-generated code. This might occur when:
284
+
285
+
* More than 50% of the lines in the commit were generated by AI
286
+
* The AI provided the core logic or algorithmic approach
287
+
* Substantial code blocks were accepted from AI suggestions
288
+
289
+
This can be done by appending one or more custom trailers in the commit message, such as:
290
+
291
+
```text
292
+
Assistant-model: GPT-4o
293
+
```
294
+
295
+
Because most Git tooling expects `Co-authored-by` trailers to be formatted as email addresses, you should use a different trailer key to avoid confusion and to distinguish authorship from assistance.
296
+
297
+
Trailers can be added manually at the end of a commit message, or by using the `git commit`command with the `--trailer` option:
Trailers can be displayed using the [pretty formats](https://git-scm.com/docs/pretty-formats#Documentation/pretty-formats.txt-trailersoptions) option to `git log` command. For example, for a formatted history showing the hash, author name, and assistant models used for each commit:
A local git repository can have one or more backing remote repositories. You can list the remote repositories using `git remote` - by default, the remote repository you cloned from will be called origin
0 commit comments