File tree Expand file tree Collapse file tree
packages/workshop-backend/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1058,6 +1058,16 @@ class OverseerImpl implements AgentHooks {
10581058 // Provides web-fetch with the Workers AI binding and AI Gateway config it needs to call
10591059 // `env.WORKERS_AI.toMarkdown()`. The initiator is needed for AI Gateway metadata.
10601060 getWebFetchEnv ( ) : WebFetchEnv {
1061+ if ( this . storage . prohibitAllSharing . get ( ) ) {
1062+ // TODO: Disallwing fetches is a bit draconian. Ideally, we would have some way to detect
1063+ // if a URL is well-known, and therefore not a leak problem. E.g. if the URL is already in
1064+ // a search index, then it's not leaking anything. If we had a search provider we could
1065+ // trust... for now though, we will be extra-careful specifically when prohibiting sharing.
1066+ throw new Error (
1067+ "This gadget has observed sensitive data. To prevent leaks, the Gadget is prohibited " +
1068+ "from fetching from public web sites." ) ;
1069+ }
1070+
10611071 return {
10621072 ai : this . env . WORKERS_AI ,
10631073 gateway : getAiGatewayConfig ( this . env ) ,
You can’t perform that action at this time.
0 commit comments