Skip to content

Commit 0eb9816

Browse files
lpcoxCopilot
andauthored
fix: correct integrity level descriptions and auto-enable cli-proxy for reactions (#26154)
* fix: correct integrity level descriptions and auto-enable cli-proxy for reactions Three changes: 1. Fix incorrect min-integrity: unapproved descriptions in the maintaining-repos guide. The guide incorrectly described unapproved as allowing 'all community content' including 'everyone', which is the behavior of min-integrity: none. Fixed to accurately describe unapproved as including CONTRIBUTOR and FIRST_TIME_CONTRIBUTOR while filtering out FIRST_TIMER and NONE association. 2. Compiler: implicitly enable cli-proxy when integrity-reactions feature flag is set. Reaction-based integrity decisions require the proxy to identify reaction authors, so cli-proxy must be active. This avoids requiring users to set both features.integrity-reactions: true and features.cli-proxy: true manually. 3. Docs: rewrite integrity-reactions section to describe compiler defaults rather than showing explicit frontmatter for endorsement-reactions, disapproval-reactions, endorser-min-integrity, and disapproval-integrity. Note availability in v0.68.2 and clarify that reactions only work in proxy mode (not gateway mode). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: remove proxy mode warning from reactions section Since the compiler now implicitly enables cli-proxy when integrity-reactions: true is set, the warning about proxy mode is unnecessary — reactions are guaranteed to run through the proxy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4fba480 commit 0eb9816

File tree

4 files changed

+130
-21
lines changed

4 files changed

+130
-21
lines changed

docs/src/content/docs/guides/maintaining-repos.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Review the newly opened issue. Based on the issue content:
5050
5. Otherwise, post a comment thanking the contributor and explaining what information is still needed.
5151
```
5252

53-
`min-integrity: unapproved` allows repo-assist to see all community content — first-time contributors, external users, everyone. The `safe-outputs` block limits what repo-assist can do in response: it can only apply labels and post comments. Any other GitHub mutation (opening PRs, merging, closing issues) is blocked by the runtime, regardless of what the agent attempts.
53+
`min-integrity: unapproved` allows repo-assist to see content from contributors who have previously interacted with the repository — including first-time contributors and users who have had PRs merged before — while still filtering out content from brand-new GitHub users (`FIRST_TIMER`) and users with no repository association (`NONE`). For most active repositories, this captures the vast majority of community input. The `safe-outputs` block limits what repo-assist can do in response: it can only apply labels and post comments. Any other GitHub mutation (opening PRs, merging, closing issues) is blocked by the runtime, regardless of what the agent attempts.
5454

5555
### Routing to Downstream Agents
5656

@@ -134,7 +134,7 @@ When a safe-output validation failure appears in your audit logs, it means the a
134134

135135
## Controlling Workflow Inputs with Integrity Filtering
136136

137-
Integrity filtering is the primary mechanism for controlling what content the agent sees. It evaluates the author of each issue, PR, or comment and removes items that don't meet the configured trust threshold — before the agent's context is assembled. Every public repository automatically applies `min-integrity: approved` as a baseline — repo-assist overrides this to `unapproved` so it can see all incoming issues.
137+
Integrity filtering is the primary mechanism for controlling what content the agent sees. It evaluates the author of each issue, PR, or comment and removes items that don't meet the configured trust threshold — before the agent's context is assembled. Every public repository automatically applies `min-integrity: approved` as a baseline — repo-assist overrides this to `unapproved` so it can see issues from contributors and first-time contributors, not just trusted members.
138138

139139
The four configurable levels, from most to least restrictive:
140140

@@ -147,7 +147,7 @@ The four configurable levels, from most to least restrictive:
147147

148148
Choose based on what the workflow does:
149149

150-
- **Repo-assist / triage workflows**: `unapproved` — classify all community content without acting on it.
150+
- **Repo-assist / triage workflows**: `unapproved` — classify content from contributors and first-time contributors without acting on it.
151151
- **Code-modifying workflows** (open PRs, apply patches, close issues): `approved` or `merged` — only act on trusted input.
152152
- **Spam detection or analytics**: `none` — see everything, but produce no direct GitHub mutations.
153153

@@ -202,30 +202,27 @@ The runtime automatically merges per-workflow values with the variable. Set thes
202202

203203
### Reactions as Trust Signals
204204

205-
Starting from MCPG v0.2.18, maintainers can use GitHub reactions (👍, ❤️) to promote content past the integrity filter without modifying labels. This is useful in repo-assist workflows where a maintainer wants to fast-track an external contribution:
205+
Starting from gh-aw v0.68.2, maintainers can use GitHub reactions (👍, ❤️) to promote content past the integrity filter without modifying labels. This is useful in repo-assist workflows where a maintainer wants to fast-track an external contribution.
206+
207+
To enable reactions, add the `integrity-reactions` feature flag:
206208

207209
```aw wrap
208210
features:
209211
integrity-reactions: true
210-
mcp-gateway:
211-
version: "v0.2.18"
212212
tools:
213213
github:
214214
min-integrity: approved
215-
endorsement-reactions:
216-
- "THUMBS_UP"
217-
- "HEART"
218-
disapproval-reactions:
219-
- "THUMBS_DOWN"
220-
- "CONFUSED"
221-
endorser-min-integrity: approved
222-
disapproval-integrity: none
223215
```
224216

225-
When a trusted member (at or above `endorser-min-integrity`) adds an endorsement reaction to an issue or comment, the item's integrity is promoted to `approved`. A disapproval reaction demotes it to the level set by `disapproval-integrity`.
217+
The compiler handles the rest — when `integrity-reactions: true` is set, it automatically:
218+
219+
- Enables the CLI proxy (`cli-proxy: true`), which is required for reaction-based integrity decisions
220+
- Injects default endorsement reactions: `THUMBS_UP`, `HEART`
221+
- Injects default disapproval reactions: `THUMBS_DOWN`, `CONFUSED`
222+
- Uses `endorser-min-integrity: approved` (only reactions from owners, members, and collaborators count)
223+
- Uses `disapproval-integrity: none` (a disapproval reaction demotes content to `none`)
226224

227-
> [!IMPORTANT]
228-
> Reactions only work when running through the MCPG proxy mode. They are not available in gateway mode.
225+
These defaults mean that when a trusted member (owner, member, or collaborator) adds a 👍 or ❤️ reaction to an issue or comment, the item's integrity is promoted to `approved` — making it visible to agents using `min-integrity: approved`. Conversely, a 👎 or 😕 reaction from a trusted member demotes the item to `none`.
229226

230227
See the [Integrity Filtering Reference](/gh-aw/reference/integrity/) for complete configuration details.
231228

pkg/workflow/compiler_difc_proxy.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,22 @@ func (c *Compiler) generateStopDIFCProxyStep(yaml *strings.Builder, data *Workfl
334334
// isCliProxyNeeded returns true if the CLI proxy should be started on the host.
335335
//
336336
// The CLI proxy is needed when:
337-
// 1. The cli-proxy feature flag is enabled, and
337+
// 1. The cli-proxy feature flag is enabled (explicitly or implicitly), and
338338
// 2. The AWF sandbox (firewall) is enabled, and
339339
// 3. The AWF version supports CLI proxy flags
340+
//
341+
// The cli-proxy feature is implicitly enabled when integrity-reactions is enabled,
342+
// because reaction-based integrity decisions require the proxy to identify reaction authors.
340343
func isCliProxyNeeded(data *WorkflowData) bool {
341-
if !isFeatureEnabled(constants.CliProxyFeatureFlag, data) {
344+
cliProxyEnabled := isFeatureEnabled(constants.CliProxyFeatureFlag, data)
345+
integrityReactionsEnabled := isFeatureEnabled(constants.IntegrityReactionsFeatureFlag, data)
346+
347+
if !cliProxyEnabled && !integrityReactionsEnabled {
342348
return false
343349
}
350+
if integrityReactionsEnabled && !cliProxyEnabled {
351+
difcProxyLog.Print("integrity-reactions enabled: implicitly enabling CLI proxy")
352+
}
344353
if !isFirewallEnabled(data) {
345354
return false
346355
}

pkg/workflow/compiler_difc_proxy_test.go

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,3 +810,103 @@ func TestResolveProxyContainerImage(t *testing.T) {
810810
})
811811
}
812812
}
813+
814+
// TestIsCliProxyNeeded_IntegrityReactionsImplicitEnable verifies that the CLI proxy
815+
// is implicitly enabled when the integrity-reactions feature flag is set, even without
816+
// an explicit cli-proxy feature flag.
817+
func TestIsCliProxyNeeded_IntegrityReactionsImplicitEnable(t *testing.T) {
818+
awfVersion := "0.25.20"
819+
820+
tests := []struct {
821+
name string
822+
data *WorkflowData
823+
expected bool
824+
desc string
825+
}{
826+
{
827+
name: "integrity-reactions enables cli proxy implicitly",
828+
data: &WorkflowData{
829+
NetworkPermissions: &NetworkPermissions{
830+
Firewall: &FirewallConfig{
831+
Enabled: true,
832+
Version: awfVersion,
833+
},
834+
},
835+
Features: map[string]any{"integrity-reactions": true},
836+
},
837+
expected: true,
838+
desc: "integrity-reactions should implicitly enable the CLI proxy",
839+
},
840+
{
841+
name: "explicit cli-proxy still works",
842+
data: &WorkflowData{
843+
NetworkPermissions: &NetworkPermissions{
844+
Firewall: &FirewallConfig{
845+
Enabled: true,
846+
Version: awfVersion,
847+
},
848+
},
849+
Features: map[string]any{"cli-proxy": true},
850+
},
851+
expected: true,
852+
desc: "explicit cli-proxy feature flag should still enable the CLI proxy",
853+
},
854+
{
855+
name: "both flags enabled",
856+
data: &WorkflowData{
857+
NetworkPermissions: &NetworkPermissions{
858+
Firewall: &FirewallConfig{
859+
Enabled: true,
860+
Version: awfVersion,
861+
},
862+
},
863+
Features: map[string]any{"cli-proxy": true, "integrity-reactions": true},
864+
},
865+
expected: true,
866+
desc: "both flags together should enable the CLI proxy",
867+
},
868+
{
869+
name: "neither flag set",
870+
data: &WorkflowData{
871+
NetworkPermissions: &NetworkPermissions{
872+
Firewall: &FirewallConfig{
873+
Enabled: true,
874+
Version: awfVersion,
875+
},
876+
},
877+
Features: map[string]any{},
878+
},
879+
expected: false,
880+
desc: "no feature flags should not enable the CLI proxy",
881+
},
882+
{
883+
name: "integrity-reactions without firewall",
884+
data: &WorkflowData{
885+
Features: map[string]any{"integrity-reactions": true},
886+
},
887+
expected: false,
888+
desc: "integrity-reactions without firewall should not enable the CLI proxy",
889+
},
890+
{
891+
name: "integrity-reactions with old AWF version",
892+
data: &WorkflowData{
893+
NetworkPermissions: &NetworkPermissions{
894+
Firewall: &FirewallConfig{
895+
Enabled: true,
896+
Version: "v0.25.16",
897+
},
898+
},
899+
Features: map[string]any{"integrity-reactions": true},
900+
},
901+
expected: false,
902+
desc: "integrity-reactions with old AWF version should not enable the CLI proxy",
903+
},
904+
}
905+
906+
for _, tt := range tests {
907+
t.Run(tt.name, func(t *testing.T) {
908+
got := isCliProxyNeeded(tt.data)
909+
assert.Equal(t, tt.expected, got, tt.desc)
910+
})
911+
}
912+
}

pkg/workflow/docker.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,13 @@ func collectDockerImages(tools map[string]any, workflowData *WorkflowData, actio
103103
}
104104
}
105105

106-
// Add cli-proxy sidecar container when the cli-proxy feature flag is enabled
106+
// Add cli-proxy sidecar container when the cli-proxy is needed (explicitly via
107+
// cli-proxy feature flag, or implicitly via integrity-reactions feature flag)
107108
// and the AWF version supports it. Without this, --skip-pull causes AWF to fail
108109
// because the cli-proxy image was never pulled.
109-
if isFeatureEnabled(constants.CliProxyFeatureFlag, workflowData) && awfSupportsCliProxy(firewallConfig) {
110+
cliProxyNeeded := isFeatureEnabled(constants.CliProxyFeatureFlag, workflowData) ||
111+
isFeatureEnabled(constants.IntegrityReactionsFeatureFlag, workflowData)
112+
if cliProxyNeeded && awfSupportsCliProxy(firewallConfig) {
110113
cliProxyImage := constants.DefaultFirewallRegistry + "/cli-proxy:" + awfImageTag
111114
if !imageSet[cliProxyImage] {
112115
images = append(images, cliProxyImage)

0 commit comments

Comments
 (0)