@@ -85,6 +85,18 @@ func LabelListIssues(isPrivate bool) SecurityLabel {
8585 return PublicUntrusted ()
8686}
8787
88+ // LabelRepoUserContent returns the IFC label for user-authored content scoped
89+ // to a repository when that tool has not opted into a more specific integrity
90+ // policy. Confidentiality follows repository visibility, while integrity stays
91+ // untrusted because the payload can contain free-form issue, pull request,
92+ // discussion, review, or comment text.
93+ func LabelRepoUserContent (isPrivate bool ) SecurityLabel {
94+ if isPrivate {
95+ return PrivateUntrusted ()
96+ }
97+ return PublicUntrusted ()
98+ }
99+
88100// LabelGetFileContents returns the IFC label for a get_file_contents result.
89101// Public repository file contents may be authored by anyone via pull requests
90102// and are therefore untrusted. In private repositories only collaborators can
@@ -100,11 +112,13 @@ func LabelGetFileContents(isPrivate bool) SecurityLabel {
100112// result, joining per-repository labels across all matched repositories.
101113// Used by both search_issues and search_repositories.
102114//
103- // Public-only results are untrusted and public. If any matched repository is
104- // private, the joined label is trusted and private because private repository
105- // content is treated as trusted collaborator-authored data. The reader set is
106- // opaque (the "private" marker); the client engine resolves concrete readers
107- // on demand at egress decision time.
115+ // Public-only results are untrusted and public. All-private results are trusted
116+ // and private because private repository content is treated as trusted
117+ // collaborator-authored data. Mixed public/private results are untrusted and
118+ // private: the public items keep the joined payload's integrity untrusted,
119+ // while the private items keep the joined payload's confidentiality private.
120+ // The reader set is opaque (the "private" marker); the client engine resolves
121+ // concrete readers on demand at egress decision time.
108122//
109123// An empty result set is treated as public-untrusted (no repository data is
110124// leaked).
@@ -119,12 +133,22 @@ func LabelGetFileContents(isPrivate bool) SecurityLabel {
119133// until then they would invite unsafe declassification of a "public" item that
120134// actually arrived alongside private data.
121135func LabelSearchIssues (repoVisibilities []bool ) SecurityLabel {
136+ var anyPrivate , anyPublic bool
122137 for _ , isPrivate := range repoVisibilities {
123138 if isPrivate {
124- return PrivateTrusted ()
139+ anyPrivate = true
140+ } else {
141+ anyPublic = true
125142 }
126143 }
127- return PublicUntrusted ()
144+ switch {
145+ case anyPrivate && anyPublic :
146+ return PrivateUntrusted ()
147+ case anyPrivate :
148+ return PrivateTrusted ()
149+ default :
150+ return PublicUntrusted ()
151+ }
128152}
129153
130154// LabelRepoMetadata returns the IFC label for structural repository metadata
0 commit comments