Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

Add domain blocklist support

This PR adds support for --block-domains to block specific domains while allowing others, as requested in githubnext/gh-aw-firewall#114.

Implementation Complete:

  • Add Blocked field to NetworkPermissions struct
  • Update JSON schema to support blocked field in network configuration
  • Add domain blocklist merging functions (GetBlockedDomains, formatBlockedDomains)
  • Update Copilot engine to pass --block-domains to AWF
  • Update Claude engine to pass --block-domains to AWF
  • Update Codex engine to pass --block-domains to AWF
  • Add blocked domains extraction in frontmatter parser (fixes compilation from markdown)
  • Add comprehensive unit tests (all passing ✅)
  • Add firewall integration tests (all passing ✅)
  • Add blocked domains integration tests (5 new tests)
  • Add smoke test workflows for all three engines
  • Update documentation with blocked domains examples and use cases
  • Add example workflow demonstrating the feature (moved to pkg/cli/workflows/)
  • Merged main branch (up to date)
  • Fixed linting issues (testifylint, trailing whitespace)

Test Results:

✅ TestGetBlockedDomains - 7/7 subtests passed
✅ TestFormatBlockedDomains - 5/5 subtests passed
✅ TestBlockedDomainsWithEngines - 1/1 subtests passed
✅ TestFirewallBlockedDomainsInCopilotEngine - 3/3 subtests passed
✅ TestFirewallBlockedDomainsInClaudeEngine - 1/1 subtests passed
✅ TestFirewallBlockedDomainsInCodexEngine - 1/1 subtests passed
✅ TestBlockedDomainsIntegration - 5/5 subtests passed
✅ Linting - All checks passed

Integration Tests (pkg/workflow/blocked_domains_integration_test.go):

  • Tests blocked domains compilation for Copilot, Claude, and Codex engines
  • Verifies --block-domains flag appears correctly in compiled workflows
  • Verifies ecosystem identifier expansion (e.g., pythonpypi.org, files.pythonhosted.org)
  • Tests that workflows without blocked domains don't include the flag

Smoke Test Workflows (pkg/cli/workflows/test-*-blocked-domains.md):

  • test-copilot-blocked-domains.md - Blocks PyPI domains while allowing GitHub
  • test-claude-blocked-domains.md - Blocks NPM domains while allowing GitHub
  • test-codex-blocked-domains.md - Blocks custom example domains while allowing GitHub
  • Each validates allowed/blocked domain functionality end-to-end

Key Features:

  • Supports individual domains: tracker.example.com, analytics.example.com
  • Supports ecosystem identifiers: python, node, etc.
  • Blocked domains take precedence over allowed domains
  • Automatically sorts and deduplicates blocked domains
  • Only adds --block-domains flag when blocked domains are specified
  • Works with Copilot, Claude, and Codex engines

Documentation:

  • Added blocked field description to network reference
  • Added usage examples and common use cases
  • Updated full frontmatter reference
  • Created example workflow in pkg/cli/workflows/example-blocked-domains.md

Ref: githubnext/gh-aw-firewall#114


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Changeset

  • Type: patch
  • Description: Add domain blocklist support via the --block-domains flag and the blocked frontmatter field. This enables specifying domains or ecosystem identifiers to block in workflows and ensures the flag is only added when blocked domains are present.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

Copilot AI changed the title [WIP] Add domain blocklist support Add domain blocklist support via --block-domains flag Jan 6, 2026
Copilot AI requested a review from mnkiefer January 6, 2026 02:59
@@ -0,0 +1,30 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot move to pkg/cli/tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to pkg/cli/workflows/ in commit 9f7de6f.

Copilot AI requested a review from pelikhan January 6, 2026 03:07
@pelikhan pelikhan assigned Mossaka and unassigned mnkiefer Jan 6, 2026
@Mossaka
Copy link
Collaborator

Mossaka commented Jan 6, 2026

@copilot add more integration tests and to smoke tests to verify that this update is valid.

Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot add more integration tests and to smoke tests to verify that this update is valid.

Added comprehensive integration tests and smoke tests in commit fab5374:

Integration Tests (pkg/workflow/blocked_domains_integration_test.go):

  • 5 new tests covering blocked domains compilation for Copilot, Claude, and Codex engines
  • Tests verify --block-domains flag appears correctly in compiled workflows
  • Tests verify ecosystem identifier expansion (e.g., pythonpypi.org, files.pythonhosted.org)
  • All tests passing ✅

Smoke Test Workflows (pkg/cli/workflows/test-*-blocked-domains.md):

  • test-copilot-blocked-domains.md - Blocks PyPI domains while allowing GitHub
  • test-claude-blocked-domains.md - Blocks NPM domains while allowing GitHub
  • test-codex-blocked-domains.md - Blocks custom example domains while allowing GitHub

Each smoke test validates:

  • Allowed domains are accessible
  • Blocked domains are actually blocked by AWF
  • GitHub MCP server works correctly
  • File operations succeed

Fixed critical bug: Added blocked domains extraction in frontmatter_extraction_security.go - the parser wasn't reading the blocked field from YAML, so blocked domains weren't being applied during compilation.

@Mossaka Mossaka marked this pull request as ready for review January 6, 2026 18:31
Copilot AI requested a review from Mossaka January 6, 2026 18:32
@Mossaka Mossaka added the smoke label Jan 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

💀 Blimey! Smoke Copilot Safe Inputs failed and walked the plank! No treasure today, matey! ☠️

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results

Last 2 Merged PRs:

Test Results:
✅ GitHub MCP (list PRs)
✅ File Writing (/tmp/gh-aw/agent/)
✅ Bash Tool (cat verification)
✅ GitHub MCP Default Toolset (get_me correctly unavailable)
✅ Cache Memory (/tmp/gh-aw/cache-memory/)
✅ Web Fetch (GitHub API)

Overall: PASS

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results

✅ File Writing Test: Created /tmp/gh-aw/agent/smoke-test-copilot-20764118994.txt
✅ Bash Tool Test: File verified successfully
✅ Safe Input gh Tool Test: Tool unavailable (as expected without safe-inputs enabled)

Status: PASS - All core functionality working correctly

AI generated by Smoke Copilot Safe Inputs

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results - Copilot Engine (No Firewall)

Run ID: 20764118990
Date: 2026-01-06T22:30:16Z

Test Results

Last 2 Merged PRs: Retrieved successfully (PR #9168, PR #9163)
File Creation: Created /tmp/gh-aw/agent/smoke-test-copilot-20764118990.txt
Playwright Navigation: Navigated to https://github.com successfully (Title: "GitHub · Change is constant. GitHub keeps you ahead. · GitHub")
GitHub Issues: Listed 3 open issues (#9127, #9122, #9101)

All tests passed successfully.

AI generated by Smoke Copilot No Firewall

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results

Cache Memory: Successfully wrote and verified test file
Playwright MCP: Tool execution failed (npx command issue)
GitHub CLI: Successfully accessed issue list

Overall Status: PARTIAL PASS (2/3 tests passed)

AI generated by Smoke Copilot Playwright

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

PRs: [instructions] Sync github-agentic-workflows.md with v0.35.1; Bump gh-aw-firewall (AWF) to v0.8.2
OpenAI curl blocked: ✅
GitHub MCP fetch merged PRs: ✅
File write/read /tmp/gh-aw/agent/smoke-test-codex-firewall-20764118997.txt: ✅
example.com curl blocked: ✅
Network: SANDBOXED
Overall: PASS

AI generated by Smoke Codex Firewall

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Recent merged PRs:

  • [instructions] Sync github-agentic-workflows.md with v0.35.1
  • Bump gh-aw-firewall (AWF) to v0.8.2
    GitHub MCP: ✅
    File write/read (/tmp/gh-aw/agent): ✅
    Playwright title check: ✅
    Cache memory write/read: ✅
    safeinputs-gh gh issues list: ❌ (command not found)
    Overall: FAIL

AI generated by Smoke Codex

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Smoke Test Results - Claude Engine

Recent PRs:

Test Results:
✅ GitHub MCP - Retrieved 2 merged PRs successfully
✅ File Writing - Created /tmp/gh-aw/agent/smoke-test-claude-20764118971.txt
✅ Bash Tool - Verified file creation via cat
✅ Playwright MCP - Navigated to GitHub, page title contains "GitHub"
✅ Cache Memory - Created and verified /tmp/gh-aw/cache-memory/smoke-test-20764118971.txt
❌ Safe Input gh Tool - Tool not available in environment

Overall Status: PASS (5/6 tests passed, 1 tool unavailable)

AI generated by Smoke Claude

@Mossaka Mossaka merged commit b80e7de into main Jan 7, 2026
45 of 47 checks passed
@Mossaka Mossaka deleted the copilot/add-domain-blocklist-support branch January 7, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants