Repository navigation
Consolidate allowlist builders, agent policy guards, and JSONL tag copying - #16478
Merged
Merged
Conversation
4 tasks
…pying Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Gaps:
No writes leaked in any part. Full detail: /tmp/gh-aw/agent/readonly-stress-43508518390.txt
|
lpcox
marked this pull request as ready for review
November 13, 2026 22:33
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the refactor consolidating duplicated gateway server and logging logic.
No open issues 🎉
What changed in this PR
Consolidates three duplicated patterns in the gateway’s server and logging code, preserving existing allowlist, authorization, and tag snapshot behavior.
Changes:
- Shares tool and prompt allowlist construction.
- Centralizes agent policy enforcement and denial logging.
- Reuses defensive JSONL tag copying and adds focused regression coverage.
| File | Description |
|---|---|
internal/server/tool_registry_helpers.go |
Extracts the shared allowlist builder behind existing wrappers. |
internal/server/allowed_sets_test.go |
Tests empty lists, wildcards, deduplication, and unchanged inputs. |
internal/server/agent_policy_enforce.go |
Shares policy lookup, enforcement, and denial logging. |
internal/server/agent_policy_enforce_test.go |
Covers missing policies and server/tool access boundaries. |
internal/logger/jsonl_logger.go |
Shares defensive tag copying across normal and redacted logging. |
internal/logger/jsonl_logger_test.go |
Verifies independent tag snapshots and omission of empty tags. |
Review effort: Max (dynamic)
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three near-duplicate patterns can share implementations without changing allowlist semantics, authorization decisions, or tag snapshot ownership.
Focused regression coverage captures these invariants. Policy denial logs now identify the shared helper.