Skip to content

Commit b0f8255

Browse files
authored
Merge pull request #36381 from github/repo-sync
Repo sync
2 parents 0e3ae4b + a564cb9 commit b0f8255

18 files changed

+451
-32
lines changed

Diff for: content/admin/data-residency/feature-overview-for-github-enterprise-cloud-with-data-residency.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The following features are currently unavailable on {% data variables.enterprise
2929
| {% data variables.product.prodname_importer %} | Currently unavailable | [AUTOTITLE](/migrations/importing-source-code/using-github-importer/about-github-importer) |
3030
| {% data variables.product.prodname_copilot %} Workspaces | Currently unavailable | N/A |
3131
| {% data variables.product.prodname_copilot_extensions %} | Currently unavailable | [AUTOTITLE](/copilot/using-github-copilot/using-extensions-to-integrate-external-tools-with-copilot-chat) |
32+
| {% data variables.product.prodname_copilot_short %} Metrics API | Currently unavailable | [AUTOTITLE](/rest/copilot/copilot-metrics) |
3233
| Interactive maps | Currently can't use GeoJSON/TopoJSON syntax to create interactive maps. | [AUTOTITLE](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-geojson-and-topojson-maps) |
3334
| Usage metrics for {% data variables.product.prodname_actions %} | Currently unavailable | [AUTOTITLE](/organizations/collaborating-with-groups-in-organizations/viewing-usage-metrics-for-github-actions) |
3435
| Restricting {% data variables.product.prodname_actions %} policies to verified creators | Currently unavailable | [AUTOTITLE](/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#allow-enterprise-and-select-non-enterprise-actions-and-reusable-workflows) |

Diff for: content/copilot/building-copilot-extensions/about-building-copilot-extensions.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ shortTitle: About building Extensions
99
type: overview
1010
---
1111

12-
{% data reusables.copilot.copilot-extensions.public-preview-note %}
13-
1412
## About {% data variables.product.prodname_copilot_extensions_short %}
1513

1614
{% data variables.product.prodname_copilot_extensions_short %} are integrations that expand the functionality of {% data variables.product.prodname_copilot_chat_short %}, allowing developers to bring external tools, services, and custom behaviors into the Chat experience. You can use {% data variables.product.prodname_copilot_extensions_short %} to extend the capabilities of {% data variables.product.prodname_copilot_chat_short %} in a variety of ways, including:
@@ -53,8 +51,6 @@ For more information about skillsets, see [AUTOTITLE](/copilot/building-copilot-
5351

5452
### About context passing
5553

56-
{% data reusables.copilot.copilot-extensions.context-passing-public-preview-note %}
57-
5854
You can allow your {% data variables.product.prodname_copilot_extension_short %} to receive context from the editor, such as the currently opened file, by enabling the **Read-only** access level for the "{% data variables.product.prodname_copilot_short %} Editor Context" permission in your {% data variables.product.prodname_github_app %} settings. See step 10 of [Configuring your {% data variables.product.prodname_github_app %}](/copilot/building-copilot-extensions/creating-a-copilot-extension/configuring-your-github-app-for-your-copilot-extension#configuring-your-github-app).
5955

6056
The {% data variables.product.prodname_copilot_extensibility_platform %} automatically handles messaging when implicit and explicit context is unavailable or unauthorized. To enable context passing, you are required to request permissions from users. To enable context passing, you are required to:
@@ -68,6 +64,8 @@ The {% data variables.product.prodname_copilot_extensibility_platform %} automat
6864

6965
Context passing respects content exclusions, which refers to any files listed in your context exclusion settings, including files that begin with `.`.
7066

67+
For more information about context passing, see [AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/context-passing-for-your-agent).
68+
7169
### Resources for building {% data variables.product.prodname_copilot_extensions %}
7270

7371
{% data variables.product.company_short %} provides a comprehensive toolkit for extension builders, with code samples, a CLI debugging tool, quickstart SDKs, and a user feedback repository. For more information, see the [copilot-extensions](https://github.com/orgs/copilot-extensions/) organization on {% data variables.product.company_short %}.

Diff for: content/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type: reference
1313

1414
## Prerequisites
1515

16-
Before you configure your {% data variables.product.prodname_copilot_agent_short %} to communicate with {% data variables.product.github %}, you should understand how your {% data variables.product.prodname_copilot_agent_short %} communicates with the {% data variables.product.prodname_copilot_short %} platform. See [AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-the-copilot-platform).
16+
{% data reusables.copilot.copilot-extensions.agents-copilot-platform-prerequisites %}
1717

1818
## Verifying that payloads are coming from {% data variables.product.github %}
1919

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
---
2+
title: Context passing for your agent
3+
intro: 'Learn how to use context passing with your {% data variables.product.prodname_copilot_agent_short %}.'
4+
versions:
5+
feature: copilot-extensions
6+
topics:
7+
- Copilot
8+
shortTitle: Context passing
9+
type: how_to
10+
---
11+
12+
## About context passing
13+
14+
{% data variables.product.prodname_copilot_extensions %} can access certain contextual information using context passing.
15+
Context passing allows agents to receive relevant details about a user’s current file, selected text, and repository.
16+
It happens automatically when you interact with an extension, but requires your explicit authorization through {% data variables.product.prodname_github_app %} permissions for use in any organization-owned repositories.
17+
18+
Different clients, such as {% data variables.product.prodname_copilot_chat %} in {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, and {% data variables.product.github %}, provide context through different reference types.
19+
For example, IDEs send information such as file contents and selections, while {% data variables.product.prodname_copilot_chat_dotcom_short %} includes the current URL for the page being viewed.
20+
21+
## Prerequisites
22+
23+
{% data reusables.copilot.copilot-extensions.agents-copilot-platform-prerequisites %}
24+
25+
## Understanding context passing
26+
27+
Context passing enables agents to receive information about the user’s active workspace.
28+
Your agent receives server-sent events (SSEs) that contain a list of messages from the user as well as references to the user’s current environment.
29+
Depending on the client, different types of context are provided.
30+
31+
The following table shows the reference types that are passed to {% data variables.product.prodname_copilot_extensions %} based on the client or IDE you are using.
32+
33+
{% rowheaders %}
34+
35+
| Client or IDE | client.file | client.selection | github.repository | github.current-url | Additional contexts |
36+
| ------------------ | ----------- | ---------------- | ----------------- | ------------------ | ------------------------------------------------- |
37+
| {% data variables.product.prodname_vscode %} | Yes | Yes | Yes | No | Repository owner and branch |
38+
| {% data variables.product.prodname_vs %} | Yes | Yes | Yes | No | Repository owner and branch |
39+
| {% data variables.product.prodname_dotcom_the_website %} | No | No | Yes | Yes | Repository information and other {% data variables.product.github %} resources |
40+
41+
{% endrowheaders %}
42+
43+
### Reference types for {% data variables.product.prodname_copilot_chat_short %} in IDEs
44+
45+
The following reference types can be passed to your agent from an IDE:
46+
* `client.file`: Represents the full content of the currently active file in the IDE.
47+
* `client.selection`: Represents the selected portion of text the user highlighted in the active file.
48+
* `github.repository`: Provides information about the active repository.
49+
50+
### Reference types for {% data variables.product.prodname_copilot_chat_dotcom_short %}
51+
52+
The following reference types can be passed to your agent from {% data variables.product.github %}:
53+
* `github.current-url`: Represents the URL of the current {% data variables.product.github %} page the user is viewing.
54+
* `github.repository`: Provides information about the active repository.
55+
56+
## Example references
57+
58+
The following code shows an example object for `client.file`:
59+
60+
```json
61+
{
62+
// The reference type.
63+
"type": "client.file",
64+
"data": {
65+
// The full content of the active file.
66+
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
67+
"language": "plaintext"
68+
},
69+
"id": "relative-path/to/file",
70+
// `is_implicit` indicates whether the reference was automatically provided by the client (true) or manually attached by the user (false).
71+
"is_implicit": true,
72+
"metadata": {
73+
"display_name": "https://github.com/example-user/example-repository",
74+
"display_icon": "",
75+
"display_url": ""
76+
}
77+
}
78+
```
79+
80+
The following code shows an example object for `client.selection`:
81+
82+
```json
83+
{
84+
// The reference type.
85+
"type": "client.selection",
86+
"data": {
87+
// The currently selected portion of text.
88+
"content": "<current selection>",
89+
"end": {
90+
"col": 80,
91+
"line": 10
92+
},
93+
"start": {
94+
"col": 0,
95+
"line": 0
96+
}
97+
},
98+
"id": "relative-path/to/file",
99+
// `is_implicit` indicates whether the reference was automatically provided by the client (true) or manually attached by the user (false).
100+
"is_implicit": true,
101+
"metadata": {
102+
"display_name": "https://github.com/example-user/example-repository",
103+
"display_icon": "",
104+
"display_url": ""
105+
}
106+
}
107+
```
108+
109+
The following code shows an example object for `github.repository`:
110+
111+
```json
112+
{
113+
// The reference type.
114+
"type": "github.repository",
115+
"data": {
116+
"type": "repository",
117+
"id": "abc-123",
118+
"name": "example-repository",
119+
"ownerLogin": "example-user",
120+
"ownerType": "",
121+
"readmePath": "",
122+
"description": "",
123+
"commitOID": "",
124+
"ref": "",
125+
"refInfo": {
126+
"name": "",
127+
"type": ""
128+
},
129+
"visibility": "",
130+
"languages": null
131+
},
132+
"id": "example-user/example-repository",
133+
// `is_implicit` is always false for github.repository.
134+
"is_implicit": false,
135+
"metadata": {
136+
"display_name": "https://github.com/example-user/example-repository",
137+
"display_icon": "",
138+
"display_url": ""
139+
}
140+
}
141+
```
142+
143+
The following code shows an example object for `github.current-url`:
144+
145+
```json
146+
{
147+
// The reference type.
148+
"type": "github.current-url",
149+
"data": {
150+
// The GitHub URL the user was on while chatting with the agent.
151+
"url": "https://github.com/example-user/example-repository"
152+
},
153+
"id": "https://github.com/example-user/example-repository",
154+
// `is_implicit` is always true for github.current-url.
155+
"is_implicit": true,
156+
"metadata": {
157+
"display_name": "https://github.com/example-user/example-repository",
158+
"display_icon": "",
159+
"display_url": ""
160+
}
161+
}
162+
```
163+
164+
## Setting up context passing
165+
166+
To enable context passing through an IDE client, the **{% data variables.product.prodname_copilot_short %} Editor Context** permission must be configured for your agent.
167+
This permission only controls access for the `client.file` and `client.selection` reference types.
168+
Users that install and use the agent will be clearly informed that the agent has read access to {% data variables.product.prodname_copilot_short %} Editor Context which includes content such as active file and current selection.
169+
170+
`github.current-url` and `github.repository` are unaffected by the {% data variables.product.prodname_copilot_short %} Editor Context. These reference types rely on authorization filtering to ensure third party agents only receive references they have access to. For information on managing the privacy of `github.current-url` and `github.repository`, see [Privacy controls](#privacy-controls).
171+
172+
Follow these steps to set the necessary permissions for context passing from IDEs to your agent:
173+
174+
{% data reusables.apps.settings-step-personal-orgs %}
175+
{% data reusables.user-settings.developer_settings %}
176+
{% data reusables.user-settings.github_apps %}
177+
1. In the list of {% data variables.product.prodname_github_apps %}, click the {% data variables.product.prodname_github_app %} you want to configure for context passing.
178+
1. In the navigation menu on the left, select **Permissions & events**.
179+
1. Under **Account Permissions**, select **Read-only** access for **{% data variables.product.prodname_copilot_short %} Editor Context**.
180+
181+
## Privacy controls
182+
183+
In cases where you don't want to share certain context details with the agent, you can redact and remove reference types in multiple ways.
184+
185+
### Chat in IDEs
186+
187+
* If an agent doesn't have the {% data variables.product.prodname_copilot_short %} Editor Context read-access permission, all `client.*` references are removed.
188+
* If an agent doesn't have read access to a repository, all `client.*` references are removed and the `github.repository` reference is redacted.
189+
> [!NOTE] {% data variables.product.prodname_vs %} and {% data variables.product.prodname_vscode %} provides an option to exclude content from the current file. The `client.*` reference types are removed if the user has excluded content from the current file.
190+
191+
### Chat in {% data variables.product.github %}
192+
193+
* If an agent doesn't have read access to the repository associated with the current {% data variables.product.github %} URL, the `github.current-url` and `github.repository` references are redacted.
194+
* If repository information cannot be extracted from the current {% data variables.product.github %} URL, `github.current-url` is redacted.
195+
196+
### Redacted references
197+
198+
When a reference is redacted due to insufficient permissions, it is replaced with a placeholder indicating the type of information that was excluded.
199+
In the following example, the `type` field indicates that the reference has been redacted and the `data.type` field reveals the original reference type.
200+
201+
```json
202+
{
203+
"role": "user",
204+
"content": "Current Date and Time (UTC): 2024-10-22 00:43:14\nCurrent User's Login: monalisa\n",
205+
"name": "_session",
206+
"copilot_references": [
207+
{
208+
"type": "github.redacted",
209+
"data": {
210+
"type": "github.current-url"
211+
},
212+
"id": "example-id",
213+
"is_implicit": true,
214+
"metadata": {
215+
"display_name": "",
216+
"display_icon": "",
217+
"display_url": ""
218+
}
219+
}
220+
],
221+
"copilot_confirmations": null
222+
}
223+
```
224+
225+
### Context Exclusions
226+
227+
To safeguard sensitive information, certain scenarios automatically prevent the passing of context to agents.
228+
If an organization has set content exclusion rules for {% data variables.product.prodname_copilot_short %}, files that fall under these rules will not be included in the context passed to agents.
229+
230+
For more information on content exlusion rules, see [AUTOTITLE](/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot).
231+
232+
#### Large Files
233+
234+
Files exceeding the size limit set by the client will not be sent. The reference will include metadata indicating that the file was too large to process.
235+
236+
#### Hidden Files
237+
238+
Files beginning with a dot, such as `.env` and `.config`, are excluded by default to prevent unintentional sharing of sensitive configurations. In {% data variables.product.prodname_vscode_shortname %}, you can specify files or directories in a `.copilotignore` file to prevent them from being sent to {% data variables.product.prodname_copilot_short %} agents. This client-side mechanism offers granular control over which files are excluded.

Diff for: content/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ children:
1010
- /about-copilot-agents
1111
- /configuring-your-copilot-agent-to-communicate-with-the-copilot-platform
1212
- /configuring-your-copilot-agent-to-communicate-with-github
13+
- /context-passing-for-your-agent
1314
- /using-copilots-llm-for-your-agent
1415
---

Diff for: content/copilot/building-copilot-extensions/copilot-extensions-glossary.md

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ The following terms are used in the context of {% data variables.product.prodnam
1717

1818
A concrete implementation of an AI assistant that can receive user queries and return a stream of response tokens. The combination of an agent + {% data variables.product.prodname_github_app %} is what we refer to as a {% data variables.product.prodname_copilot_extension_short %}.
1919

20+
#### Context Passing
21+
22+
A capability in {% data variables.product.prodname_copilot_extensions_short %} that enables user context from editors to be sent to agents, allowing for more tailored responses.
23+
2024
#### {% data variables.product.prodname_copilot_chat_short %}
2125

2226
The conversational interface within {% data variables.product.prodname_copilot %} where users can interact with the AI assistant and extensions.

Diff for: content/copilot/building-copilot-extensions/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ children:
1313
- /building-a-copilot-agent-for-your-copilot-extension
1414
- /building-a-copilot-skillset-for-your-copilot-extension
1515
- /creating-a-copilot-extension
16+
- /using-oidc-with-github-copilot-extensions
1617
- /debugging-your-github-copilot-extension
1718
- /managing-the-availability-of-your-copilot-extension
1819
- /copilot-extensions-glossary

0 commit comments

Comments
 (0)