Deno is secure by default and grants I/O only with permissions
Short answer
Deno is secure by default. Unless you specifically enable it, a program has no access to sensitive APIs [S1]. You grant permissions with --allow-* flags, scoped so a program gets exactly the access it needs [S1]. When an operation is refused, Deno throws a NotCapable error [S1]. Permission state is stored as a quadri-state value [S2].
deno run app.ts
deno run --allow-read=./data app.ts
deno run --allow-net=api.example.com --deny-net=internal.example.com app.ts
Key points
- By default Deno is sandboxed. Unless you allow it, code cannot touch the file system, the network, or the environment, and cannot run subprocesses. [S1]
--deny-flags override their--allow-counterparts.-A(--allow-all) grants everything and turns the sandbox off entirely. [S1]- A few permissions grant access to things Deno cannot sandbox.
--allow-runand--allow-ffiare effectively granting full access. [S1] - A program can inspect and tighten its own permissions through the
Deno.permissionsAPI, including query, request, and revoke. [S1] PermissionStateis a quadri-state value for storing permission state, withGranted,Prompt, andDeniedcases. [S2]
Pitfalls
- Granting
--allow-run=denois especially dangerous. The script can start another deno process already given--allow-all. [S1] - Be careful when combining
--allow-writewith--allow-run. Write access can let a program overwrite an allowed executable. [S1] - Untrusted code needs more than one layer of defense, including limited permissions. [S1]
- If anything goes wrong during brokering, Deno immediately terminates the process. [S1]
Claims
- id: C1 claim: Deno denies sensitive access by default unless the user enables it. source: S1 evidence: "Deno is secure by default."
- id: C2 claim: Permissions can be limited so a program receives only the access it needs. source: S1 evidence: "a program gets exactly the access it needs"
- id: C3 claim: A refused permission operation throws a NotCapable error. source: S1 evidence: "Deno throws a
NotCapableerror." - id: C4 claim: Some permissions grant access that the sandbox cannot contain. source: S1 evidence: "A few permissions grant access to things Deno cannot sandbox"
- id: C5 claim: Each permission category carries a stored state value. source: S2 evidence: "Quadri-state value for storing permission state"
- id: C6 claim: The runtime error message tells users to rerun with the allow flag. source: S2 evidence: "run again with the --allow-{name} flag"
Sources
- [S1] Security and permissions - Deno Docs. https://docs.deno.com/runtime/fundamentals/security/ . License: MIT. Accessed 2026-11-11.
- [S2] Deno runtime permissions source. https://github.com/denoland/deno/blob/main/runtime/permissions/lib.rs . License: MIT. Accessed 2026-11-11.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Deno documentation (denoland/docs): Copyright (c) 2018-2024 the Deno authors; MIT (https://raw.githubusercontent.com/denoland/docs/main/LICENSE). Deno runtime (denoland/deno): Copyright 2018-2026 the Deno authors; MIT (https://raw.githubusercontent.com/denoland/deno/main/LICENSE.md). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Deno docs, Security and permissions, MIT (denoland/docs); Deno runtime permissions source, MIT (denoland/deno). Copyright (c) 2018-2024 the Deno authors; Copyright 2018-2026 the Deno authors. Notices: Deno documentation (denoland/docs): Copyright (c) 2018-2024 the Deno authors; MIT (https://raw.githubusercontent.com/denoland/docs/main/LICENSE). Deno runtime (denoland/deno): Copyright 2018-2026 the Deno authors; MIT (https://raw.githubusercontent.com/denoland/deno/main/LICENSE.md).
Cite this
iinventedlight. 2026. "Deno is secure by default and grants I/O only with permissions." iinventedlight Library, iil:note:xkg3yz5z, version of 2026-11-11. https://iinventedlight.com/library/notes/deno-permissions/. License: CC-BY-4.0.
@misc{iil_note_xkg3yz5z,
author = {{iinventedlight}},
title = {{Deno is secure by default and grants I/O only with permissions}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-11},
url = {https://iinventedlight.com/library/notes/deno-permissions/},
note = {Permanent ID iil:note:xkg3yz5z. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/deno-permissions.md.