Skip to content

fix(prompts): enforce consent-gated issue filing in debug prompt v2#1687

Merged
jamesadevine merged 2 commits into
mainfrom
copilot/overhaul-agent-prompts
Jul 27, 2026
Merged

fix(prompts): enforce consent-gated issue filing in debug prompt v2#1687
jamesadevine merged 2 commits into
mainfrom
copilot/overhaul-agent-prompts

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR overhauls the authoring prompts to remove unconditional external actions and make debug flows report-first by default. It addresses the #1663 class of behavior by requiring explicit in-session user approval before filing GitHub issues.

  • Shared contract (v2)
    • Added prompts/prompt-contract-v2.md as the canonical policy for confirmation, side effects, evidence quality, and stop conditions.
  • Prompt restructuring
    • Migrated create, update, and debug prompts to a compact Core + Task Module structure.
    • Removed duplicated/contradictory policy text across prompt files.
  • Debug-side effect governance
    • Replaced “must file” behavior with consent-gated decision flow.
    • Default mode is now dry-run diagnostic report; filing is optional and approval-gated.
  • Default/source-of-truth alignment
    • Prompt guidance now anchors model defaults to compiler truth (src/engine.rs / DEFAULT_COPILOT_MODEL) instead of local hardcoded assumptions.
    • Replaced fragile raw-doc references with canonical in-repo doc paths.
  • Regression safety checks
    • Added tests/prompt_contract_tests.rs to enforce:
      • report-only default in debug,
      • explicit approval gate before filing,
      • ban on unconditional filing phrases,
      • shared contract linkage across prompts.
### Step 5 — Consent-Gated Filing (Optional)
Default behavior: **do not file**.

If and only if the user explicitly asks to file now:
1. Propose issue title/label/body.
2. Confirm approval.
3. File and return URL.

Test plan

  • Added prompt regression coverage in tests/prompt_contract_tests.rs for consent-gating and banned phrase enforcement.

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread prompts/create-ado-agentic-workflow.md Outdated
- **Compile before committing**: Always compile with `ado-aw compile` and commit both the `.md` source and generated `.lock.yml` together.
- **Check validation**: The compiler validates front-matter fields and emits errors for invalid configurations (e.g., conflicting filter rules, missing required fields like `comment-on-work-item.target`). Write-bearing safe outputs do **not** require `permissions.write` — the executor defaults to `$(System.AccessToken)`.
- **Lint raw task steps**: When you author `task:` steps, run `ado-aw lint <file> --json` and fix any `task-input-invalid` findings — the compiler passes those steps through unchecked, so lint is the only place invalid task inputs surface.
# Create an Azure DevOps Agentic Workflow (v2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot remove any mention of V2 - also remove "prompt-contract-v2.md" or rename to AGENTS.md to provide guidance for future agents.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 726e9a5. I removed the V2 naming and replaced prompts/prompt-contract-v2.md with prompts/prompt-contract.md, then updated all prompt/test/docs references accordingly.

@jamesadevine

Copy link
Copy Markdown
Collaborator

@copilot remove any mention of V2 - also remove "prompt-contract-v2.md" or rename to AGENTS.md to provide guidance for future agents.

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot remove any mention of V2 - also remove "prompt-contract-v2.md" or rename to AGENTS.md to provide guidance for future agents.

Addressed in 726e9a5: removed V2 naming from the prompt files and replaced prompts/prompt-contract-v2.md with prompts/prompt-contract.md, with references updated in prompts/tests/docs.

@jamesadevine
jamesadevine marked this pull request as ready for review July 27, 2026 13:28
@jamesadevine
jamesadevine merged commit 741c830 into main Jul 27, 2026
3 checks passed
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jamesadevine
jamesadevine deleted the copilot/overhaul-agent-prompts branch July 27, 2026 13:29
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