Repository navigation
Cover security-alert updates in the GitHub guard - #17085
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Critical response-labeling defects can expose private alert details, return errors after completed backend mutations, and discard upstream error status.
5 open issues
What changed in this PR
This PR extends the GitHub guard to cover three security-alert update tools, addressing #17054. It separates mutation admission from read checks on returned alert data.
Changes:
- Add explicit write classification and repository-scoped labels for all three update tools.
- Enforce private, tool-specific response labels and independent read checks.
- Add regression coverage and document request-versus-response labeling.
| File | Description |
|---|---|
internal/server/call_backend_tool_wasm_integration_test.go |
Add compiled-guard alert-update regressions. |
internal/guard/pipeline.go |
Introduce independent response read checks. |
internal/guard/pipeline_test.go |
Cover response filtering, propagation, and missing labels. |
guards/github-guard/rust-guard/src/tools.rs |
Classify the three tools as writes. |
guards/github-guard/rust-guard/src/lib.rs |
Test repository-scoped mutation labels. |
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Apply repository visibility and writer integrity. |
guards/github-guard/rust-guard/src/labels/response_items.rs |
Label returned security alerts privately. |
guards/github-guard/rust-guard/src/labels/mod.rs |
Test private, tool-specific response labels. |
guards/github-guard/rust-guard/src/labels/constants.rs |
Define shared alert-update tool constants. |
guards/github-guard/docs/SECRECY_TAG_SPEC.md |
Document separate request and response secrecy. |
guards/github-guard/docs/INTEGRITY_TAG_SPEC.md |
Document writer integrity for update requests. |
Review effort: Max (adaptive)
| | tool_names::UPDATE_CODE_SCANNING_ALERT | ||
| | tool_names::UPDATE_DEPENDABOT_ALERT | ||
| | tool_names::UPDATE_SECRET_SCANNING_ALERT => { |
There was a problem hiding this comment.
Fixed fallback labeling so security-alert update error and opaque responses receive private, tool-specific response labels. Commit: 3eae105.
| AgentLabels: agentLabels, | ||
| Resource: resource, | ||
| Operation: operation, | ||
| ResponseIsRead: requiresResponseRead(in.ToolName), |
There was a problem hiding this comment.
Excluded NoopGuard and WriteSinkGuard from the independent response-label requirement; configured labeling guards remain fail-closed. Commit: 3eae105.
| // The ctx must carry the request state set by RunPipelinePrePhases (tool args for the guard). | ||
| func RunPipelinePhase4(ctx context.Context, in PipelineInput, pre *PipelinePreResult, responseData interface{}) (difc.LabeledData, error) { | ||
| if !difc.ShouldCallLabelResponse(pre.Operation, in.EnforcementMode) && | ||
| if !difc.ShouldCallLabelResponse(pre.responseOperation(), in.EnforcementMode) && |
There was a problem hiding this comment.
Readable singleton update responses now retain the original MCP envelope and upstream isError status; withheld responses return no original payload. Commit: 3eae105.
| pre.AgentLabels.Secrecy, | ||
| pre.AgentLabels.Integrity, | ||
| pre.Operation, | ||
| pre.responseOperation(), |
There was a problem hiding this comment.
Post-mutation labeling or read-filter failures now return a sanitized “update sent, response withheld” status with verification guidance instead of a generic error. Commit: 3eae105.
| // was skipped or unavailable. | ||
| func RunPipelinePhase6(pre *PipelinePreResult, labeledData difc.LabeledData, enforcementMode difc.EnforcementMode) { | ||
| if !difc.ShouldAccumulateReadLabels(pre.Operation, enforcementMode) { | ||
| if !difc.ShouldAccumulateReadLabels(pre.responseOperation(), enforcementMode) { |
There was a problem hiding this comment.
Both Phase 6 accumulation logs now hash the agent/session identifier with util.HashIdentifierForLog. Commit: 3eae105.
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No writes were leaked; no artifacts were created. Reads (Parts A/C) fully passed on both tool-call and CLI surfaces.
|


update_code_scanning_alert,update_dependabot_alert, andupdate_secret_scanning_alertlacked explicit mutation classification and DIFC rules. Pure-write handling also skipped response checks, allowing returned security-alert data to bypass private labels.