On July 1, 2026, Anthropic shipped Claude Code v2.1.198 with a change that quietly crossed a line: background agents working in a git worktree now commit, push the branch, and open a draft pull request the moment they finish — no prompt, no pause, no human clicking anything. Within days, GitHub issue #73197 asked for an off switch, because some teams run "propose-only" workflows where a human is the only one allowed to publish to the repo. That tension is the whole story, and it has a concrete answer: if the thing pushing to your repo might be an unattended agent instead of a human who just typed git push, your deploy pipeline should bind to merge, not to push or to draft-PR-open. Everything below is the reasoning and the checklist behind that one sentence.
What Actually Shipped in v2.1.198
The mechanics are simple, which is exactly why they're easy to miss the significance of. Before v2.1.198, a background Claude Code agent would finish editing in its worktree and then stop — a human ran git add, git commit, git push, and opened the PR by hand. After v2.1.198, the agent does all three of those itself, automatically, as its last action:
| Step | Before v2.1.198 | After v2.1.198 |
|---|---|---|
| Stage + commit changes | Human | Agent (automatic) |
| Push branch to remote | Human | Agent (automatic) |
| Open pull request | Human | Agent (automatic, draft) |
| Mark PR ready for review | Human | Human |
| Merge to main | Human | Human |
Anthropic kept one deliberate gate: the PR opens as a draft, not a ready-to-merge request, and merging is still a human action. The release also shipped two Notification hook events — agent_needs_input and agent_completed — so teams can wire Slack or desktop alerts to an agent finishing unattended, and upgraded the Explore subagent from Haiku to inheriting the main session's model. But the headline behavior is the auto-commit/auto-push/auto-PR default, and it's opt-out by omission: unless you've configured something to stop it, the first time your background agent finishes a task, it has already pushed a branch and opened a PR against your repository.
The Pushback Arrived Within Days
Issue #73197 is worth reading closely because it's not a feature request for something new — it's a request to restore an old default. The ask has two parts: a settings key (something like backgroundAgents.autoCreatePr: false, toggleable per action — commit, push, PR — in settings.json or via /config), and for background agents to respect existing permission deny rules teams had already configured, like Bash(git push:*).
The reasoning, in the requester's own words, is the crux: "pushing branches and opening PRs are outward-facing actions... for workflows where the human is the only one allowed to publish, a default-on publish step needs an off switch." That's not a complaint about the feature being broken. It's a team that had already drawn a specific boundary — humans publish, agents propose — discovering that a tool update moved the boundary without asking. For a deploy-from-chat platform, that's the exact failure mode to avoid: don't let a platform update silently redraw where "the agent proposed" ends and "someone published" begins.
Where Should a Deploy Trigger Actually Bind?
This is the concrete decision a git-push PaaS has to make, and it has three real candidates. Here's what each one buys and costs once the pusher can be an agent instead of a person:
| Trigger point | Who effectively approved the deploy | What goes wrong with an unattended agent | Recommended for agent-authored branches? |
|---|---|---|---|
| Push to branch | Nobody — a push is just "code exists somewhere" | An agent pushes a broken worktree state (mid-refactor, failing tests, secrets it pulled from an .env it shouldn't have read) and a preview environment builds it immediately | No — a push is not an approval, it's just an agent finishing its turn |
| Draft PR opened | Nobody — a draft is explicitly "not ready" | Same problem, plus it actively contradicts the platform's own signal: Anthropic marked these PRs draft specifically to mean "don't act on this yet" | No — binding a deploy to a state the agent itself flagged as not-ready is worse than binding to the raw push |
| PR merged to main | A human, by definition — merging is the one step v2.1.198 left untouched | Requires someone to actually look at the diff before it ships, which is the whole point | Yes — this is the only point in the new default flow where a human decision is guaranteed to have happened |
The reasoning collapses to one fact: v2.1.198 automated everything up through opening a draft PR, and left merge as the sole remaining human checkpoint. A deploy pipeline that fires on push or on PR-open is triggering off an agent's own "I'm done" signal, not off anyone's approval — it's exactly as unsafe with an agent as it would be if a human ran a pre-commit hook that auto-deployed every git push, something most teams stopped doing a decade ago for the same reason. Binding to merge means the deploy pipeline inherits whatever review process already gates that merge, agent-authored or not, without the platform having to build a separate "is this safe" heuristic of its own.
The Audit Gap: Four Things a Deploy-From-Chat MCP Server Needs
Trigger-point binding solves when to deploy. It doesn't solve who did what, which matters the moment an incident happens and someone has to answer "did the agent do this, or did a human approve it, and which agent, running as whom?" Anthropic's own answer for enterprise Claude Code access is instructive here: the Claude Apps Gateway, launched in early July 2026 alongside the same release cycle, acts as an OIDC relying party against Google Workspace, Microsoft Entra ID, Okta, or any standards-compliant OIDC provider, issues short-lived sessions instead of long-lived secrets on developer machines, enforces centrally-defined policy per request, and ships OTLP audit logging out of the box. That's the shape of what an infrastructure MCP server — one whose tools are deploy, rollback, scale instead of read_file — has to match, translated into four concrete requirements:
- Attribute every deploy call to a real identity, not a shared service token. If the deploy tool authenticates as "the CI bot" regardless of which agent or which human triggered it, the audit log can't answer "who" — only "something with CI's credentials." OIDC-backed, short-lived, per-session tokens (the Apps Gateway pattern) fix this at the identity layer instead of bolting logging on after the fact.
- Scope the tool's capability per agent and per environment, the way MCP Server Cards are starting to describe — not just the function signature (
deploy(app, env)) but what an agent is explicitly not allowed to touch (production, a specific app, a specific customer's environment). A capability an agent was never granted can't be the thing that goes wrong at 2am. - Log immutably, and log the decision, not just the action. MCP gateway vendors converging on this in 2026 (MintMCP, Lunar's MCPX, and others) describe an immutable audit chain spanning User → Agent → MCP Server → Tool call. For a deploy tool, that chain needs to capture which merge (and whose approval) authorized the call — not just "deploy fired at 14:32."
- Make revocation instant, not a config change that needs a redeploy. If an agent's session is compromised or simply misbehaving, pulling its ability to call
deployshould be a single API call against the identity provider, not a platform release.
None of this is generic AI-safety hand-waving — it's the literal difference between the shared automation.yml and a scoped credential when something goes wrong at 2am, and it's the gap a self-hosted deploy-from-chat MCP server has to close on its own, since it doesn't get an Apps Gateway included for free the way Claude Code enterprise seats do.
Why This Isn't Optional Much Longer
There's a regulatory clock attached to this now, not just a best-practices argument. The EU AI Act's enforcement obligations for high-risk AI systems begin August 2, 2026 — three weeks from this post — and they specifically require technical documentation, human oversight, and post-market monitoring for systems that fit the high-risk criteria. An agent that can autonomously push code and, if the trigger binding is wrong, cause that code to reach production, is squarely the kind of system that documentation and oversight requirement is aimed at. "We'll add the audit trail later" stops being a viable answer once a regulator can ask for it on a specific date.
Building This Into a Deploy-From-Chat Platform
The practical version of all this, for a platform whose whole pitch is agents as first-class operators, isn't complicated — it's three defaults, applied before an agent's first deploy call rather than after an incident:
- Bind the deploy trigger to merge, never to push or draft-PR-open, for any branch an agent can write to.
- Issue deploy tool credentials per agent session, scoped to the specific app and environment that session is allowed to touch, not a shared platform-wide token.
- Treat the audit log as a first-class API resource — queryable, immutable, and complete enough to answer "which agent, acting on whose approval, deployed what" without grepping server logs.
Bex.co is the open-source, AI-native Render alternative — push a git repo, get a running HTTPS service on machines you own, with a Render-compatible API and agents built in as first-class operators, not an afterthought bolted onto a human-shaped dashboard. Star the repo on GitHub or deploy your first app today.
Sources:
- Claude Code v2.1.198: Background Agents Now Commit, Push, and Open Draft PRs.
- Add a setting to disable background agents' auto-commit / auto-push / auto-PR (v2.1.198) · Issue #73197.
- Claude Code changelog.
- Introducing the Claude apps gateway for Amazon Bedrock and Google Cloud.
- Claude apps gateway deployment and operations.
- How to Build Audit Trails for AI Coding Agents: MCP Gateway Approach.
- Best Open Source MCP Gateways 2026.



