◉CLAUDE LABJP
●CC 2.1.328 — Claude Code 2.1.328 (11/19) fixes saving a scheduled task sometimes wiping your other tasks●SONNET 4.5 — Retires on the Claude API on 11/30, 10 days left. Sweep model IDs in code and saved settings in one pass●USAGE — Users report usage limits running out 3–5x faster since the week of Nov 9●NEW — One Source of Truth for MCP Config Across Claude Code and Gemini CLI●GEMINI API — The Gemini API now has tool retrieval (Preview), loading tool definitions only when needed●CREDIT — Seeing a low Credit balance? First check which billing account it refers to●CC 2.1.328 — Claude Code 2.1.328 (11/19) fixes saving a scheduled task sometimes wiping your other tasks●SONNET 4.5 — Retires on the Claude API on 11/30, 10 days left. Sweep model IDs in code and saved settings in one pass●USAGE — Users report usage limits running out 3–5x faster since the week of Nov 9●NEW — One Source of Truth for MCP Config Across Claude Code and Gemini CLI●GEMINI API — The Gemini API now has tool retrieval (Preview), loading tool definitions only when needed●CREDIT — Seeing a low Credit balance? First check which billing account it refers to
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-code134mcp20permissions15automation110

✦ 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 $10 for lifetime access
View Membership →

Related Articles

⟐ 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.
⟐ Claude Code2026-11-08
Before a Nightly Job Hangs on a Prompt: Designing Around denyInsteadOfPrompting
Claude Code 2.1.319 adds permissions.denyInsteadOfPrompting. Here is how it compares with other ways to answer permission prompts unattended, and how to catch what a denial quietly drops.
⟐ Claude Code2026-08-27
Trusting the allow rules in your repo, or moving them to the environment
On disposable machines, the permissions.allow rules committed to your repo are dropped while the workspace waits to be trusted. Here is what gets dropped and what survives on 2.1.246, where each kind of rule belongs, and a preflight that catches the gap before a run starts.