harn-sandbox-policy

harn-sandbox-policy is a skill for Claude Code from burin-labs/harn. It costs 49 tokens per session (1,774 once invoked), scanned C, original, Apache-2.0.

A guide to the process sandbox used by Harn to control which files child processes can read or write, including credential restrictions and platform-specific enforcement.

In plain words
What is it for?
Use it when configuring read or write roots, checking credential deny rules, or debugging sandbox behavior on macOS, Linux, or Windows.
Why use it?
It clarifies different kinds of file access and helps diagnose why an agent or spawned process cannot reach a path.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Good fit Use it when configuring read or write roots, checking credential deny rules, or debugging sandbox behavior on macOS, Linux, or Windows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/burin-labs/harn/harn-sandbox-policy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add burin-labs/harn --skill harn-sandbox-policy
Clone the repo
git clone --depth 1 https://github.com/burin-labs/harn

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for harn-sandbox-policy

README.md
[![agentmods](https://agentmods.dev/badge/skills/burin-labs/harn/harn-sandbox-policy/github.svg)](https://agentmods.dev/skills/burin-labs/harn/harn-sandbox-policy)
Your own site
<a href="https://agentmods.dev/skills/burin-labs/harn/harn-sandbox-policy"><img src="https://agentmods.dev/badge/skills/burin-labs/harn/harn-sandbox-policy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for harn-sandbox-policy

Your own site · 80×15
<a href="https://agentmods.dev/skills/burin-labs/harn/harn-sandbox-policy"><img src="https://agentmods.dev/badge/skills/burin-labs/harn/harn-sandbox-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,774 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.01774
Opus 5 $0.00024 $0.00887
Sonnet 5 $0.00010 $0.00355
Haiku 4.5 $0.00005 $0.00177

Measured 2d ago against content hash e83168031f7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

harn-sandbox-policy scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

opens `~/.config`, `~/.cache`, and `~/.netrc` wholesale, so a denial that merely
crates/harn-skills/src/corpus/harn-sandbox-policy/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Harn sandbox policy

The sandbox decides what a child process spawned by an agent tool call may read and write. It has one owner, crates/harn-vm/src/stdlib/sandbox/, and three backends that project the same CapabilityPolicy onto their platform.

Pair it with [[harn-agent]] for autonomy gating and [[harn-orchestration]] for where the policy comes from.

The three axes, which are not the same axis

Confusing these is the most common mistake here.

  1. workspace_roots / read_only_roots scope Harn's own file builtins (read_file, harness.fs.*), through check_fs_path_scope.
  2. process_sandbox.{presets,read_roots,write_roots,read_deny_roots} scope child processes only, through the OS backend. These never widen Harn's file builtins. allow_tcp_loopback and unix_socket_roots are the two socket grants on this axis: loopback admits IP on localhost, socket roots admit Unix-domain sockets whose socket file lives under a root, and neither opens remote egress. Both are host-owned: a nested policy cannot invent them.
  3. sandbox_profile decides whether either is enforced at all. enforces_path_scope() gates axis 1 and the toolchain-cache environment; confines_processes() gates axis 2.

A grant on one axis is not a grant on another, and a bug report that says "the agent cannot read X" needs to name which one before it can be diagnosed.

Adding a read root

Add it to the policy the embedder builds, or to a preset in sandbox/mod.rs if it belongs to every run. Presets are additive and expand per-platform in macos.rs / linux.rs / windows.rs.

Do not add a root by inferring it from the command being run. A read surface that is a function of the tool call is not auditable and fails order-dependently: the same command succeeds or fails depending on what ran before it.

Adding a denylist row

crates/harn-vm/src/orchestration/policy/read_deny_defaults.toml. One line under defaults.home_relative, plus a line under [reason] saying why. It is data on purpose: nothing in the Rust module decides what belongs on the list.

Read the full file on GitHub · 132 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · +23 lines e83168031f7b
  2. 11d ago First seen · 109 lines · 49 tokens per session scan C d5892ec2cd0d

Subscribe to this mod's changes

harn-sandbox-policy is a skill published in the GitHub repository burin-labs/harn (22 stars, last pushed today), licensed Apache-2.0. It adds 49 tokens to every session and 1,774 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.