Heuristic:1ay1 Agentty Fail Closed Refuse Default
| Knowledge Sources | |
|---|---|
| Domains | Security, Configuration |
| Last Updated | 2026-10-28 14:00 GMT |
Overview
Default trust-handoff policy of Refuse for agent-written files that the host later executes, because a trust handoff is the shape of a known escape class rather than a "this might be risky" prompt.
Description
The Fail_Closed_Refuse_Default heuristic sets the default `HandoffPolicy` to Refuse (not Warn, not Allow) for the trust handoff gate. When the agent writes a file that the host trusts and executes (e.g., hooks.json, .git/config, .vscode/tasks.json), the default action is to refuse the write entirely. This is because a trust handoff — agent writes, host executes with elevated trust — is the exact shape of a known escape class (Pillar Security CVE-2026-48124). Refuse is not a "this might be risky" prompt; it is a "this is the shape of an attack" refusal.
The user can opt in to Warn (be notified but allowed) or Allow (fully trusted), but the default is the safest option. This mirrors the broader sandbox design philosophy: defaults reproduce today's behavior exactly, and every stricter setting is opt-in.
Usage
Use this heuristic when designing any system where an untrusted agent writes files that a trusted host process later reads or executes. The default must be refuse — the most restrictive option — because a trust handoff is an attack shape, not a risk to be weighed.
The Insight (Rule of Thumb)
- Action: Set `HandoffPolicy::Refuse` as the default for agent-written files that the host executes.
- Value: Refuse (block the write entirely). Warn and Allow are opt-in.
- Trade-off: An agent that legitimately needs to write a hooks.json or git config must have the user explicitly change the handoff policy. This is intentional friction at a security boundary.
- Compatibility: The handoff_ro list (host-trusted paths bound read-only) is the prevention half; the handoff policy is the detection half. Both run everywhere regardless of platform.
Reasoning
A trust handoff is the shape of a known escape class. The agent writes a file (hooks.json, .git/hooks/*, .vscode/tasks.json) that the host's trusted tooling executes with the host user's privileges. If the agent can write these files, it can escalate from "sandboxed command runner" to "arbitrary code execution as the user." The refuse default ensures this attack shape is blocked by default; the user must explicitly opt in to allow it, which is the correct threat model for a tool that runs untrusted model output.
The detection half (handoff_ro) binds these paths over themselves read-only when they exist, so the guest reads the real contents but gets EROFS on write. This needs a mount namespace, so it is absent on a host that denies unprivileged userns — which is why the detection runs everywhere regardless.
Code Evidence
Default handoff policy from `include/agentty/domain/sandbox_config.hpp:52-59`:
enum class HandoffPolicy : std::uint8_t { Refuse, Warn, Allow };
struct Config {
// ...
HandoffPolicy handoff = HandoffPolicy::Refuse;
};
Rationale from `include/agentty/domain/sandbox_config.hpp` (trust handoff section):
// The handoff field (HandoffPolicy, default Refuse) controls what
// happens when the agent writes a file the host later executes. Refuse
// is the default because a trust handoff is the shape of a known escape
// class (Pillar Security CVE-2026-48124), not a "this might be risky" prompt.
Handoff_ro prevention (read-only bind) from `include/agentty/tool/util/sandbox_claybin.hpp:43-58`:
// Host-trusted paths that EXIST and must be read-only: .vscode/tasks.json,
// .git/hooks/*, .git/config, hooks.json. The PREVENTION half of the trust
// handoff gate.
//
// Not masked and not denied -- bound over themselves read-only, so the
// guest reads the real contents and gets EROFS on write.