CI mirror: full ubuntu run for upstream PR 59045 - #7
Closed
cryptoyasenka wants to merge 1 commit into
Closed
Conversation
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
force-pushed
the
fix/media-delivery-project-env-guard
branch
from
August 5, 2026 23:32
0b16904 to
d8be06c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not for merge. Mirrors NousResearch#59045 to run the full test suite on ubuntu.