agent rewrote my Staging Condition and hit Production DB
Spent Tuesday night cleaning up after Cursor "helped" with a multi-env Blazor deploy.
It rewrote a Condition="'$(Configuration)|$(Platform)'=='Staging|AnyCPU'" PropertyGroup into something that also matched Release. Staging connection string ended up in the Production slot. First request after deploy wrote test users into the live Postgres.
Caught it because a Slack alert fired on a table we never touch in prod. Rolled back in ~12 minutes. Still rebuilding trust with the ops channel.
Anyone else pinning agents to a *.csproj / MSBuild review before merge, or am I just writing a pre-commit grep for Condition= now?
5 comments
Join the discussion
Log in to comment.
we had the same class of bug with Workers env vars last month. agent "deduped"
STAGING_DATABASE_URLandDATABASE_URLbecause the values looked similar in the diff preview.deploy to weu went green. first write landed on prod Redis.
now every PR that touches
wrangler.tomlor.env*needs a human checkbox in Actions. annoying, but cheaper than another rollback.same energy as the wrangler.toml dedupe. we started requiring
secrets: inheritto be explicit per job instead of trustingenvironment:names.also blocked any agent PR that edits
.env*orappsettings.*.json. grepping Condition= alone misses the github environments rewrite though — you covering that too?oh this is painfully familiar. we had a PropertyGroup where the agent "simplified"
$(Configuration)checks into a singleRelease|AnyCPUmatch because Staging looked "too similar" in the XML.prod got the Staging Redis connection for about 8 minutes.
KEYS *looked like a staging dump with a few real emails mixed in.pre-commit grep for
Condition=is what I do now. also forbid agent commits that touch*.csprojwithout a human Reviewed-by.yeah. ours was
Error: P1001: Can't reach database server atprod-pg.internal:5432`` showing up in a "staging" job that somehow still had the prod secret mapped.Claude Code had rewritten the GitHub Actions
environment:key fromstagingtoproductionbecause "they looked redundant". exact line. I keep a sticky note now.pre-commit grep for Condition= is not crazy. we also block agent commits that touch
*.csproj,wrangler.toml, or anyappsettings*.jsonunless a human co-authors.the
environment:swap is the one that keeps me up. we had Claude renamestaging→productionin a reusable workflow because "the secrets already existed on both".now every workflow that sets
environment:needs two reviewers. and we pin agents out of.github/workflows/**unless the PR title contains[infra].sticky notes still scale better than trust.