Skip to content

docs: harden agent git safety guidance#2171

Open
MSBrett wants to merge 3 commits into
devfrom
features/sre-agent-policy
Open

docs: harden agent git safety guidance#2171
MSBrett wants to merge 3 commits into
devfrom
features/sre-agent-policy

Conversation

@MSBrett

@MSBrett MSBrett commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Replaces part of #2111.

Scope:

  • Isolates repository agent safety guidance and local ignore-rule changes from product/template changes.

Review notes:

  • Base: dev.
  • Split plan: memory://projects/finops-toolkit/pr-2111-split-plan.

Verification:

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs: Review 👀 PR that is ready to be reviewed label Jun 3, 2026
@MSBrett MSBrett marked this pull request as ready for review June 3, 2026 15:54
@MSBrett MSBrett requested a review from flanakin as a code owner June 3, 2026 15:54
Copilot AI review requested due to automatic review settings June 3, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 hardens the repository’s AI-agent operational guardrails by making protected-branch git safety rules explicit and by expanding local-only ignore patterns, keeping these governance changes isolated from product/template updates.

Changes:

  • Add an explicit P0 Git Safety Rule to prohibit any direct mutation of main/dev and any protected-branch bypass behavior by AI agents.
  • Refine the git operations policy language to scope write operations to non-protected feature branches and broaden the list of actions requiring explicit approval.
  • Update .gitignore to ignore additional local/runtime artifacts (MCP config, gate pipeline files, iteration scripts, training deck artifacts, and playwright captures).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
AGENTS.md Adds/strengthens protected-branch safety policy and clarifies approval requirements for git write operations.
.gitignore Ignores additional local/runtime artifacts related to agents, pipelines, training deck work, and playwright captures.

Comment thread AGENTS.md Outdated
msbrett and others added 2 commits June 3, 2026 09:40
- Generalize protected branches to protected refs (covers protected tags)
- Prohibit --tags/--follow-tags/--all/--mirror and multi-ref push refspecs
- Tighten PR-branch false-positive carve-out: single-ref push only,
  no cherry-picks from main, explicit refspec discipline
- Remove approval-can-authorize-direct-mutation loophole in the
  revert/remediation clause; route to a human maintainer instead
- Define 'mutable work' on main/dev as anything that touches worktree,
  index, commits, refs, generated files, or submodules
- Add indirect protected-ref mutation clause covering workflows,
  CODEOWNERS, rulesets, release scripts, and credential handling
- Add global approval-required preamble above the permitted list
- Root-anchor .gitignore entries the comment claims are 'at repo root'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MSBrett MSBrett enabled auto-merge (squash) June 4, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants