-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCopilotCloudAgentProtocol-01.txt
More file actions
7432 lines (6542 loc) · 400 KB
/
CopilotCloudAgentProtocol-01.txt
File metadata and controls
7432 lines (6542 loc) · 400 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Processing requests...
Launcher version: d9bcd867a9524db08489a75d7afaf372b2d7b9ce, 0.0.52, 1.4.4
==============================
Allow list
----
localhost
https://github.com/
githubusercontent.com
https://raw.githubusercontent.com/
https://objects.githubusercontent.com/
https://codeload.github.com/
https://uploads.github.com/user-attachments/assets/
https://api.github.com/internal/user-attachments/assets/
https://api.github.com/advisories
https://api.github.com/repos/huberp/agentloop/copilot_internal/
https://api.github.com/embeddings/code/search
https://github.githubassets.com/assets
https://*.githubusercontent.com
https://uploads.github.com
172.18.0.1
168.63.129.16
host.docker.internal
https://lfs.github.com/
https://github-cloud.githubusercontent.com/
https://github-cloud.s3.amazonaws.com/
https://api.github.com/repos/github/codeql-action/releases/
https://api.github.com/repos/dependabot/cli/releases/
https://productionresultssa0.blob.core.windows.net/
https://productionresultssa1.blob.core.windows.net/
https://productionresultssa2.blob.core.windows.net/
https://productionresultssa3.blob.core.windows.net/
https://productionresultssa4.blob.core.windows.net/
https://productionresultssa5.blob.core.windows.net/
https://productionresultssa6.blob.core.windows.net/
https://productionresultssa7.blob.core.windows.net/
https://productionresultssa8.blob.core.windows.net/
https://productionresultssa9.blob.core.windows.net/
https://productionresultssa10.blob.core.windows.net/
https://productionresultssa11.blob.core.windows.net/
https://productionresultssa12.blob.core.windows.net/
https://productionresultssa13.blob.core.windows.net/
https://productionresultssa14.blob.core.windows.net/
https://productionresultssa15.blob.core.windows.net/
https://productionresultssa16.blob.core.windows.net/
https://productionresultssa17.blob.core.windows.net/
https://productionresultssa18.blob.core.windows.net/
https://productionresultssa19.blob.core.windows.net/
https://api.githubcopilot.com/
https://api.githubcopilot.com/
api.individual.githubcopilot.com
https://github.com
----
==============================
Using Firewall Recommended Rules
----
---
version: 0.0.1
rules:
- kind: ip-rule
name: azure-metadata-ip
ip: 168.63.129.16
---
version: 0.0.1
rules:
- kind: http-rule
url: { domain: crl3.digicert.com }
- kind: http-rule
url: { domain: crl4.digicert.com }
- kind: http-rule
url: { domain: ocsp.digicert.com }
- kind: http-rule
url: { domain: ts-crl.ws.symantec.com }
- kind: http-rule
url: { domain: ts-ocsp.ws.symantec.com }
- kind: http-rule
url: { domain: crl.geotrust.com }
- kind: http-rule
url: { domain: ocsp.geotrust.com }
- kind: http-rule
url: { domain: crl.thawte.com }
- kind: http-rule
url: { domain: ocsp.thawte.com }
- kind: http-rule
url: { domain: crl.verisign.com }
- kind: http-rule
url: { domain: ocsp.verisign.com }
- kind: http-rule
url: { domain: crl.globalsign.com }
- kind: http-rule
url: { domain: ocsp.globalsign.com }
- kind: http-rule
url: { domain: crls.ssl.com }
- kind: http-rule
url: { domain: ocsp.ssl.com }
- kind: http-rule
url: { domain: crl.identrust.com }
- kind: http-rule
url: { domain: ocsp.identrust.com }
- kind: http-rule
url: { domain: crl.sectigo.com }
- kind: http-rule
url: { domain: ocsp.sectigo.com }
- kind: http-rule
url: { domain: crl.usertrust.com }
- kind: http-rule
url: { domain: ocsp.usertrust.com }
- kind: http-rule
url: { domain: s.symcb.com }
- kind: http-rule
url: { domain: s.symcd.com }
---
version: 0.0.1
rules:
- kind: ip-rule
name: docker-compose-bridge-ip
ip: "172.18.0.1"
- kind: http-rule
url: { scheme: ["https"], domain: ghcr.io }
- kind: http-rule
url: { scheme: ["https"], domain: registry.hub.docker.com }
- kind: http-rule
url: { domain: docker.io, allow-any-subdomain: true }
- kind: http-rule
url: { domain: docker.com, allow-any-subdomain: true }
- kind: http-rule
url: { scheme: ["https"], domain: production.cloudflare.docker.com }
- kind: http-rule
url: { scheme: ["https"], domain: dl.k8s.io }
- kind: http-rule
url: { scheme: ["https"], domain: pkgs.k8s.io }
- kind: http-rule
url: { scheme: ["https"], domain: quay.io }
- kind: http-rule
url: { scheme: ["https"], domain: mcr.microsoft.com }
- kind: http-rule
url: { scheme: ["https"], domain: gcr.io }
- kind: http-rule
url: { scheme: ["https"], domain: public.ecr.aws }
- kind: http-rule
url: { scheme: ["https"], domain: auth.docker.io }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: nuget.org }
- kind: http-rule
url: { scheme: ["https"], domain: dist.nuget.org }
- kind: http-rule
url: { scheme: ["https"], domain: api.nuget.org }
- kind: http-rule
url: { scheme: ["https"], domain: nuget.pkg.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: dotnet.microsoft.com }
- kind: http-rule
url: { scheme: ["https"], domain: pkgs.dev.azure.com }
- kind: http-rule
url: { scheme: ["https"], domain: builds.dotnet.microsoft.com }
- kind: http-rule
url: { scheme: ["https"], domain: dotnetcli.blob.core.windows.net }
- kind: http-rule
url:
{ scheme: ["https"], domain: nugetregistryv2prod.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: azuresearch-usnc.nuget.org }
- kind: http-rule
url: { scheme: ["https"], domain: azuresearch-ussc.nuget.org }
- kind: http-rule
url: { scheme: ["https"], domain: dc.services.visualstudio.com }
- kind: http-rule
url: { scheme: ["https"], domain: dot.net }
- kind: http-rule
url: { scheme: ["https"], domain: download.visualstudio.microsoft.com }
- kind: http-rule
url: { scheme: ["https"], domain: dotnetcli.azureedge.net }
- kind: http-rule
url: { scheme: ["https"], domain: ci.dot.net }
- kind: http-rule
url: { scheme: ["https"], domain: www.microsoft.com }
- kind: http-rule
url: { scheme: ["https"], domain: oneocsp.microsoft.com }
- kind: http-rule
name: "Allow certificate revocation list over http"
url:
scheme: ["http"]
domain: "www.microsoft.com"
path: "/pkiops/crl/"
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: pub.dev }
- kind: http-rule
url: { scheme: ["https"], domain: pub.dartlang.org }
- kind: http-rule
url:
scheme: ["https"]
domain: storage.googleapis.com
path: "/pub-packages/"
- kind: http-rule
url:
scheme: ["https"]
domain: storage.googleapis.com
path: "/dart-archive/"
---
version: 0.0.1
rules:
- kind: http-rule
url: { domain: githubusercontent.com, allow-any-subdomain: true }
- kind: http-rule
url: { scheme: ["https"], domain: raw.githubusercontent.com }
- kind: http-rule
url: { scheme: ["https"], domain: objects.githubusercontent.com }
- kind: http-rule
url: { scheme: ["https"], domain: lfs.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: github-cloud.githubusercontent.com }
- kind: http-rule
url: { scheme: ["https"], domain: github-cloud.s3.amazonaws.com }
- kind: http-rule
url: { scheme: ["https"], domain: codeload.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: codeql.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: scanning-api.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: api.mcp.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: docs.github.com }
- kind: http-rule
url:
scheme: ["https"]
domain: uploads.github.com
path: "/copilot/chat/attachments/"
# GitHub Actions workflow run artifact storage accounts (Azure blob storage endpoints productionresultssa0-19)
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa0.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa1.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa2.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa3.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa4.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa5.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa6.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa7.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa8.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa9.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa10.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa11.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa12.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa13.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa14.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa15.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa16.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa17.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa18.blob.core.windows.net }
- kind: http-rule
url: { scheme: ["https"], domain: productionresultssa19.blob.core.windows.net }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: go.dev }
- kind: http-rule
url: { scheme: ["https"], domain: golang.org }
- kind: http-rule
url: { scheme: ["https"], domain: proxy.golang.org }
- kind: http-rule
url: { scheme: ["https"], domain: sum.golang.org }
- kind: http-rule
url: { scheme: ["https"], domain: pkg.go.dev }
- kind: http-rule
url: { scheme: ["https"], domain: goproxy.io }
- kind: http-rule
url:
scheme: ["https"]
domain: storage.googleapis.com
path: "/proxy-golang-org-prod/"
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: releases.hashicorp.com }
- kind: http-rule
url: { scheme: ["https"], domain: apt.releases.hashicorp.com }
- kind: http-rule
url: { scheme: ["https"], domain: yum.releases.hashicorp.com }
- kind: http-rule
url: { scheme: ["https"], domain: registry.terraform.io }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: haskell.org }
- kind: http-rule
url: { domain: hackage.haskell.org, allow-any-subdomain: true }
- kind: http-rule
url: { scheme: ["https"], domain: get-ghcup.haskell.org }
- kind: http-rule
url: { scheme: ["https"], domain: downloads.haskell.org }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: www.java.com }
- kind: http-rule
url: { scheme: ["https"], domain: jdk.java.net }
- kind: http-rule
url: { scheme: ["https"], domain: api.adoptium.net }
- kind: http-rule
url: { scheme: ["https"], domain: adoptium.net }
- kind: http-rule
url: { scheme: ["https"], domain: search.maven.org }
- kind: http-rule
url: { scheme: ["https"], domain: maven.apache.org }
- kind: http-rule
url: { scheme: ["https"], domain: repo.maven.apache.org }
- kind: http-rule
url: { scheme: ["https"], domain: repo1.maven.org }
- kind: http-rule
url: { scheme: ["https"], domain: maven.pkg.github.com }
- kind: http-rule
url:
{
scheme: ["https"],
domain: maven-central.storage-download.googleapis.com,
}
- kind: http-rule
url: { scheme: ["https"], domain: maven.google.com }
- kind: http-rule
url: { scheme: ["https"], domain: maven.oracle.com }
- kind: http-rule
url: { scheme: ["https"], domain: jcenter.bintray.com }
- kind: http-rule
url: { scheme: ["https"], domain: oss.sonatype.org }
- kind: http-rule
url: { scheme: ["https"], domain: repo.spring.io }
- kind: http-rule
url: { scheme: ["https"], domain: gradle.org }
- kind: http-rule
url: { scheme: ["https"], domain: services.gradle.org }
- kind: http-rule
url: { scheme: ["https"], domain: plugins.gradle.org }
- kind: http-rule
url: { scheme: ["https"], domain: plugins-artifacts.gradle.org }
- kind: http-rule
url: { scheme: ["https"], domain: repo.grails.org }
- kind: http-rule
url: { scheme: ["https"], domain: download.eclipse.org }
- kind: http-rule
url: { scheme: ["https"], domain: download.oracle.com }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: json-schema.org }
- kind: http-rule
url: { scheme: ["https"], domain: json.schemastore.org }
---
version: 0.0.1
rules:
# Reminder: Lots of `apt` repositories don't use HTTP see: https://superuser.com/questions/1356786/ubuntu-apt-why-are-the-respositories-accessed-over-http
# Ubuntu
- kind: http-rule
url: { scheme: ["http", "https"], domain: archive.ubuntu.com }
- kind: http-rule
url: { scheme: ["http", "https"], domain: security.ubuntu.com }
- kind: http-rule
url: { scheme: ["http", "https"], domain: ppa.launchpad.net }
- kind: http-rule
url: { scheme: ["http", "https"], domain: keyserver.ubuntu.com }
- kind: http-rule
url: { scheme: ["http", "https"], domain: azure.archive.ubuntu.com }
- kind: http-rule
url: { scheme: ["http", "https"], domain: api.snapcraft.io }
# Debian
- kind: http-rule
url: { scheme: ["http", "https"], domain: deb.debian.org }
- kind: http-rule
url: { scheme: ["http", "https"], domain: security.debian.org }
- kind: http-rule
url: { scheme: ["http", "https"], domain: keyring.debian.org }
- kind: http-rule
url: { scheme: ["http", "https"], domain: packages.debian.org }
- kind: http-rule
url: { scheme: ["http", "https"], domain: debian.map.fastlydns.net }
- kind: http-rule
url: { scheme: ["http", "https"], domain: apt.llvm.org }
# Fedora
- kind: http-rule
url: { scheme: ["https"], domain: dl.fedoraproject.org }
- kind: http-rule
url: { scheme: ["https"], domain: mirrors.fedoraproject.org }
- kind: http-rule
url: { scheme: ["https"], domain: download.fedoraproject.org }
# CentOS
- kind: http-rule
url: { scheme: ["https"], domain: mirror.centos.org }
- kind: http-rule
url: { scheme: ["https"], domain: vault.centos.org }
# Alpine
- kind: http-rule
url: { scheme: ["https"], domain: dl-cdn.alpinelinux.org }
- kind: http-rule
url: { scheme: ["https"], domain: pkg.alpinelinux.org }
# Arch
- kind: http-rule
url: { scheme: ["https"], domain: mirror.archlinux.org }
- kind: http-rule
url: { scheme: ["https"], domain: archlinux.org }
# SUSE
- kind: http-rule
url: { scheme: ["https"], domain: download.opensuse.org }
# Red Hat
- kind: http-rule
url: { scheme: ["https"], domain: cdn.redhat.com }
# Common Package Mirrors
- kind: http-rule
url: { scheme: ["https"], domain: packagecloud.io }
- kind: http-rule
url: { scheme: ["https"], domain: packages.cloud.google.com }
# Microsoft Sources
- kind: http-rule
url: { scheme: ["https"], domain: packages.microsoft.com }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: npmjs.org }
- kind: http-rule
url: { scheme: ["https"], domain: npmjs.com }
- kind: http-rule
url: { scheme: ["https"], domain: registry.npmjs.com }
- kind: http-rule
url: { scheme: ["https"], domain: registry.npmjs.org }
- kind: http-rule
url: { scheme: ["https"], domain: skimdb.npmjs.com }
- kind: http-rule
url: { scheme: ["https"], domain: npm.pkg.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: api.npms.io }
- kind: http-rule
url: { scheme: ["https"], domain: nodejs.org }
- kind: http-rule
url: { scheme: ["https"], domain: yarnpkg.com }
- kind: http-rule
url: { scheme: ["https"], domain: registry.yarnpkg.com }
- kind: http-rule
url: { scheme: ["https"], domain: repo.yarnpkg.com }
- kind: http-rule
url: { domain: deb.nodesource.com }
- kind: http-rule
url: { scheme: ["https"], domain: get.pnpm.io }
- kind: http-rule
url: { scheme: ["https"], domain: bun.sh }
- kind: http-rule
url: { scheme: ["https"], domain: deno.land }
- kind: http-rule
url: { scheme: ["https"], domain: registry.bower.io }
- kind: http-rule
url: { scheme: ["https"], domain: binaries.prisma.sh }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: cpan.org }
- kind: http-rule
url: { scheme: ["https"], domain: www.cpan.org }
- kind: http-rule
url: { scheme: ["https"], domain: metacpan.org }
- kind: http-rule
url: { scheme: ["https"], domain: cpan.metacpan.org }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: repo.packagist.org }
- kind: http-rule
url: { scheme: ["https"], domain: packagist.org }
- kind: http-rule
url: { scheme: ["https"], domain: getcomposer.org }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: playwright.download.prss.microsoft.com }
- kind: http-rule
url: { scheme: ["https"], domain: cdn.playwright.dev }
- kind: http-rule
url: { scheme: ["https"], domain: playwright.azureedge.net }
- kind: http-rule
url: { scheme: ["https"], domain: playwright-akamai.azureedge.net }
- kind: http-rule
url: { scheme: ["https"], domain: playwright-verizon.azureedge.net }
- kind: http-rule
url:
scheme: ["https"]
domain: storage.googleapis.com
path: "/chrome-for-testing-public"
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: pypi.python.org }
- kind: http-rule
url: { scheme: ["https"], domain: pypi.org }
- kind: http-rule
url: { scheme: ["https"], domain: pip.pypa.io }
- kind: http-rule
url:
{ scheme: ["https"], domain: pythonhosted.org, allow-any-subdomain: true }
- kind: http-rule
url: { scheme: ["https"], domain: files.pythonhosted.org }
- kind: http-rule
url: { scheme: ["https"], domain: bootstrap.pypa.io }
- kind: http-rule
url: { scheme: ["https"], domain: conda.binstar.org }
- kind: http-rule
url: { scheme: ["https"], domain: conda.anaconda.org }
- kind: http-rule
url: { scheme: ["https"], domain: binstar.org }
- kind: http-rule
url: { scheme: ["https"], domain: anaconda.org }
- kind: http-rule
url: { scheme: ["https"], domain: download.pytorch.org }
- kind: http-rule
url: { scheme: ["https"], domain: repo.continuum.io }
- kind: http-rule
url: { scheme: ["https"], domain: repo.anaconda.com }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: rubygems.org }
- kind: http-rule
url: { scheme: ["https"], domain: api.rubygems.org }
- kind: http-rule
url: { scheme: ["https"], domain: rubygems.pkg.github.com }
- kind: http-rule
url: { scheme: ["https"], domain: bundler.rubygems.org }
- kind: http-rule
url: { scheme: ["https"], domain: gems.rubyforge.org }
- kind: http-rule
url: { scheme: ["https"], domain: gems.rubyonrails.org }
- kind: http-rule
url: { scheme: ["https"], domain: index.rubygems.org }
- kind: http-rule
url: { scheme: ["https"], domain: cache.ruby-lang.org }
- kind: http-rule
url: { domain: rvm.io, allow-any-subdomain: true }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: crates.io }
- kind: http-rule
url: { scheme: ["https"], domain: index.crates.io }
- kind: http-rule
url: { scheme: ["https"], domain: static.crates.io }
- kind: http-rule
url: { scheme: ["https"], domain: sh.rustup.rs }
- kind: http-rule
url: { scheme: ["https"], domain: static.rust-lang.org }
---
version: 0.0.1
rules:
- kind: http-rule
url: { scheme: ["https"], domain: download.swift.org }
- kind: http-rule
url: { scheme: ["https"], domain: swift.org }
- kind: http-rule
url: { scheme: ["https"], domain: cocoapods.org }
- kind: http-rule
url: { scheme: ["https"], domain: cdn.cocoapods.org }
----
(node:3768) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
::add-mask::ed3736f291ab6b318052c9e1629feaf1897ef225a16613cc6b3edf8468a42229
::add-mask::ed3736f291ab6b318052c9e1629feaf1897ef225a16613cc6b3edf8468a42229
Reading job config for job ID 4027454-1187083057-1ef53bd0-5eb2-41c3-b64e-41112399b96c.
Proceeding without custom agent.
Solving problem: 4027454-1187083057-1ef53bd0-5eb2-41c3-b64e-41112399b96c from huberp/agentloop@main
Semantic issues search mode: off
Problem statement:
----
*This section details on the original issue you should resolve*
<issue_title>add-on websearch tool</issue_title>
<issue_description># Task 2.9: Secure Web Research Tool
> Add-on to the [Development Plan v2 (#5)](https://github.com/huberp/agentloop/issues/5). Extends Phase 2 with web research capabilities not covered in the original plan.
- **Depends on:** 1.6, 1.7, 2.8 (optional — MCP path)
- **Estimated effort:** 2–3 days
- **Description**: Implement two tools (`web-search`, `web-fetch`) that allow the agent to search the web and fetch/read web pages, returning clean Markdown content. The tools must enforce strict URL hygiene (tracking-parameter stripping, domain allowlist/blocklist, SSRF protection) and be built primarily as **thin glue code** over well-maintained libraries.
---
## Motivation
The agent currently has no ability to look up external information — documentation, API references, Stack Overflow answers, changelogs, CVE details, etc. A web-research capability closes this gap and is critical for real-world software development tasks. This was identified as a missing piece in the [Development Plan v2 (#5)](https://github.com/huberp/agentloop/issues/5).
---
## Steps
### 1. Create `src/tools/web-search.ts`
- Implements `ToolDefinition`. Permission: `"cautious"`.
- Schema: `{ query: string, maxResults?: number }` (default `maxResults`: 5).
- Delegates the actual search to one of the configured backends (see Recommended Libraries below).
- Returns: `{ results: [{ title, url, snippet }] }` — URLs in results are cleaned (tracking params stripped).
- When `WEB_SEARCH_PROVIDER=none` (default), returns an error message instructing the user to configure a provider.
### 2. Create `src/tools/web-fetch.ts`
- Implements `ToolDefinition`. Permission: `"cautious"`.
- Schema: `{ url: string, extractMode?: "readability" | "raw" }` (default: `"readability"`).
- Pipeline: sanitize URL → blocklist/allowlist check → SSRF check → fetch → extract readable content → convert to Markdown → truncate.
- Returns: `{ url, title, markdown, byline?, excerpt? }`.
### 3. Create `src/tools/web-utils.ts` — URL Sanitization & Security Layer
| Concern | Implementation |
|---------|---------------|
| **Tracking parameter stripping** | Use [`tidy-url`](https://www.npmjs.com/package/tidy-url) to remove `utm_*`, `fbclid`, `gclid`, `mc_eid`, `_ga`, `ref`, and 1500+ other known tracker patterns automatically. One function call — the library maintains general + domain-specific rulesets. |
| **Domain blocklist** | Configurable `WEB_DOMAIN_BLOCKLIST` in `appConfig`. Default: common malware/phishing domains, `localhost`, internal hostnames. Reject any URL whose hostname matches. |
| **Domain allowlist** | Optional `WEB_DOMAIN_ALLOWLIST` — when non-empty, *only* listed domains are permitted. Useful for enterprise/locked-down environments. |
| **Protocol enforcement** | Only `https:` allowed by default. `http:` opt-in via `WEB_ALLOW_HTTP=true`. |
| **SSRF protection** | Reject URLs that resolve to private/loopback addresses (`127.0.0.0/8`, `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `::1`, `169.254.0.0/16`, etc.) to prevent server-side request forgery. Use `dns.resolve` + private-range check before fetching. |
### 4. Content Extraction Pipeline (inside `web-fetch.ts`)
URL ──▶ tidy-url ──▶ blocklist/allowlist ──▶ SSRF check
│
▼
fetch(url) ──▶ jsdom ──▶ @mozilla/readability
│
▼
turndown ──▶ Markdown
│
truncate to limit
- **Fetch**: Use Node built-in `fetch()` (Node 18+) with configurable timeout, `User-Agent`, and max response size (`WEB_MAX_RESPONSE_BYTES`, default: 5 MB).
- **Readability extraction**: Use [`@mozilla/readability`](https://www.npmjs.com/package/@mozilla/readability) + [`jsdom`](https://www.npmjs.com/package/jsdom) to extract the main article content (strips nav, ads, sidebars, footers — like Firefox Reader View).
- **HTML → Markdown**: Use [`turndown`](https://www.npmjs.com/package/turndown) to convert cleaned HTML to Markdown. Configure to preserve code blocks, headings, links, lists, and tables.
- **Fallback**: If Readability returns `null`, fall back to Turndown conversion of the full `<body>`.
- **Truncation**: Truncate final Markdown to `WEB_MAX_CONTENT_CHARS` (default: 20000) without breaking mid-word.
### 5. Configuration — add to `appConfig`
| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `WEB_SEARCH_PROVIDER` | `"brave" \| "tavily" \| "mcp" \| "none"` | `"none"` | Search backend. Disabled until configured. |
| `BRAVE_API_KEY` | `string` | `""` | API key for Brave Search (free tier: 2000 queries/mo). |
| `TAVILY_API_KEY` | `string` | `""` | API key for Tavily Search (free tier: 1000 queries/mo). |
| `WEB_DOMAIN_BLOCKLIST` | `string` (comma-separated) | `""` | Domains to block (e.g., `"malware.com,evil.org"`). |
| `WEB_DOMAIN_ALLOWLIST` | `string` (comma-separated) | `""` | When non-empty, only these domains are allowed. |
| `WEB_ALLOW_HTTP` | `boolean` | `false` | Allow `http://` URLs (insecure). |
| `WEB_MAX_RESPONSE_BYTES` | `number` | `5242880` (5 MB) | Max HTTP response body size. |
| `WEB_MAX_CONTENT_CHARS` | `number` | `20000` | Max Markdown output length. |
| `WEB_USER_AGENT` | `string` | `"AgentLoop/1.0"` | User-Agent header for fetch requests. |
| `WEB_FETCH_TIMEOUT_MS` | `number` | `15000` | Fetch timeout in milliseconds. |
### 6. Write tests
- (a) URL sanitization strips `utm_*`, `fbclid`, `gclid` parameters.
- (b) Blocklisted domain rejected with descriptive error.
- (c) Allowlist-only mode rejects unlisted domains.
- (d) Private IP / SSRF URL rejected (e.g., `http://169.254.169.254/`, `http://localhost:3000/`).
- (e) `http://` URL rejected when `WEB_ALLOW_HTTP=false`.
- (f) HTML → Readability → Turndown pipeline produces clean Markdown from a fixture HTML file.
- (g) Content exceeding `WEB_MAX_CONTENT_CHARS` is truncated.
- (h) Search returns structured results (mock the HTTP layer).
---
## Recommended Libraries — Implementation Should Be Thin Glue Code
The agent-side code should be **< 50 lines per tool `execute` function**. All heavy lifting is delegated to proven, maintained libraries:
| Concern | Recommended Library | Why | Agent Code |
|---------|-------------------|-----|-----------|
| **Web Search (Option A — preferred if Task 2.8 is done)** | [Brave Search MCP Server](https://www.npmjs.com/package/@brave/brave-search-mcp-server) via MCP bridge (Task 2.8) | Official MCP server, free tier (2000 queries/mo), web+local+news search. **Zero agent-side search code** — just MCP config. | Config only |
| **Web Search (Option B)** | [Tavily API](https://tavily.com/) via direct HTTP or MCP remote (`mcp-remote https://mcp.tavily.com/mcp/`) | AI-optimized search results designed for agent use, generous free tier (1000 queries/mo). | ~20 lines |
| **Web Search (Option C — simplest standalone)** | Brave Search API via direct `fetch` to `https://api.search.brave.com/res/v1/web/search` | No MCP dependency. Simple API key + fetch wrapper. | ~30 lines |
| **Tracking param removal** | [`tidy-url`](https://www.npmjs.com/package/tidy-url) | Maintained, 1500+ rules, handles `utm_*`, `fbclid`, `gclid`, `mc_eid`, plus domain-specific patterns. | 1 function call |
| **Readable content extraction** | [`@mozilla/readability`](https://www.npmjs.com/package/@mozilla/readability) + [`jsdom`](https://www.npmjs.com/package/jsdom) | Mozilla's battle-tested reader-mode algorithm (powers Firefox Reader View). Industry standard for RAG content pipelines. | ~10 lines |
| **HTML → Markdown** | [`turndown`](https://www.npmjs.com/package/turndown) | Most popular HTML→Markdown converter. Configurable rules, plugin system, handles code blocks and tables. | ~5 lines |
| **SSRF prevention** | Manual `dns.resolve` + private-range check | Essential — the LLM generates arbitrary URLs. Must block requests to internal infrastructure. | ~20 lines |
### Preferred Architecture: MCP-First for Search, Native for Fetch
┌──────────────────────────────────────────────────────────────┐
│ web-search tool │
│ ┌──────────────────┐ OR ┌────────────────────────────┐ │
│ │ MCP bridge │ │ Direct HTTP fetch to │ │
│ │ (Brave/Tavily │ │ Brave/Tavily API │ │
│ │ MCP server) │ │ (~30 lines glue) │ │
│ └────────┬─────────┘ └─────────────┬──────────────┘ │
│ └──────────────┬─────────────────┘ │
│ ▼ │
│ { title, url, snippet }[] │
└──────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────┐
│ web-fetch tool │
│ │
│ URL ──▶ tidy-url ──▶ blocklist/allowlist ──▶ SSRF check │
│ │ │
│ ▼ │
│ fetch(url) ──▶ jsdom ──▶ @mozilla/readability │
│ │ │
│ ▼ │
│ turndown ──▶ Markdown │
│ │ │
│ truncate to limit │
└──────────────────────────────────────────────────────────────┘
### New Dependencies
| Package | Purpose | Size Impact |
|---------|---------|-------------|
| `tidy-url` | Tracking param removal | ~50 KB (pure JS, zero native deps) |
| `@mozilla/readability` | Article content extraction | ~40 KB (zero deps) |
| `jsdom` | DOM implementation for Readability | ~2 MB (likely already in devDeps for tests) |
| `turndown` | HTML → Markdown | ~30 KB (zero deps) |
**Total new production deps: 4.** Search backend is either an MCP server (no agent deps) or a simple `fetch` call (no new deps).
---
## Acceptance Criteria
- [ ] `web-search.execute({ query: "express.js middleware tutorial" })` returns an array of `{ title, url, snippet }` results with clean URLs (no tracking params).
- [ ] `web-fetch.execute({ url: "https://example.com/article?utm_source=twitter&fbclid=abc" })` fetches `https://example.com/article` (params stripped), returns Markdown content.
- [ ] A URL pointing to `http://169.254.169.254/` (AWS metadata) or `http://localhost:3000/` is rejected with a descriptive error.
- [ ] A blocklisted domain returns an error, not an HTTP request.
- [ ] When `WEB_SEARCH_PROVIDER=none`, the search tool returns an error instructing the user to configure a provider.
- [ ] Fetched content is truncated to `WEB_MAX_CONTENT_CHARS` without breaking mid-word.
- [ ] The search tool works with at least one of: Brave MCP (via Task 2.8), Brave direct HTTP, or Tavily direct HTTP.
- [ ] All URL sanitization, blocklist, allowlist, and SSRF tests pass without network calls.
## Test Requirements
- **Unit tests** for `web-utils.ts`: URL sanitization, blocklist/allowlist, SSRF protection, protocol enforcement (no network calls).
- **Integration tests** for the Readability + Turndown pipeline using fixture HTML files.
- **Mock-HTTP tests** for both `web-search` and `web-fetch` tools.
- **One optional smoke test** gated by `WEB_SEARCH_SMOKE=true` that hits a real search API (not in CI by default).
## Guidelines
- Keep the tool files thin — delegate to `web-utils.ts` for URL handling and to libraries for content extraction. Each tool's `execute` function should be **< 50 lines**.
- `web-search` and `web-fetch` are **separate tools** so the LLM can search without fetching (cheaper/faster) or fetch a known URL without searching.
- Permission level is `"cautious"` (not `"dangerous"`) — no local filesystem or shell access, but network access warrants audit logging.
- **Never inject raw HTML into the context window.** All content passes through the Readability + Turndown pipeline.
- Follow the same patterns as existing tools (`shell.ts`, `file-edit.ts`, etc.) — export a `toolDefinition` constant.
</issue_description>
## Comments on the Issue (you are @copilot in this section)
<comments>
</comments>
Using Git URL: https://github.com/huberp/agentloop
Cloning into '/home/runner/work/agentloop/agentloop'...
Unsetting existing git config credential.helper (global)
Unsetting existing git config credential.username (global)
Unsetting existing git config user.name (global)
Unsetting existing git config user.email (global)
Unsetting existing git config pull.rebase (global)
MCP transport enabled
Fetching tools from MCP server
(node:3768) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
Base commit 'main' not found locally, attempting to fetch from remote
From https://github.com/huberp/agentloop
* branch main -> FETCH_HEAD
Resolved base commit 'main' to SHA: b0cfce4a3fccb53ab923662e1e6a0ff1b762d97b (via FETCH_HEAD)
::debug::isExplicit: 2.24.3
::debug::explicit? true
::debug::isExplicit: 2.24.3
::debug::explicit? true
::debug::checking cache: /opt/hostedtoolcache/CodeQL/2.24.3/x64
::debug::Found tool in cache CodeQL 2.24.3 x64
CodeQL directory found in toolcache at '/opt/hostedtoolcache/CodeQL/2.24.3/x64'.
GitHub Code Search cannot be used because the repository is not indexed
GitHub Code Search tool could not be created (repo is not indexed)!
Memory enablement check: enabled
Using custom agent "Default" for the task.
git rev-parse HEAD
771d62c11eba90c9cd177ca5bf0d506da77e5ebd
copilot: Let me start by exploring the repository to understand the codebase structure and then plan my implementation.
function:
name: view
args:
path: /home/runner/work/agentloop/agentloop
result: |
.dockerignore
.env.example
.git
.github
.gitignore
CHANGELOG.md
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
benchmarks
docs
jest.e2e.config.js
package-lock.json
package.json
src
tests
tsconfig.bench.json
tsconfig.e2e.json
tsconfig.json
function:
name: bash
args:
command: cd /home/runner/work/agentloop/agentloop && git log --oneline -10 && git status
description: Check git status and recent commits
result: |
771d62c (HEAD -> copilot/add-websearch-tool, origin/copilot/add-websearch-tool) Initial plan
b0cfce4 (grafted) feat: split plan-and-run into plan + run tools; fix spinner/progress interleave
On branch copilot/add-websearch-tool
Your branch is up to date with 'origin/copilot/add-websearch-tool'.
nothing to commit, working tree clean
<exited with exit code 0>
function:
name: view
args:
path: /home/runner/work/agentloop/agentloop/src
result: |
__tests__
agents
config.ts
context.ts
errors.ts
index.ts
instructions
llm.ts
logger.ts
mcp
observability.ts
orchestrator.ts
prompts
retry.ts
sandbox
security.ts
skills
spinner.ts
streaming.ts
subagents
testing
tools
workspace.ts
function:
name: view
args:
path: /home/runner/work/agentloop/agentloop/src/tools
result: |
calculate.ts
code-run.ts
code-search.ts
diff.ts
file-delete.ts
file-edit.ts
file-list.ts
file-read.ts
file-utils.ts
file-write.ts
git-commit.ts
git-diff.ts
git-log.ts
git-status.ts
patch.ts
plan-and-run.ts
plan.ts
registry.ts
run.ts
sanitize.ts
search.ts
shell.ts
function:
name: view
args:
path: /home/runner/work/agentloop/agentloop/src/config.ts
result: |
1. import * as dotenv from "dotenv";
2.
3. dotenv.config({ quiet: true });
4.
5. function asBoolean(value: string | undefined, defaultValue: boolean): boolean {
6. if (value === undefined) {
7. return defaultValue;
8. }
9.
10. return value.toLowerCase() === "true";
11. }
12.
13. /** Parse a comma-separated env var into a trimmed, non-empty string array. */
14. function asStringArray(value: string | undefined): string[] {
15. if (!value) return [];
16. return value
17. .split(",")
18. .map((s) => s.trim())
19. .filter(Boolean);
20. }
21.
22. /** Shape of a single entry in the MCP_SERVERS configuration array. */
23. interface McpServerEntry {
24. name: string;
25. transport: "stdio" | "sse";
26. command?: string;
27. args?: string[];
28. url?: string;
29. }
30.
31. /** Parse MCP_SERVERS as a JSON array; returns an empty array on missing or invalid input. */
32. function parseMcpServers(value: string | undefined): McpServerEntry[] {
33. if (!value) return [];
34. try {
35. const parsed = JSON.parse(value);
36. return Array.isArray(parsed) ? (parsed as McpServerEntry[]) : [];
37. } catch {
38. return [];
39. }
40. }
41.
42. export const appConfig = {
43. mistralApiKey: process.env.MISTRAL_API_KEY ?? "",
44. // Maximum number of agentic iterations before aborting with a warning
45. maxIterations: parseInt(process.env.MAX_ITERATIONS ?? "20", 10),
46. // Token budget reserved for future context-window management (0 = disabled)