A sandbox is only useful if it actually keeps the agent inside the fence. Claude Code 2.1.216 tightens several gaps that could let a background task, subagent, or resumed session wander outside its assigned directory. This release introduces a new configuration switch, but the more important work is under the hood: smarter handling of Git worktrees, symlinks, and agent restarts. If you run Claude Code locally or in CI, these changes deserve more than a quick skim of the changelog.
The Filesystem Toggle You Should Not Touch Lightly
Version 2.1.216 adds sandbox.filesystem.disabled. When this is set, Claude Code skips its own filesystem isolation while still enforcing the network sandbox. At first glance this sounds like a way to stop permission errors or speed up file operations. It is not. You should only enable this setting if another layer is already protecting your disk.
That means a disposable container that gets deleted after every run, or a dedicated virtual machine with no access to your home directory or production volumes. If you run Claude Code directly on macOS, Windows, or a bare Linux host, leave filesystem isolation on. The network sandbox is not a substitute for filesystem controls, and the minor friction of sandboxed file access is far cheaper than recovering from an accidental overwrite or a malicious prompt injection that breaks out of the project folder.
Think of the toggle as a compatibility shim, not a performance knob. It exists for environments where the operating system or orchestrator already handles isolation, and Claude’s own sandbox adds unnecessary complexity.
What the Update Actually Fixes
Beyond the new setting, 2.1.216 closes several practical holes that could let an agent reach places it should not.
Worktree isolation. Subagents can no longer redirect Git commands into a parent or sibling directory outside their own worktree. Previously, a subagent running inside your project could aim Git operations at your shared checkout or adjacent repositories. That matters because many developers keep multiple projects under a common parent folder. Now those boundary-crossing commands fail.
Symlink hardening at the .claude path. Workflow definitions and scheduled tasks used to follow symlinks when writing configuration. An attacker who could create a symlink from .claude to, say, your shell profile or SSH directory could potentially get the agent to write outside the project. The update stops this by refusing to follow symlinks at that path.
Safer rewinds. The /rewind command, which lets you roll back recent changes, now skips symlinked and hard-linked paths. Without this guard, a rewind operation could chase a symlink and overwrite a file far away from your repository. Claude now reports those skipped paths explicitly so you know the boundary held.
Resumed agents keep their restrictions. Background sessions that get stopped and later resumed used to fall back to default tool permissions. If you had intentionally restricted an agent so it could read but not write, a restart could silently restore broader access. Now the original restrictions are persisted and restored with the session.
Picking a Security Profile
Claude Code 2.1.216 organizes these controls into three profiles. Choose based on where you run the tool, not based on what feels fastest.
Default. Filesystem and network sandboxing both stay active. This is the right choice for local development on your laptop or workstation. It protects your home directory, system files, and neighboring projects without requiring you to manage containers.
Compatibility. Filesystem isolation is turned off, but the network sandbox remains. Restrict this profile to disposable containers or VMs where the filesystem is already ephemeral or strictly scoped. Do not use it because you are tired of typing passwords to let the agent access a protected folder.
Managed Hard Gate. Both sandbox layers stay on, and the profile expects additional container policies enforced by your orchestrator or security team. This is built for CI pipelines, remote dev environments, and enterprise setups where defense in depth is mandatory.
If you are unsure which one fits, start with Default. You can downgrade the protection later only after you have verified that your runtime environment genuinely isolates the filesystem by itself.
Upgrading Without Breaking Your Workflow
Не ставтеся до цього як до звичайного патча, який можна встановити у п'ятницю вдень. Шлях оновлення у 2.1.216 є простим, але наслідки неправильного налаштування — ні.
Спочатку оновіться до 2.1.216 за допомогою вашого звичного менеджера пакетів або інсталятора. Потім оберіть один із трьох профілів ізоляції перед початком будь-яких завдань агента. Не змішуйте профілі в різних сесіях, не розуміючи, який із них має пріоритет.
Далі виконайте п'ять недеструктивних граничних тестів, описаних нижче. Це швидкі скриптовані перевірки, які доводять, що пісочниця (sandbox) працює саме так, як обіцяє профіль. Під час тестування згенеруйте контрольні хеші (sentinel hashes) для файлів поза вашим тимчасовим тестовим репозиторієм. Контрольний хеш (sentinel hash) — це просто контрольна сума чутливого файлу або директорії, яку ви хочете захистити. Після завершення тестів порівняйте хеші. Якщо щось змінилося, ваша ізоляція порушена.
Також порівняйте свої логи. Claude Code записує відмови (denials) та події пісочниці у свої локальні логи. Шукайте явні відмови, коли відбувається звернення до заблокованого хоста або коли субагент виходить за межі свого робочого дерева (worktree). Тихі помилки гірші за гучні, тому переконайтеся, що логи показують спрацювання захисних механізмів (guardrails).
Нарешті, впроваджуйте зміни поступово. Почніть з одного проєкту або неробочої (non-production) гілки. Дайте новій версії попрацювати день або два, перш ніж розгортати її для всієї команди або CI-інфраструктури.
П'ять граничних тестів, які доводять справність вашої пісочниці
Завжди запускайте ці тести всередині тимчасового репозиторію, наповненого фейковими даними. Ніколи не спрямовуйте їх на робочий код, реальні облікові дані або живу інфраструктуру.
Мережева межа. Спробуйте звернутися до двох кінцевих точок (endpoints): однієї, яку ви явно дозволили, і однієї, яку ви заблокували. Простий HTTP-запит до публічного тестового сервісу, наприклад httpbin.org, може слугувати дозволеною ціллю, тоді як запит до локальної точки метаданих або внутрішньої IP-адреси має завершитися помилкою. Якщо заблокований запит проходить успішно, ваша мережева пісочниця налаштована неправильно.
Ізоляція робочого дерева (worktree). Зсередини субагента запустіть команду Git, спрямовану на батьківську директорію. Наприклад, спробуйте git -C .. status або попросіть агента описати файли поза межами його checkout. З виправленням у 2.1.216 це має завершитися помилкою. Субагент має бачити лише своє власне робоче дерево.
Пастка символьних посилань (symlink). Створіть у своєму проєкті symlink, який вказує на директорію поза репозиторієм, наприклад /tmp/sentinel-target. Потім спробуйте зберегти завдання або робочий процес за шляхом .claude, який би здійснював запис через це посилання. Після збереження перевірте зовнішню директорію. Якщо вона все ще порожня, захист symlink працює.
Пропуск rewind. Створіть папку всередині вашого репозиторію, яка містить symlink на системний файл або іншу директорію. Запустіть /rewind для цієї папки. Claude має вивести список пропущених шляхів із symlink або hard-link, а не намагатися перейти за ними. Переконайтеся, що ціль поза репозиторієм залишилася недоторканою.
Відновлення сесії. Запустіть фонового агента з суворим обмеженням, наприклад, із вимкненими інструментами запису файлів. Поставте сесію на паузу або зупиніть її, а потім відновіть. Одразу спробуйте змусити агента записати файл. Якщо обмеження все ще діє, виправлення для відновлених агентів працює. Якщо агент раптом знову отримав повний доступ до інструментів, ви все ще під загрозою.
Наостанок
Claude Code 2.1.216 дає вам більше гнучкості, ніж попередні версії, але ця гнучкість супроводжується чітким мандатом: перевіряйте, перш ніж довіряти. Новий перемикач файлової системи створений не для того, щоб полегшити вам життя ціною безпеки. Він призначений для інженерів, які вже побудували надійний фундамент під цим інструментом. Справжні покращення в цьому релізі — це тихі захисні механізми (guardrails), які не дозволяють субагентам проникати в батьківські директорії, відмовляються переходити за symlink під час запису конфігурації та пам'ятають правила навіть після тривалої паузи.
Проведіть п'ять тестів. Перевірте свої контрольні хеші. Прочитайте логи. Тоді, і тільки тоді, дозвольте новій версії виконувати реальну роботу.
Джерело: Claude Code v2.1.216 Release Notes
Додаткова навчальна спільнота: GyaanSetu on Telegram
