Skip to content

Add disable-xpia-prompt feature flag#15461

Merged
pelikhan merged 4 commits intomainfrom
copilot/add-disable-xpia-prompt-flag
Feb 13, 2026
Merged

Add disable-xpia-prompt feature flag#15461
pelikhan merged 4 commits intomainfrom
copilot/add-disable-xpia-prompt-flag

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Adds a frontmatter feature flag to exclude the XPIA (Cross-Prompt Injection Attack) security prompt from agent instructions.

Changes

  • Added DisableXPIAPromptFeatureFlag constant (pkg/constants/constants.go)

    • Value: "disable-xpia-prompt"
  • Modified prompt section collection (pkg/workflow/unified_prompt_step.go)

    • collectPromptSections() now checks feature flag via isFeatureEnabled()
    • XPIA section skipped when flag is true, included otherwise (default)
  • Added test coverage (pkg/workflow/unified_prompt_step_test.go)

    • Verifies behavior with flag enabled, disabled, and absent
    • Uses xpiaPromptFile constant for robust assertion

Usage

---
engine: copilot
features:
  disable-xpia-prompt: true
---

When enabled, the compiled workflow omits xpia.md from the prompt construction:

# Without flag (default)
cat "/opt/gh-aw/prompts/xpia.md" >> "$GH_AW_PROMPT"
cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT"

# With flag enabled
cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT"

💡 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.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI and others added 2 commits February 13, 2026 16:18
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add frontmatter features flag to disable xpia prompt Add disable-xpia-prompt feature flag Feb 13, 2026
Copilot AI requested a review from pelikhan February 13, 2026 16:20
@pelikhan pelikhan marked this pull request as ready for review February 13, 2026 16:25
Copilot AI review requested due to automatic review settings February 13, 2026 16:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new feature flag disable-xpia-prompt that allows workflows to opt out of the XPIA (Cross-Prompt Injection Attack) security prompt being included in agent instructions. The implementation follows the established pattern for feature flags in the codebase, using the isFeatureEnabled() function to check the flag in frontmatter and conditionally include the XPIA prompt section.

Changes:

  • Added DisableXPIAPromptFeatureFlag constant in pkg/constants/constants.go with value "disable-xpia-prompt"
  • Modified collectPromptSections() in pkg/workflow/unified_prompt_step.go to check the feature flag and skip the XPIA section when enabled
  • Added comprehensive test coverage with three test cases covering default behavior, flag enabled, and flag explicitly disabled

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/constants/constants.go Added the DisableXPIAPromptFeatureFlag constant with value "disable-xpia-prompt"
pkg/constants/constants_test.go Added test case for the new feature flag constant to verify correct type and value
pkg/workflow/unified_prompt_step.go Modified prompt section collection to conditionally include XPIA section based on feature flag using isFeatureEnabled()
pkg/workflow/unified_prompt_step_test.go Added comprehensive test coverage for the feature flag with three scenarios: default inclusion, exclusion when enabled, and inclusion when explicitly disabled

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan pelikhan merged commit 3862214 into main Feb 13, 2026
125 checks passed
@pelikhan pelikhan deleted the copilot/add-disable-xpia-prompt-flag branch February 13, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants