Skip to content

CI mirror: full ubuntu run for upstream PR 59045 - #7

Closed
cryptoyasenka wants to merge 1 commit into
mainfrom
fix/media-delivery-project-env-guard
Closed

CI mirror: full ubuntu run for upstream PR 59045#7
cryptoyasenka wants to merge 1 commit into
mainfrom
fix/media-delivery-project-env-guard

Conversation

@cryptoyasenka

Copy link
Copy Markdown
Owner

Not for merge. Mirrors NousResearch#59045 to run the full test suite on ubuntu.

The read guard (agent/file_safety.get_read_block_error) blocks reading
.env / .envrc anywhere on disk by basename, but the media-delivery
denylist only enumerated <hermes-root>/.env. A user's own project .env
(e.g. /home/user/app/.env) was therefore deliverable as a native
attachment via a prompt-injected MEDIA: tag in default (non-strict)
single-user mode, leaking API keys and database passwords.

Add a shared is_project_env_basename() predicate in file_safety and
reject those basenames in validate_media_delivery_path before the cache
allowlist, so the delivery side mirrors the read guard in every mode.

The predicate is bound at module import next to the existing
first-party import and called unconditionally, so the gate fails
closed: an import failure can no longer silently reopen the exfil path
the gate exists to close. There is no cycle to defer around:
agent/file_safety imports only stdlib and never imports gateway, and
agent/__init__ only preloads jiter.

Add regressions covering the guard in every delivery mode and one that
poisons sys.modules["agent.file_safety"] and asserts a project .env
stays undeliverable, so a call-time import can no longer decide whether
the check runs.
@cryptoyasenka
cryptoyasenka force-pushed the fix/media-delivery-project-env-guard branch from 0b16904 to d8be06c Compare August 5, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant