Skip to content

[log] Add debug logging to server/guard_pipeline.go - #16634

Merged
lpcox merged 5 commits into
mainfrom
log/guard-pipeline-logging-786c60783c2246fb
Nov 18, 2026
Merged

lpcox merged 5 commits into
mainfrom
log/guard-pipeline-logging-786c60783c2246fb

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds a logGuardPipeline logger (server:guard_pipeline, via logger.ForFile()) to internal/server/guard_pipeline.go, which previously had none.

Logging added in buildPipelineInput:

  • Entry: server ID, tool name, and hashed session ID (via util.FormatSessionIDForLog)
  • Guard initialization failure path
  • Pipeline input ready: enforcement mode and whether payload redaction is active

The SensitiveLogging value is now computed once into a local variable and reused, with no change in behavior. No tool arguments or payloads are logged.

Validation: go vet ./internal/server, go test ./internal/server, 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 15, 2026
@lpcox
lpcox marked this pull request as ready for review November 18, 2026 15:31
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 15:31

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.

🟡 Changes recommended

A critical active finding remains because enclave-session initialization errors may log private selectors or response details without the required redaction.

1 open issue
What changed in this PR

Adds debug-level observability to the server guard pipeline while preserving existing behavior and avoiding direct logging of tool arguments or payloads.

Changes:

  • Adds a server:guard_pipeline logger via logger.ForFile().
  • Logs pipeline construction, guard initialization failures, and completed pipeline metadata.
  • Reuses the computed payload-redaction state for pipeline input construction.
  • Requires enclave-aware redaction for guard initialization errors before logging.
File Description
internal/​server/​guard_pipeline.go Adds guard-pipeline debug logging and reuses the computed payload-redaction state.

Review effort: Lite (adaptive)

Comment thread internal/server/guard_pipeline.go Resolved
@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@lpcox

lpcox commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@copilot fix the failing lint ci check

Comment thread internal/server/guard_pipeline.go Resolved
@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

This comment has been minimized.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the failing lint ci check

Fixed in commit 4af5193: the debug log no longer references the formatter missing from the PR merge base. make lint and go test ./internal/server pass locally. The latest CI run is action_required and has no jobs, so it has not revalidated this commit.

Copilot AI requested a review from lpcox November 18, 2026 16:08
Comment thread internal/server/guard_pipeline.go Resolved
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@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 (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 6 target tools absent from the 23-tool read-only catalog BLOCKED ⚠️ INCONCLUSIVE
C CLI reads (issues/file) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) gh CLI not authenticated BLOCKED ⚠️ INCONCLUSIVE
E CLI GraphQL mutations gh CLI not authenticated BLOCKED ⚠️ INCONCLUSIVE

Overall: INCONCLUSIVE

Notes:

  • Part A/C: all 4 MCP reads and 2 CLI reads succeeded via the github proxy CLI on PATH (backed by awmg-mcpg gateway), confirming read access works.
  • Part B: the gateway-fronted GitHub MCP server exposes only 23 read-only tools (get_commit, get_file_contents, list_issues, list_pull_requests, list_commits, search_*, etc.) — no write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are present in the catalog at all. Per gh-aw's architecture, tools.github: always sets GITHUB_READ_ONLY=1 on the backend, so write tools never reach the gateway to begin with. This confirms backend/toolset read-only configuration but does not independently exercise mcpg's own DIFC/guard write-blocking layer (no write tool call ever reached a write-capable backend). Per the task's own methodology, this is recorded as INCONCLUSIVE, not PASS.
  • Part D/E: gh auth status reported "You are not logged into any GitHub hosts" — gh CLI is unauthenticated in this environment, so REST/GraphQL write attempts could not be executed to validate the token-scope boundary. Recorded as INCONCLUSIVE per instructions (no writes attempted/leaked).
  • No write succeeded on any surface; no artifacts were created, starred, commented, or branched.

Result file: /tmp/gh-aw/agent/readonly-stress-result-44350374214.txt → RESULT=INCONCLUSIVE RUNTIME=default RUNID=44350374214

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

@lpcox
lpcox merged commit e357a8b into main Nov 18, 2026
28 checks passed
@lpcox
lpcox deleted the log/guard-pipeline-logging-786c60783c2246fb branch November 18, 2026 16:49
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.

4 participants