Skip to content

feat(terraform): guard tf/github stacks against agent writes - #7172

Merged
dan-petty merged 2 commits into
mainfrom
feat/5320-tf-github-agent-guard
Nov 25, 2026
Merged

dan-petty merged 2 commits into
mainfrom
feat/5320-tf-github-agent-guard

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

This pull request protects OpenTofu stacks under tf/github against unintended agent writes and low GitHub quota.

  • Add tf.stacks[].agent_access (plan or apply, default plan for tf/github stacks) and tf.github_reader (app_id, installation_id, private_key) to settings, environment variables, and generated documentation.
  • Refuse agent devops tf apply and devops tf destroy runs on tf/github stacks before tofu starts unless the stack sets agent_access: apply, while person sessions keep full access.
  • Check the local GitHub REST core quota ledger against the floor of 250 before any tf/github plan starts, mint a read-only devops-settings-reader installation token for non-dry-run agent plans without reading writer credentials, and keep --dry-run free of tofu calls, credential reads, and network requests.
  • Document the controls in SECURITY.md under GitHub Settings.

Closes #5320

Change: openspec/changes/archive/2026-11-25-5320-tf-github-agent-guard/

@dan-petty dan-petty added type/feature Type feature: a new function scope/terraform OpenTofu modules and the infrastructure they declare labels Nov 25, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 25, 2026 12:11
@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #7172 has merge conflicts with main at commit dae84110097f. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

@dan-petty
dan-petty force-pushed the feat/5320-tf-github-agent-guard branch from dae8411 to b75dca4 Compare November 25, 2026 14:02
@dan-petty
dan-petty merged commit f21fcee into main Nov 25, 2026
28 checks passed
@dan-petty
dan-petty deleted the feat/5320-tf-github-agent-guard branch November 25, 2026 14:53
dan-petty-release Bot added a commit that referenced this pull request Nov 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.219.0](v0.218.3...v0.219.0)
(2026-11-25)


### Features

* **cli:** add devops store commands
([#7143](#7143))
([468215c](468215c)),
closes [#4761](#4761)
* **k8s:** cap Valkey maxmemory at three quarters of limit
([#7161](#7161))
([450feb8](450feb8))
* **k8s:** generate service catalog from rendered Applications
([#7185](#7185))
([fcaf8d9](fcaf8d9)),
closes [#5535](#5535)
* **k8s:** record live devops ConfigMap changes
([#7179](#7179))
([050f73e](050f73e))
* **roadmap:** add readiness report to project review
([#7147](#7147))
([f146226](f146226))
* **roadmap:** give each stage Job its own metric instance id
([#6364](#6364))
([#7167](#7167))
([d921852](d921852))
* **roadmap:** scope App token permissions by job phase
([#7171](#7171))
([d431076](d431076))
* **roadmap:** stage prepare snapshots GitHub reads
([#7142](#7142))
([e2a0de3](e2a0de3))
* **terraform:** guard tf/github stacks against agent writes
([#7172](#7172))
([f21fcee](f21fcee))


### Bug Fixes

* **ai:** capture served deployment model on gateway calls
([#6002](#6002))
([#7169](#7169))
([9b73aa1](9b73aa1))
* **ai:** halve batch only on input, timeout, or short reply
([#6722](#6722))
([#7152](#7152))
([da59cfc](da59cfc))
* **ai:** replace unserved devops-embedding with qwen3-embedding
([#7170](#7170))
([766f19b](766f19b))
* **ci:** finish the fail-to-pass error rule of
[#6379](#6379)
([#6400](#6400))
([#7180](#7180))
([357f60d](357f60d))
* **deps:** update golangci-lint flags and config to v2
([#7176](#7176))
([c681e72](c681e72)),
closes [#5072](#5072)
* **devcontainer:** remove unused init options
([#7153](#7153))
([369d878](369d878))
* **k8s:** report the workloads that no Argo CD Application manages
([#7186](#7186))
([2aba8fb](2aba8fb))
* **pr:** read head branch labels.yml when --repo is set
([#7134](#7134))
([a89fed8](a89fed8)),
closes [#6469](#6469)
* **review:** use ULID names for review sessions
([#6221](#6221))
([#7188](#7188))
([feddcc2](feddcc2))
* **roadmap:** avoid false rejected verdicts on tools in use
([#6441](#6441))
([#7146](#7146))
([851a87c](851a87c))
* **roadmap:** check failed head backoff before REST check-runs
([#6004](#6004))
([#7155](#7155))
([017ef6d](017ef6d))
* **roadmap:** convert post-merge refine questions to criteria
([#7145](#7145))
([f1125c1](f1125c1))
* **roadmap:** drop stale cycle waits and check proposal
([#7137](#7137))
([6ec0372](6ec0372)),
closes [#6515](#6515)
* **roadmap:** end blocked refine waits on older rules
([#7132](#7132))
([9c62b71](9c62b71))
* **roadmap:** exclude trackers from refine inbox waits
([#7135](#7135))
([376513b](376513b))
* **roadmap:** keep stage pending mark on kept orphan branch
([#7175](#7175))
([0b9c698](0b9c698))
* **roadmap:** keep the off-path return in reply_fixable shadow mode
([#7139](#7139))
([2ec4924](2ec4924))
* **roadmap:** log tool, mode, and parts on refine stop
([#5991](#5991))
([#7160](#7160))
([d4a6932](d4a6932))
* **roadmap:** mark a used language's stdlib as in-use
([#6347](#6347))
([#7182](#7182))
([55dba0a](55dba0a))
* **roadmap:** omit repeated text in intake and retitle comments
([#6198](#6198))
([#7158](#7158))
([f2ee61b](f2ee61b))
* **roadmap:** read shared frame replies for covers questions
([#7129](#7129))
([49d4062](49d4062))
* **roadmap:** record read_at on written refine rounds
([#7144](#7144))
([44fb86a](44fb86a)),
closes [#6371](#6371)
* **roadmap:** refine looks again at an edited Ready item
([#6452](#6452))
([#7178](#7178))
([3bb8a48](3bb8a48))
* **roadmap:** refuse unlisted non-namespaced labels in row guard
([#7128](#7128))
([a840fdd](a840fdd))
* **roadmap:** score renamed bot PR by first verdict kind
([#5984](#5984))
([#7162](#7162))
([879e71f](879e71f))
* **roadmap:** show stage eval case outcomes and reasons
([#6324](#6324))
([#7154](#7154))
([00885b6](00885b6))
* **roadmap:** use _read_at for Ready comment re-selection
([#7190](#7190))
([#7192](#7192))
([43d458c](43d458c))
* **tests:** declare lizard in dev group and guard test setup
([#7173](#7173))
([f82acc1](f82acc1)),
closes [#6380](#6380)
* **tests:** freeze wall clock in stage agent snapshot test
([#7181](#7181))
([#7183](#7183))
([06f35ef](06f35ef))


### Performance Improvements

* **k8s:** seed the uv cache of a runner pod from the image
([#7156](#7156))
([ac5d7b0](ac5d7b0)),
closes [#4814](#4814)


### Code Refactoring

* **roadmap:** use spec scope for plan titles and commits
([#7174](#7174))
([a81b050](a81b050))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/terraform OpenTofu modules and the infrastructure they declare type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tf): refuse agent apply, destroy and state changes in tf/github

1 participant