CLAUDE LABJP
2.1.273 — A round of connection work landed together: five opt-in headers for LLM gateways, and a notice when Claude Code stops trying to reconnect an MCP server09/29 — The date beside claude-sonnet-4-5 is 12 days out, but it is an earliest-possible estimate. The model is still Active, and public retirements get at least 60 days noticeMCP — People keep asking to reconnect a dropped server without ending the session. The disconnect is now announced, but reattaching is still something you do by handNEW — A scheduled task ran some days and not others. The cause was that only one folder had been bound to itWINDOWS — When Cowork fails on its very first task, check developer mode and the setup state before going looking for a causeHANDOFF — Before a long draft gets too heavy for one chat, decide on the three things the summary must carry into the next one2.1.273 — A round of connection work landed together: five opt-in headers for LLM gateways, and a notice when Claude Code stops trying to reconnect an MCP server09/29 — The date beside claude-sonnet-4-5 is 12 days out, but it is an earliest-possible estimate. The model is still Active, and public retirements get at least 60 days noticeMCP — People keep asking to reconnect a dropped server without ending the session. The disconnect is now announced, but reattaching is still something you do by handNEW — A scheduled task ran some days and not others. The cause was that only one folder had been bound to itWINDOWS — When Cowork fails on its very first task, check developer mode and the setup state before going looking for a causeHANDOFF — Before a long draft gets too heavy for one chat, decide on the three things the summary must carry into the next one
Articles/Claude Code
Claude Code/2026-06-18Advanced

Give an Unattended Agent Only the MCP Tools It Needs — Enforcing a Deny-by-Default Policy

An unattended Claude Code agent can't lean on a permission prompt, so whatever a tool can reach becomes the blast radius. Here's how to lock MCP servers and tools down to deny-by-default and hand back only what the job needs, with managed-settings.json examples.

claude-code132mcp20permissions10automation110

Premium Article

The agents I launch on a schedule have no one standing by to click the permission prompt.

I run Dolice Labs as an indie developer, and across several sites I kick off Claude Code-based agents at fixed times every day. Early on, one of those unattended agents reached for tools it had no business touching, then sat waiting on a permission dialog that no one was there to answer — frozen until morning.

In an interactive session, a risky tool call surfaces on screen and I can stop it. In unattended operation, that last line of defense simply isn't there. So before asking "what should make it stop," the better question is "what can it reach at all" — and that belongs in configuration. This piece is about denying MCP servers and their tools by default, then handing back only what the job actually needs.

For an unattended agent, reach is the blast radius

The same permission settings mean very different things in interactive versus unattended use.

Interactively, the ask permission mode is effectively a safety net. Tool calls it isn't sure about get routed to you, so even a loose allowlist is survivable because a human makes the final call.

Unattended, there is no one to ask. A tool that isn't allowed stalls; one that is allowed simply runs. There's no middle. So for an unattended agent, the breadth of the allowlist is exactly the breadth of what can happen without anyone watching.

For me, MCP-backed tools were where this bit hardest. An agent whose only job was to generate an article and push it could still see a filesystem-wide MCP server and a browser-automation MCP. For that job, the reach was obviously far too wide.

Per-tool allow and "policy enforcement" live on different layers

The easy thing to conflate here is project-level permissions versus policy enforced at a higher layer.

The permissions.allow / permissions.deny keys in settings.json are project or user settings. Convenient — but because they live at a layer you can also write to, another setting can override them. For automation, it's worth asking: what happens if this agent's settings file gets rewritten somehow?

Managed (administrator-layer) settings exist precisely to set a floor that lower local settings cannot override. Claude Code reads settings across several layers and resolves them roughly in this order of precedence:

PriorityLayerTypical locationOverridable from below
HighManaged policyOS system locationNo
MidCommand-line flags-- options at launch
MidProject settings.claude/settings.jsonYes
LowUser settings~/.claude/settings.jsonYes

The key move is to put an unattended agent's "floor" at that top layer. However the local settings get touched, the deny survives.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Build a configuration that denies MCP servers and tools by default and hands back only the necessary ones via an allowlist, with concrete managed-settings.json examples
Understand how per-tool allow lists differ from policy enforced at a higher layer, so you can set a floor that local settings cannot override
Learn how to confirm at startup that the policy is actually in effect, plus the precedence and fallback traps I hit running my own unattended pipelines
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $15 for lifetime access
View Membership →

Related Articles

Claude Code2026-07-17
The Morning My Table Ended in "… 2,847 more rows" — Separating Render Caps from Token Cost in Tool Output
Claude Code 2.1.209 caps markdown tables at 200 rows plus a remainder count. Only the rendering is capped — the model still receives every row. Here is how to measure the gap and redesign tool output around aggregates.
Claude Code2026-07-15
Answering auto mode's confirmation prompts in headless runs — a deny-by-default permission-prompt-tool
auto mode's confirmation step is a friend when you're at the keyboard, but in an unattended midnight run it becomes the reason a job sits waiting until morning. Here is how I catch those prompts with permission-prompt-tool, decide deny-by-default, and log every ruling — with working code.
Claude Code2026-03-24
How to Automate Game Development with Claude Code × unity-mcp — A Complete Workflow from Concept to Release
Learn how to combine Claude Code with unity-mcp to automate Unity game development. The hcg-workflows skill set provides an 8-phase workflow from planning to deployment.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links