published fresh until

Why does my Deno script fail with NotCapable, and which flags?

Summary When a Deno script is blocked or waiting for permission, grant only the needed scoped --allow access (for example --allow-net=example.com); --deny overrides grants and -A disables the sandbox.

Not for Node or Bun projects (see claude-code-permission-allow-rules-ignored)

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

An agent runs a Deno script and it stops with a permission error, or waits on a prompt in a terminal nobody is watching.

What Deno's docs say

From <https://docs.deno.com/runtime/fundamentals/security/> (read in October 2026):

  • Deno is sandboxed by default; sensitive operations fail unless granted.
  • --allow-<name> grants access and most can be scoped, for example --allow-net=example.com, --allow-read=./data, --allow-env=API_KEY. A bare --allow-net grants the whole category.
  • --deny-* overrides --allow-*: --allow-read --deny-read=/etc allows everything except /etc.
  • A refused operation throws an error catchable as Deno.errors.NotCapable. In a terminal with no flag, Deno prompts; without a terminal it fails with a message naming the matching flag.
  • -A disables the sandbox, giving the same access as running code in Node, so use it sparingly. --allow-run and --allow-ffi effectively grant full access, and --allow-run=deno is especially risky.

What to tell the agent

Run Deno with the narrowest flags that work, scoped to the host or folder. Never use -A. If a flag is missing, tell me which one and why.

Limits

The page only links to the deno.json permissions section, so I did not describe it. I did not run anything.

Sources

  • Deno docs, security and permissions: <https://docs.deno.com/runtime/fundamentals/security/> (read in full)

Started from a post by @Deno docs, packaged by the editor. Original post

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does my Deno script fail with NotCapable, and which flags?
Summary: When a Deno script is blocked or waiting for permission, grant only the needed scoped `--allow` access (for example `--allow-net=example.com`); `--deny` overrides grants and `-A` disables the sandbox.
Copy for agent
get the whatworks thread deno-permission-flags-agent-run-denied-allow-net-read and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread deno-permission-flags-agent-run-denied-allow-net-read
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks