TL;DR: On November 6, 2026, Claude Code v2.1.319 stopped falling back to its built-in classifier in auto mode behind an LLM gateway. If the server can’t check a call, Claude Code asks about it or denies it, and a new setting denies instead of prompting. Coding agents now fail closed. That’s the right default, and it presents three questions to LLM gateway admins: which calls are allowed, who decided, and where’s the record? Here’s what changed, and why it lands on the gateway.
Key takeaways
- Agents fail closed now: behind an LLM gateway, calls the server can’t check are asked about or denied.
- The gateway is in the safety path: a gateway that drops what the client expects shows up as stalled agents and CI jobs that exit 1.
- Proxying isn’t enough: allow or deny has to come from policy, for models and tool or MCP calls.
- Unattended agents need a plan: nobody answers a prompt in CI, so scope access ahead of time and log every denial.
What changed in Claude Code v2.1.319
Anthropic published Claude Code v2.1.319 on November 6, 2026. Five items change how a coding agent behaves behind an enterprise LLM gateway. It follows the release we covered in what layered policies in Claude Code mean for LLM gateway security, so we won’t repeat layered policy or pooled budgets here.
Auto mode behind an LLM gateway. With telemetry or feature flags off, “including behind LLM gateways”, calls the server can’t check “are asked about or denied, with no fallback to the built-in classifier.” Setting CLAUDE_CODE_AUTO_MODE_SERVER=0 keeps the old behavior. Bedrock, Vertex and Foundry are unchanged.
Turning the server-side check on. CLAUDE_CODE_AUTO_MODE_SERVER=1 turns on the server-side check even with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS set. If managed settings set the latter, they must set the 1 too.
Deny instead of prompting. With the new permissions.denyInsteadOfPrompting setting, “a tool call that would wait on a permission prompt is denied and the turn continues”, in terminal sessions, subagents and teammates.
Background MCP tasks. When an MCP server runs a tool call as a task, Claude Code moves it to the background right away and tells Claude the result when it finishes. CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND makes it wait inside the tool call instead.
Two fixes that show the gateway problem. /status used to show “Auto mode server: Enabled” even “when the server-side review isn’t reaching the session, for example behind an LLM gateway that drops it.” And claude -p in auto mode used to exit 0 when “its actions were refused because no safety check was available.” Text and JSON output now exit 1.
The Claude apps gateway also got admin.pooled_conflict_rule and admin.pooled_priority_order (which pooled group budget pays first), CLAUDE_GATEWAY_LOG_FORMAT=json, a boot warning when one policy’s availableModels also allows a custom model id another policy lists by name, and /usage spend for developers with no spend limit.
What is an enterprise LLM gateway?
Definition: An enterprise LLM gateway is the single point every model request passes through. It’s where a company enforces who can use which model and tool, what data can pass, and how much can be spent, and where it records every one of those decisions. So what is an LLM gateway without the “enterprise”? An LLM gateway (or LLM API gateway) governs model traffic. An agent gateway or MCP gateway governs what agents do with tools: the actions, not only the prompts. Agents use both. For more, see how an AI gateway governs LLMs and agents.
Why “fail closed” moves the decision onto your gateway
Before v2.1.319, a missing check meant a local fallback, and the agent kept going. Now it means ask or deny. That’s a good change. CI shows the effect. Picture a nightly claude -p job in auto mode behind a gateway that drops the server-side review. Before, the agent’s actions were refused and the job still exited 0, so the pipeline looked green. Now it exits 1. The gateway didn’t change. The client stopped hiding the gap. The lesson: your enterprise LLM gateway is part of the agent’s safety path, planned or not.
Pass through what the client expects
A gateway that strips request parts it doesn’t understand breaks agents quietly. The /status fix is the proof: sessions reported the server-side review as enabled while the gateway dropped it. Whatever your LLM gateway architecture, ask: does it pass that check through or answer it? Run /status from a session behind the gateway and see what it reports now.
Know which mode your developers run in
Three settings decide how auto mode behaves behind a gateway:
CLAUDE_CODE_AUTO_MODE_SERVER=0: keeps the built-in classifier fallback (the old behavior).CLAUDE_CODE_AUTO_MODE_SERVER=1: turns on the server-side check, even withCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASset.- Managed settings: if they set
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS, they must setCLAUDE_CODE_AUTO_MODE_SERVER=1too.
Pick one setup and put it in managed settings.
An enterprise LLM gateway has to answer these four questions
Who is allowed to call this model or tool?
Policy has to cover users, groups and agents, down to the tool and the action. “Can this developer use this model?” is half the question. The other half is “can this agent run this MCP tool, with this action?” That’s what security teams should require from an MCP gateway.
Who decided, and when?
The allow or deny should come from policy at request time, not from a prompt someone clicked through at 6 p.m. A secure LLM gateway decides on every request and can tell you which policy made the call.
Where’s the record?
Every allow and deny needs an audit trail: who asked, for what, which policy applied and what happened, sent to your SIEM and monitoring. CLAUDE_GATEWAY_LOG_FORMAT=json is a small sign that logs are meant for collectors. Spend belongs in the same record: an LLM gateway with cost tracking shows spend per user, team and agent, and admin.pooled_conflict_rule extends the pooled budgets from the previous release.
What happens when nobody’s watching?
permissions.denyInsteadOfPrompting exists because unattended agents can’t wait on a prompt, and background MCP tasks keep running while the agent moves on. For these runs a stall is the worst outcome. An unattended agent needs deny-and-log, so the denial is visible, plus access granted ahead of time instead of a prompt nobody answers.
| Capability | Proxy-only gateway | Enterprise LLM gateway | What Claude Code v2.1.319 does on its side |
|---|---|---|---|
| Client safety checks | May drop parts it doesn’t understand | Passes through or answers what clients expect | Asks or denies when the server can’t check a call; /status now reports it |
| Allow/deny for model calls | Key-level, if at all | On policy, per user, group and agent | Not in this release |
| Allow/deny for tool and MCP calls | No | On policy, down to the tool and action | Local permission rules; denyInsteadOfPrompting |
| Unattended agents | Stall on prompts | Pre-scoped access, deny and log | Denies instead of prompting; claude -p exits 1 on refusals |
| Long-running MCP tasks | Not its concern | Governed like any tool call | Moves MCP tasks to the background |
| Audit trail of decisions | Request logs only | Every allow and deny with the policy behind it | Not in this release |
| Logs to SIEM | Varies | Streamed to your SIEM | CLAUDE_GATEWAY_LOG_FORMAT=json (Claude apps gateway) |
| Budgets per user, team, agent | Rarely | Hard limits and budgets | Pooled budget order; /usage spend (Claude apps gateway) |
| Works across providers | Usually | Every model and MCP server | One client |
Coding agents are only one client
The same company usually runs other coding assistants, chat apps, internal agents and MCP servers, across multiple models. Each client that fails closed on its own terms brings its own denials, logs and policy format. Security still has to answer “who did what, and who allowed it” in one place. The fix isn’t to make clients lenient again. It’s one set of policies and one audit trail in front of all of them. That’s the job of an enterprise AI gateway: a unified API to every model is the easy part, governance is the hard part.
An enterprise LLM gateway checklist for agent traffic
- Safety signals pass through: test with
/statusbehind your gateway. - Auto mode settings are consistent: set in managed settings, not per developer.
- Policy covers tools: allow/deny reaches MCP servers, tools and actions.
- Denials are explained: the developer or agent sees why.
- Unattended runs are pre-scoped: CI and background agents never wait on prompts.
- CI treats exit 1 as a policy outcome: alert on it; don’t retry blindly.
- Decisions are logged: as JSON, to your SIEM, with the policy that applied.
- Keys are vaulted: people and agents get virtual keys.
- Every agent has its own record: no shared keys.
How Barndoor answers those questions for every model and agent
Barndoor is the AI Gateway for enterprises. Barndoor LLM Gateway governs model traffic and Barndoor MCP Governance governs agent actions on MCP servers.
- Who is allowed: least-privilege access from the user, role, group and MCP server down to the individual tool, model, data point and action. People are scoped from your existing IdP roles, and every agent gets its own AgentProfile, a unique record of what it can do.
- Who decided: policy is enforced at runtime, on every request, and unauthorized actions are stopped before they execute.
- Where’s the record: a complete audit trail of every AI and agent action and the policy that governed it, streamed to your SIEM. Each agent’s MCP connections, access policies, activity and token consumption appear in one view.
- What it costs: spend by user, team, agent and model, with hard limits and budgets.
- What data passes: Barndoor data protection redacts, tokenizes or blocks sensitive data inline, the PII filtering compliance teams ask of an LLM gateway proxy.
- Keys and coverage: real provider keys stay in the Barndoor vault, with virtual keys for developers, agents and AI apps, plus 100+ pre-built MCP servers and your own.
Enterprise LLM gateway: FAQs
What is an enterprise LLM gateway?
It’s the single point every model request passes through, where a company enforces who can use which model and tool, what data can pass and what can be spent, and records each decision. Compared with a basic LLM gateway, it adds policy per user, group and agent, audit trails, budgets and SIEM integration.
What changed for LLM gateways in Claude Code v2.1.319?
Behind LLM gateways, auto mode now asks about or denies calls the server can’t check, with no fallback to the built-in classifier. /status no longer shows the server-side review as enabled when a gateway drops it, and claude -p exits 1 when actions were refused for lack of a safety check.
Why does Claude Code ask or deny more calls behind my LLM gateway now?
Most likely the server-side check isn’t reaching the session through your gateway, and there’s no fallback anymore. Check /status. CLAUDE_CODE_AUTO_MODE_SERVER=1 turns the server-side check on; CLAUDE_CODE_AUTO_MODE_SERVER=0 keeps the old fallback.
What does permissions.denyInsteadOfPrompting do, and when should you turn it on?
It denies any tool call that would wait on a permission prompt and lets the turn continue, in terminal sessions, subagents and teammates. Turn it on for unattended runs such as CI and background agents. Pair it with pre-scoped access and alerting, so denials are visible.
What is the difference between an LLM gateway and an agent gateway or MCP gateway?
An LLM gateway governs requests to models. An agent gateway or MCP gateway governs which MCP servers, tools and actions agents may use. Agents need both: a safe prompt can still lead to an unsafe action.
What should an enterprise LLM gateway log for an audit?
For each request: the user or agent, the model or tool and action, the policy that applied, the decision and its reason, the time and the cost. Stream structured (JSON) logs to your SIEM.
Which LLM gateway has the best cost controls?
Judge by criteria, not rankings: spend broken down by user, team, agent and model; hard limits and budgets at each level; clear rules when one person sits in several budgets; and alerts before limits hit. Tracking without enforcement only gives you reports.
What does an LLM gateway not give you?
A model-only LLM gateway doesn’t govern what agents do with tools. It controls prompts, models and spend, but agent actions run through MCP servers. Unless it also covers MCP traffic down to the tool and action, that part stays ungoverned.
Related reading
- LLM Gateway with Data Loss Prevention for Enterprise AI
- Cloudflare AI Gateway: what it covers for model traffic
- Why teams choose Barndoor over Runlayer
Put one set of policies and one audit trail in front of every model, agent and MCP server. Start a free trial of Barndoor.