Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

The security testing agent was struggling to find firewall escape paths. Updated the prompt to direct the agent to explore the AWF implementation directly rather than providing pre-documented architecture details.

Changes

  • Renamed workflow from test-firewall-escape.md to firewall-escape.md
  • Step 1: Understand the Firewall Implementation - Directs the agent to explore https://github.com/githubnext/gh-aw-firewall and read key source files (src/cli.ts, src/host-iptables.ts, src/squid-config.ts, containers/copilot/*.sh, etc.)
  • Step 2: Devise Escape Strategies - Agent devises creative escape strategies based on their understanding of the implementation
  • Step 3: Execute Your Attacks - Added 80% novelty requirement: the agent is now instructed to check cache-memory for previously attempted strategies and prioritize new, untested attack vectors. Results are documented in cache-memory so future runs can learn from them.
  • Increased timeout to 60 minutes (1 hour) to allow for more thorough security testing

This approach allows the agent to discover implementation details on their own, think creatively about vulnerabilities, and continuously explore new attack vectors rather than re-running the same tests.

Original prompt

it looks like there is a hard time for the agent to escape from the firewall in the "test-firewall-escape.md". Can you apply the best prompt engineering techniques to tell the security testing agent to really think out of the box and understand the implementation details of the awf https://github.com/githubnext/gh-aw-firewall and find vulnerabilities, and then utilize those vulnerabilities to find escape paths?

you are not required to think of a solution, the security testing agent should. You should craft the appropriate prompt


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Investigate vulnerabilities for firewall escape feat: enhance test-firewall-escape.md with deep AWF implementation knowledge Nov 26, 2025
Copilot AI requested a review from Mossaka November 26, 2025 00:04
Copilot finished work on behalf of Mossaka November 26, 2025 00:04
@Mossaka
Copy link
Collaborator

Mossaka commented Nov 26, 2025

@copilot revert all the changes, you should just tell the agent to explore https://github.com/githubnext/gh-aw-firewall and understand the details of the awf and then try to break from it.

Copy link
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot revert all the changes, you should just tell the agent to explore https://github.com/githubnext/gh-aw-firewall and understand the details of the awf and then try to break from it.

Reverted all changes and simplified the prompt. The agent is now instructed to explore https://github.com/githubnext/gh-aw-firewall first, understand the AWF architecture by reading the source files, then devise and execute escape strategies based on their findings. (cef18fd)

Copilot AI changed the title feat: enhance test-firewall-escape.md with deep AWF implementation knowledge refactor: update test-firewall-escape.md to direct agent to explore AWF repo Nov 26, 2025
Copilot finished work on behalf of Mossaka November 26, 2025 00:24
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilpt rename to "firewall-escape". The "test-*" workflows are typically stored under pkg/cli/workflows and this one should stay in this folder

@Mossaka
Copy link
Collaborator

Mossaka commented Nov 26, 2025

@copilot slightly modify the prompt to try new strategies 80% of the attempts

@Mossaka Mossaka marked this pull request as ready for review November 26, 2025 20:25
Copy link
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot slightly modify the prompt to try new strategies 80% of the attempts

Added the 80% novelty requirement to Step 3. The agent is now instructed to check cache-memory for previously attempted strategies and prioritize new, untested attack vectors. (d21f25a)

@copilpt rename to "firewall-escape". The "test-*" workflows are typically stored under pkg/cli/workflows and this one should stay in this folder

Renamed the workflow from test-firewall-escape.md to firewall-escape.md. (d21f25a)

Copilot AI changed the title refactor: update test-firewall-escape.md to direct agent to explore AWF repo refactor: rename to firewall-escape.md and add 80% novelty requirement Nov 26, 2025
Copilot finished work on behalf of Mossaka November 26, 2025 20:36
@Mossaka
Copy link
Collaborator

Mossaka commented Nov 26, 2025

@copilot increase the timeoout to 30 mins for this workflow

Copy link
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot increase the timeoout to 30 mins for this workflow

Increased the timeout from 15 to 30 minutes. (4a8d1fd)

Copilot AI changed the title refactor: rename to firewall-escape.md and add 80% novelty requirement refactor: rename to firewall-escape.md, add 80% novelty requirement, and increase timeout Nov 26, 2025
Copilot finished work on behalf of Mossaka November 26, 2025 21:13
Copilot AI and others added 4 commits November 26, 2025 23:12
…owledge

Apply advanced prompt engineering techniques to guide the security testing agent:
- Provide detailed AWF architecture overview (Squid, iptables, Docker wrapper)
- Document network topology with ASCII diagram
- Explain key implementation details and their attack surfaces
- Include 13+ specific attack vectors with bash commands
- Add Phase 1 reconnaissance, Phase 2 systematic exploitation
- Reference actual code paths and configuration files
- Include creative thinking section for out-of-box approaches
- Extended timeout from 15 to 30 minutes for thorough testing

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
- Replace hardcoded IP (93.184.216.34) with dynamic resolution using dig
- Use actual allowed domain 'github.com' instead of 'allowed-domain.com'
- Add clarifying comments for URL encoding tests (%2E is URL-encoded ".")

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Reverted the detailed architecture documentation and instead instructed the agent to:
1. Explore https://github.com/githubnext/gh-aw-firewall
2. Read key source files to understand the firewall architecture
3. Devise escape strategies based on their understanding
4. Execute attacks methodically and document results

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI and others added 2 commits November 26, 2025 23:12
…novelty requirement

- Renamed workflow from test-firewall-escape.md to firewall-escape.md
- Updated workflow name and description
- Added instruction for agent to prioritize new strategies (80% novel attempts)
- Agent now uses cache-memory to track and avoid repeating previous attempts

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
@Mossaka Mossaka force-pushed the copilot/test-firewall-escape-vulnerabilities branch from 4a8d1fd to c2e0cf7 Compare November 26, 2025 23:12
@Mossaka
Copy link
Collaborator

Mossaka commented Nov 26, 2025

@copilot increase the timeoout to an hour.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot increase the timeoout to an hour.

Increased the timeout to 60 minutes (1 hour). (be71dd4)

Copilot finished work on behalf of Mossaka November 26, 2025 23:51
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.

3 participants