hermes - 💡(How to fix) Fix Path guard blocks write_file in temp dirs on macOS (/private/var/folders) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

{"error": "Refusing to write to sensitive system path: /private/var/folders/5t/qbf8ztks7m5b47fvps21ys4w0000gn/T/pytest-…/sample.txt\nUse the terminal tool with sudo if you need to modify system files."}

Root Cause

On macOS, /tmp and /var/tmp are symlinks to /private/tmp and /private/var/tmp respectively. Pytest's tmp_path resolves to /private/var/folders/…, which triggers the _SENSITIVE_PATH_PREFIXES check.

The guard is too aggressive: it catches legitimate temp directory paths used by tests.

Fix Action

Fixed

Code Example

{"error": "Refusing to write to sensitive system path: /private/var/folders/5t/qbf8ztks7m5b47fvps21ys4w0000gn/T/pytest-…/sample.txt\nUse the terminal tool with sudo if you need to modify system files."}
RAW_BUFFERClick to expand / collapse

Bug Description

The path guard in tools/file_tools.py blocks write_file calls to paths under /private/var/folders/… on macOS, flagging them as "sensitive system paths".

This causes all test_edit_approval.py tests that use handle_function_call("write_file", …) to fail on macOS, since pytest's tmp_path fixture creates temporary directories under /private/var/folders/.

Error

{"error": "Refusing to write to sensitive system path: /private/var/folders/5t/qbf8ztks7m5b47fvps21ys4w0000gn/T/pytest-…/sample.txt\nUse the terminal tool with sudo if you need to modify system files."}

Root Cause

On macOS, /tmp and /var/tmp are symlinks to /private/tmp and /private/var/tmp respectively. Pytest's tmp_path resolves to /private/var/folders/…, which triggers the _SENSITIVE_PATH_PREFIXES check.

The guard is too aggressive: it catches legitimate temp directory paths used by tests.

Affected Tests

All tests in tests/acp/test_edit_approval.py that use tmp_path + handle_function_call("write_file", …).

Environment

  • macOS 12.7.6 (x86_64)
  • Hermes Agent v0.14.0

Suggested Fix

Allow writes to macOS temp directories (under /private/var/folders/ or $TMPDIR).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING