Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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
Contributor
There was a problem hiding this comment.
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
DisableXPIAPromptFeatureFlagconstant inpkg/constants/constants.gowith value"disable-xpia-prompt" - Modified
collectPromptSections()inpkg/workflow/unified_prompt_step.goto 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.
This was referenced Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a frontmatter feature flag to exclude the XPIA (Cross-Prompt Injection Attack) security prompt from agent instructions.
Changes
Added
DisableXPIAPromptFeatureFlagconstant (pkg/constants/constants.go)"disable-xpia-prompt"Modified prompt section collection (
pkg/workflow/unified_prompt_step.go)collectPromptSections()now checks feature flag viaisFeatureEnabled()true, included otherwise (default)Added test coverage (
pkg/workflow/unified_prompt_step_test.go)xpiaPromptFileconstant for robust assertionUsage
When enabled, the compiled workflow omits
xpia.mdfrom the prompt construction:💡 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.