Skip to content

Commit 4ab3abe

Browse files
committed
Fix SPE DA articles
1 parent 5fd0e92 commit 4ab3abe

File tree

2 files changed

+52
-17
lines changed

2 files changed

+52
-17
lines changed

docs/embedded/development/declarative-agent/spe-da-adv.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you’re updating an existing container type to set this property to `false`,
2727

2828
This ensures the agent can correctly access and surface the content.
2929

30-
Here is an example of how to set `discoverabilityDisabled` to false with [Set-SPOContainerTypeConfiguration](/powershell/module/SharePoint-online/set-spocontainertypeconfiguration#examples)
30+
Here is an example of how to set `discoverabilityDisabled` to `false` with [Set-SPOContainerTypeConfiguration](/powershell/module/SharePoint-online/set-spocontainertypeconfiguration#examples)
3131

3232
```powershell
3333
Set-SPOContainerTypeConfiguration -ContainerTypeId 4f0af585-8dcc-0000-223d-661eb2c604e4 -DiscoverabilityDisabled $false
@@ -39,40 +39,75 @@ Discoverability can also be disabled using the Visual Studio Code SharePoint Emb
3939

4040
##### CSP Policies
4141

42-
The Content-Security-Policy (CSP) for embedded chat hosts ensures that only specified hosts can load the chat component. This helps in securing the application by restricting which domains can embed the chat component.
42+
The Content-Security-Policy (CSP) for embedded chat hosts ensures that only specified hosts can load the chat component. Specifically, the `CopilotEmbeddedChatHosts` setting is used in a [Content-Security-Policy](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy) header as a `frame-ancestors` value. This helps in securing the application by restricting which domains can embed the chat component.
4343

44-
It's intended to allow consuming tenant SPE admins to set an allowlist of hosts that are permitted to embed the SPE agent in an iframe. Specifically, the value they set here is used in a Content-Security-Policy header as a frame-ancestors value.
44+
The SPE Administrator on the owning tenant can set this setting by using the `Set-SPOContainerTypeConfiguration` cmdlet:
45+
46+
```powershell
47+
# Note this MUST be run in Windows PowerShell. It will not work in PowerShell.
48+
Import-Module -Name "Microsoft.Online.SharePoint.PowerShell"
49+
Connect-SPOService "https://<domain>-admin.sharepoint.com"
50+
# Login with your admin account.
51+
# ...
52+
53+
Set-SPOContainerTypeConfiguration -ContainerTypeId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -CopilotEmbeddedChatHosts @("http://localhost:3000", "https://contoso.sharepoint.com", "https://fabrikam.com")
54+
55+
# This will set the container type configuration “CopilotEmbeddedChatHosts” accordingly.
56+
# Replication of this configuration on consuming tenants can take up to 24 hours
57+
# ...
58+
59+
# Confirm setting value
60+
Get-SPOContainerTypeConfiguration -ContainerTypeId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
61+
62+
# On a consuming tenant, you may confirm the setting value as follows
63+
Get-SPOApplication -OwningApplicationId <OwningApplicationId> | Select-Object CopilotEmbeddedChatHosts
64+
65+
OwningApplicationId : <OwningApplicationId>
66+
OwningApplicationName : SharePoint Embedded App
67+
Applications : {<OwningApplicationId>}
68+
CopilotEmbeddedChatHosts : {http://localhost:3000, https://contoso.sharepoint.com, https://fabrikam.com}
69+
```
4570

4671
> [!NOTE]
4772
>
48-
> If this configuration isn't set, the [Content-Security-Policy](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy) is default set to
73+
> If this configuration isn't set, the [Content-Security-Policy](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy) is by default set to
4974
> [frame-ancestors](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors): "none", which means no one can embed the agent.
5075
51-
Here are example commands to use the [Connect to SharePoint using PowerShell](/powershell/sharepoint/sharepoint-online/connect-sharepoint-online) commands:
76+
A SharePoint Embedded Administrator on a consuming tenant may override the values specified by the owning application, by using
77+
the consuming tenant cmdlets:
5278

5379
- [Set-SPOApplication](/powershell/module/SharePoint-online/set-spoapplication) to set the `CopilotEmbeddedChatHosts` property.
5480
- [Get-SPOApplication](/powershell/module/SharePoint-online/get-spoapplication) to get the `CopilotEmbeddedChatHosts` property.
5581

82+
> [!NOTE]
83+
>
84+
> A consuming tenant override must be a subset of what the owning tenant configured for `CopilotEmbeddedChatHosts`. An administrator
85+
> in a consuming tenant cannot set values that the application owner has not specified for the container type. The override capabilities
86+
> is intended for consuming tenant administrators to enable the agent in only a subset of hosts that the owning application has defined.
87+
88+
Here's an example of how a consuming tenant can override the setting:
89+
5690
```powershell
5791
# Note this MUST be run in Windows PowerShell. It will not work in PowerShell.
5892
Import-Module -Name "Microsoft.Online.SharePoint.PowerShell"
5993
Connect-SPOService "https://<domain>-admin.sharepoint.com"
6094
# Login with your admin account.
61-
...
95+
# ...
6296
63-
Set-SPOApplication -OwningApplicationId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -CopilotEmbeddedChatHosts @("http://localhost:3000", "https://contoso.sharepoint.com", "https://fabrikam.com")
97+
Set-SPOApplication -OwningApplicationId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -CopilotEmbeddedChatHosts @("https://contoso.sharepoint.com", "https://fabrikam.com")
6498
65-
# This will set the container type configuration “CopilotEmbeddedChatHosts” accordingly.
66-
...
99+
# This will set the container type configuration “CopilotEmbeddedChatHosts” accordingly
100+
# Note that @("https://contoso.sharepoint.com", "https://fabrikam.com") is a subset of what we defined in the owning tenant
101+
# Those values were @("http://localhost:3000", "https://contoso.sharepoint.com", "https://fabrikam.com")
102+
103+
# Confirm the configuration
67104
68105
Get-SPOApplication -OwningApplicationId <OwningApplicationId> | Select-Object CopilotEmbeddedChatHosts
69106
70107
OwningApplicationId : <OwningApplicationId>
71108
OwningApplicationName : SharePoint Embedded App
72109
Applications : {<OwningApplicationId>}
73-
SharingCapability : ExternalUserAndGuestSharing
74-
OverrideTenantSharingCapability : False
75-
CopilotEmbeddedChatHosts : {http://localhost:*}
110+
CopilotEmbeddedChatHosts : {https://contoso.sharepoint.com, https://fabrikam.com}
76111
```
77112

78113
#### Optional Configuration
@@ -93,7 +128,7 @@ When SPE agent users query the LLM, it will only have access to files that the *
93128

94129
### Information Architecture
95130

96-
Files in SharePoint Embedded are naturally [semantic indexed](spe-da-adv.md#semantic-index). This semantic index underpins retrieval augmented generation [(RAG)](spe-da-adv.md#rag--retrieval-augmented-generation-) workflows by providing relevant context from your stored content at query time. In essence, it [grounds](spe-da-adv.md#grounding) the AI responses, ensuring they directly reference accurate information in your containers rather than relying on general knowledge alone.
131+
Files in SharePoint Embedded are naturally [semantic indexed](spe-da-adv.md#semantic-index). This semantic index underpins retrieval augmented generation [(RAG)](spe-da-adv.md#retrieval-augmented-generation-rag) workflows by providing relevant context from your stored content at query time. In essence, it [grounds](spe-da-adv.md#grounding) the AI responses, ensuring they directly reference accurate information in your containers rather than relying on general knowledge alone.
97132

98133
![How RAG works in SPE](../../images/speco-ragm365.png)
99134

@@ -107,7 +142,7 @@ The semantic index allows for quick and accurate searches based on data similari
107142

108143
### Retrieval-Augmented Generation (RAG)
109144

110-
RAG relies on having relevant source materials stored in a repository, which can be queried at runtime​, data is retrieved from the index and is used to augment the prompt sent to the large language model (LLM)​:
145+
RAG enables you to reference relevant source materials stored in a repository at runtime. The data is retrieved from the index and is used to augment the prompt sent to the large language model (LLM). Some benefits of RAG​:
111146

112147
- Treat data sources as knowledge without having to train your model​
113148
- Uses search (retrieval) results as additional context in your prompt​
@@ -119,11 +154,11 @@ The LLM uses the data to inform and construct the response.
119154

120155
### Grounding
121156

122-
Grounding in the context of SPE agent refers to the process of providing input sources to the large language model (LLM) related to the user's prompt. This helps improve the specificity of the prompt and ensures that the responses are relevant and actionable to the user's specific task. The data the agent is grounded on will be on the contents of the container type in the agent application. Behind the scenes SPE agent uses Microsoft 365 Copilot, [learn more about its architecture here](/copilot/microsoft-365/microsoft-365-copilot-architecture)
157+
Grounding in the context of SPE agent refers to the process of providing input sources to the large language model (LLM) related to the user's prompt. This helps improve the specificity of the prompt and ensures that the responses are relevant and actionable to the user's specific task. The data the agent is grounded on will be the contents of the container type in the agent application. Behind the scenes, SPE agent uses Microsoft 365 Copilot. [Learn more about Microsoft 365 Copilot architecture](/copilot/microsoft-365/microsoft-365-copilot-architecture).
123158

124159
### Scoping your agent to specific content
125160

126-
SharePoint Embedded (SPE) agent has the ability to restrict the data sources it has access to, below are provided types, and this [example](https://github.com/microsoft/SharePoint-Embedded-Samples/blob/main/Samples/spe-typescript-react-azurefunction/react-client/src/providers/ChatController.ts#L15) shows how to configure the SDK
161+
SharePoint Embedded (SPE) agent has the ability to restrict the data sources it has access to. The sample code below shows the available data source types. [This example](https://github.com/microsoft/SharePoint-Embedded-Samples/blob/main/Samples/spe-typescript-react-azurefunction/react-client/src/providers/ChatController.ts#L15) shows how to configure the SDK.
127162

128163
```typescript
129164
export type IDataSourcesProps =

docs/embedded/development/tutorials/spe-da-vscode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.localizationpriority: high
1515
> 1. You must specify a standard container type at creation time. Depending on the purpose, you may or may not need to provide your Azure Subscription ID. A container type set for trial purposes can't be converted for production, or vice versa.
1616
> 1. You must use the latest version of SharePoint PowerShell to configure a container type. For permissions and the most current information about Windows PowerShell for SharePoint Embedded, see the documentation at [Intro to SharePoint Embedded Management Shell](/powershell/SharePoint/SharePoint-online/introduction-SharePoint-online-management-shell).
1717
>
18-
> - Set the **ChatEmbeddedHosts** property of your container type configuration to `http://localhost:8080` to be able to work through the quick start below, refer to [the CSP section above for more information](../declarative-agent/spe-da-adv.md#csp-policies)
18+
> - Set the **CopilotChatEmbeddedHosts** property of your container type configuration to `http://localhost:8080` to be able to work through the quick start below, refer to [the CSP section above for more information](../declarative-agent/spe-da-adv.md#csp-policies)
1919
> - Set the **DiscoverabilityDisabled** property of your container type configuration to `false` so that the agent can find the files in your created container. Refer to the [Discoverability Disabled section above for more information](../declarative-agent/spe-da-adv.md#discoverabilitydisabled).
2020
> - Ensure that Copilot for Microsoft 365 is available for your organization. You have two ways to get a developer environment for Copilot:
2121
> - A sandbox Microsoft 365 tenant with M365 Copilot (available in limited preview through [TAP membership](https://developer.microsoft.com/microsoft-365/tap)).

0 commit comments

Comments
 (0)