Skip to content

[log] Add debug logging to middleware URL domain audit - #16880

Merged
lpcox merged 1 commit into
mainfrom
log/url-audit-debug-logging-5728c598783e6632
Nov 20, 2026
Merged

lpcox merged 1 commit into
mainfrom
log/url-audit-debug-logging-5728c598783e6632

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds debug logging to internal/middleware/url_audit.go (middleware:url_audit, via logger.ForFile()).

  • Logs when the audit is disabled, when there is no response data, and when no URL domains are observed.
  • Logs the server, tool, and domain count before recording observed domains.
  • Log arguments are plain values only; there are no side effects and no domains or payload content are logged.

Validation: go vet ./internal/middleware, go test ./internal/middleware, and go build all pass.

Generated by Go Logger Enhancement · copilot · routed: sonnet55 high · ~35 AIC · ⊞ 5.9K · ◷

@github-actions github-actions Bot added automation enhancement New feature or request labels Nov 19, 2026
@lpcox
lpcox marked this pull request as ready for review November 20, 2026 00:44
Copilot AI adaptive review requested due to automatic review settings November 20, 2026 00:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active issues were identified, and the change is narrowly scoped to opt-in control-flow logging while preserving existing URL auditing and avoiding sensitive value logging.

No open issues 🎉

What changed in this PR

Adds opt-in debug logging to the middleware URL-domain audit path while preserving existing auditing behavior and avoiding payload or domain-value logging.

Changes:

  • Adds a middleware:url_audit logger via logger.ForFile().
  • Logs disabled auditing, missing response data, empty domain results, and domain-recording counts.
  • Preserves existing URL extraction and persistence behavior.
File Description
internal/​middleware/​url_audit.go Adds debug logging around URL-domain audit control flow and domain recording.

Review effort: Lite (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default (AWF default container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned (200) ALLOWED ✅
B MCP writes (add_issue_comment/star_repository/issue_write/create_branch/create_or_update_file/create_pull_request) all 7 targets absent from the 23-tool read-only catalog ("unknown tool") — not a gateway-level refusal BLOCKED ⚠️
C CLI reads via github CLI data returned (200) ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) gh not authenticated (no GH_TOKEN) — could not reach GitHub API to test BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) same auth gap as D — not executed BLOCKED ⚠️

Overall: INCONCLUSIVE

(⚠️ = Part B write tools were entirely absent from the backend tool catalog — gh-aw always launches tools.github: with GITHUB_READ_ONLY=1, so write tools never register, which proves backend config, not mcpg's own gateway-level DIFC/guard blocking layer. Parts D/E: gh had no GH_TOKEN in this job, so REST/GraphQL write attempts failed before reaching GitHub, leaving the token-scope boundary unverified this run.)

No write of any kind leaked on any surface (reads all succeeded; no reaction/star/issue/comment/branch/file/PR was created). Full detail in /tmp/gh-aw/agent/readonly-stress-44637723426.txt.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit 554642f into main Nov 20, 2026
28 checks passed
@lpcox
lpcox deleted the log/url-audit-debug-logging-5728c598783e6632 branch November 20, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants