[WIP] Restore main safe output prompt using safe output tools#4730
Conversation
|
@copilot continue work |
…f gh CLI Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added a safe outputs prompt that instructs agents to use the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| <available-tools> | ||
| The safeoutputs MCP server provides these tools: | ||
| - create_issue - Create GitHub issues | ||
| - create_discussion - Create GitHub discussions | ||
| - add_comment - Add comments to issues, PRs, or discussions | ||
| - create_pull_request - Create pull requests | ||
| - create_pull_request_review_comment - Add review comments on PR code | ||
| - add_labels - Add labels to issues or PRs | ||
| - add_reviewer - Add reviewers to pull requests | ||
| - update_issue - Update issue status, title, or body | ||
| - close_issue - Close issues with a comment | ||
| - close_discussion - Close discussions with a comment | ||
| - close_pull_request - Close PRs without merging | ||
| - push_to_pull_request_branch - Push changes to PR branches | ||
| - assign_milestone - Assign issues to milestones | ||
| - assign_to_agent - Assign GitHub Copilot agent to issues | ||
| - create_agent_task - Create GitHub Copilot agent tasks | ||
| - create_code_scanning_alert - Create code scanning alerts | ||
| - upload_asset - Publish files as URL-addressable assets | ||
| - update_release - Update release descriptions | ||
| - noop - Log completion messages for transparency | ||
| - missing_tool - Report missing tools or functionality | ||
| </available-tools> | ||
|
|
||
| <reminder>Use these MCP tools instead of gh CLI commands for all GitHub API operations.</reminder> |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR restores the main safe output prompt functionality that instructs AI agents to use safe output MCP tools instead of attempting to use the unauthenticated GitHub CLI. The change addresses an issue where agents were trying to use gh CLI commands for GitHub API operations, which fail because gh is not authenticated in the workflow environment.
Key Changes
- Added a new prompt file (
safe_outputs_prompt.md) with instructions about using safeoutputs MCP server - Integrated the prompt generation into the compiler workflow when safe-outputs are configured
- Created comprehensive tests to validate the prompt generation behavior
Reviewed changes
Copilot reviewed 81 out of 81 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/sh/safe_outputs_prompt.md |
New prompt template instructing agents to use safeoutputs MCP server instead of gh CLI |
pkg/workflow/sh.go |
Embedded the safe outputs prompt text using go:embed directive |
pkg/workflow/safe_outputs_prompt.go |
New function to generate safe outputs prompt step using the helper pattern |
pkg/workflow/safe_outputs_prompt_test.go |
Tests validating prompt generation when enabled/disabled and XML structure |
pkg/workflow/compiler_yaml.go |
Integrated safe outputs prompt step into workflow compilation process |
.github/workflows/*.lock.yml |
Regenerated lock files showing the prompt step in compiled workflows |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
ghCLI instead of safe output MCP toolsOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.