Skip to content

feat: mount skill credential files into remote terminal backends (Modal/Docker)#3671

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-ab59de22
Mar 29, 2026
Merged

feat: mount skill credential files into remote terminal backends (Modal/Docker)#3671
teknium1 merged 1 commit into
mainfrom
hermes/hermes-ab59de22

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Closes #3665

Problem

Skills using OAuth/file-based credentials (Google Workspace stores google_token.json in ~/.hermes/) work on the local backend but silently fail on Modal/Docker — the sandbox has no host files.

Solution

New credential file passthrough system, mirroring the existing env_passthrough pattern:

1. Skill frontmatter declaration:

required_credential_files:
  - path: google_token.json
    description: Google OAuth2 token
  - path: google_client_secret.json
    description: Google OAuth2 client credentials

2. Registry (tools/credential_files.py): Session-scoped registry tracks which files need mounting. Skills register files when loaded via skill_view. Missing files trigger setup_needed.

3. Backend mounting:

  • Modal: modal.Mount.from_local_file() passed to Sandbox.create(mounts=[...])
  • Docker: -v host:container:ro bind mounts (read-only)
  • Local: no changes needed (files already accessible)

4. User config override:

terminal:
  credential_files:
    - google_token.json
    - custom_oauth_token.json

Files

File Change
tools/credential_files.py New — registry module
tools/skills_tool.py Parse required_credential_files, register on load
tools/environments/modal.py Mount credential files at sandbox creation
tools/environments/docker.py Mount credential files as read-only bind mounts
skills/productivity/google-workspace/SKILL.md Add frontmatter field
tests/tools/test_credential_files.py New — 12 tests

Tests

pytest tests/tools/test_credential_files.py -n0 -q           # 12 passed
pytest tests/tools/test_skills_tool.py -n0 -q                # 73 passed
pytest tests/tools/test_skill_env_passthrough.py -n0 -q      # 8 passed
Full suite: 6691 passed, 2 failed (both pre-existing)

@teknium1 teknium1 force-pushed the hermes/hermes-ab59de22 branch from 822fe1d to c3cdd07 Compare March 29, 2026 06:40
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: base64 encoding/decoding detected

Base64 has legitimate uses (images, JWT, etc.) but is also commonly used to obfuscate malicious payloads. Verify the usage is appropriate.

Matches (first 20):

476:+                b64 = base64.b64encode(content.encode("utf-8")).decode("ascii")

⚠️ WARNING: exec() or eval() usage

Dynamic code execution can hide malicious behavior, especially when combined with base64 or network fetches.

Matches (first 20):

445:+        content into the sandbox via exec(), so new/updated credentials are

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

…ackends

Two related fixes for remote terminal backends (Modal/Docker):

1. NEW: Credential file mounting system
   Skills declare required_credential_files in frontmatter. Files are
   mounted into Docker (read-only bind mounts) and Modal (mounts at
   creation + sync via exec on each command for mid-session changes).
   Google Workspace skill updated with the new field.

2. FIX: Docker backend now includes env_passthrough vars
   Skills that declare required_environment_variables (e.g. Notion with
   NOTION_API_KEY) register vars in the env_passthrough system. The
   local backend checked this, but Docker's forward_env was a separate
   disconnected list. Now Docker exec merges both sources, so
   skill-declared env vars are forwarded into containers automatically.

   This fixes the reported issue where NOTION_API_KEY in ~/.hermes/.env
   wasn't reaching the Docker container despite being registered via
   the Notion skill's prerequisites.

Closes #3665
@teknium1 teknium1 force-pushed the hermes/hermes-ab59de22 branch from c3cdd07 to bf3457c Compare March 29, 2026 06:52
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: base64 encoding/decoding detected

Base64 has legitimate uses (images, JWT, etc.) but is also commonly used to obfuscate malicious payloads. Verify the usage is appropriate.

Matches (first 20):

1582:+                b64 = base64.b64encode(content.encode("utf-8")).decode("ascii")

⚠️ WARNING: exec() or eval() usage

Dynamic code execution can hide malicious behavior, especially when combined with base64 or network fetches.

Matches (first 20):

1551:+        content into the sandbox via exec(), so new/updated credentials are

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

@teknium1 teknium1 merged commit 7a3682a into main Mar 29, 2026
2 of 3 checks passed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ackends (NousResearch#3671)

Two related fixes for remote terminal backends (Modal/Docker):

1. NEW: Credential file mounting system
   Skills declare required_credential_files in frontmatter. Files are
   mounted into Docker (read-only bind mounts) and Modal (mounts at
   creation + sync via exec on each command for mid-session changes).
   Google Workspace skill updated with the new field.

2. FIX: Docker backend now includes env_passthrough vars
   Skills that declare required_environment_variables (e.g. Notion with
   NOTION_API_KEY) register vars in the env_passthrough system. The
   local backend checked this, but Docker's forward_env was a separate
   disconnected list. Now Docker exec merges both sources, so
   skill-declared env vars are forwarded into containers automatically.

   This fixes the reported issue where NOTION_API_KEY in ~/.hermes/.env
   wasn't reaching the Docker container despite being registered via
   the Notion skill's prerequisites.

Closes NousResearch#3665
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ackends (NousResearch#3671)

Two related fixes for remote terminal backends (Modal/Docker):

1. NEW: Credential file mounting system
   Skills declare required_credential_files in frontmatter. Files are
   mounted into Docker (read-only bind mounts) and Modal (mounts at
   creation + sync via exec on each command for mid-session changes).
   Google Workspace skill updated with the new field.

2. FIX: Docker backend now includes env_passthrough vars
   Skills that declare required_environment_variables (e.g. Notion with
   NOTION_API_KEY) register vars in the env_passthrough system. The
   local backend checked this, but Docker's forward_env was a separate
   disconnected list. Now Docker exec merges both sources, so
   skill-declared env vars are forwarded into containers automatically.

   This fixes the reported issue where NOTION_API_KEY in ~/.hermes/.env
   wasn't reaching the Docker container despite being registered via
   the Notion skill's prerequisites.

Closes NousResearch#3665
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…ackends (NousResearch#3671)

Two related fixes for remote terminal backends (Modal/Docker):

1. NEW: Credential file mounting system
   Skills declare required_credential_files in frontmatter. Files are
   mounted into Docker (read-only bind mounts) and Modal (mounts at
   creation + sync via exec on each command for mid-session changes).
   Google Workspace skill updated with the new field.

2. FIX: Docker backend now includes env_passthrough vars
   Skills that declare required_environment_variables (e.g. Notion with
   NOTION_API_KEY) register vars in the env_passthrough system. The
   local backend checked this, but Docker's forward_env was a separate
   disconnected list. Now Docker exec merges both sources, so
   skill-declared env vars are forwarded into containers automatically.

   This fixes the reported issue where NOTION_API_KEY in ~/.hermes/.env
   wasn't reaching the Docker container despite being registered via
   the Notion skill's prerequisites.

Closes NousResearch#3665
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ackends (NousResearch#3671)

Two related fixes for remote terminal backends (Modal/Docker):

1. NEW: Credential file mounting system
   Skills declare required_credential_files in frontmatter. Files are
   mounted into Docker (read-only bind mounts) and Modal (mounts at
   creation + sync via exec on each command for mid-session changes).
   Google Workspace skill updated with the new field.

2. FIX: Docker backend now includes env_passthrough vars
   Skills that declare required_environment_variables (e.g. Notion with
   NOTION_API_KEY) register vars in the env_passthrough system. The
   local backend checked this, but Docker's forward_env was a separate
   disconnected list. Now Docker exec merges both sources, so
   skill-declared env vars are forwarded into containers automatically.

   This fixes the reported issue where NOTION_API_KEY in ~/.hermes/.env
   wasn't reaching the Docker container despite being registered via
   the Notion skill's prerequisites.

Closes NousResearch#3665
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…ackends (NousResearch#3671)

Two related fixes for remote terminal backends (Modal/Docker):

1. NEW: Credential file mounting system
   Skills declare required_credential_files in frontmatter. Files are
   mounted into Docker (read-only bind mounts) and Modal (mounts at
   creation + sync via exec on each command for mid-session changes).
   Google Workspace skill updated with the new field.

2. FIX: Docker backend now includes env_passthrough vars
   Skills that declare required_environment_variables (e.g. Notion with
   NOTION_API_KEY) register vars in the env_passthrough system. The
   local backend checked this, but Docker's forward_env was a separate
   disconnected list. Now Docker exec merges both sources, so
   skill-declared env vars are forwarded into containers automatically.

   This fixes the reported issue where NOTION_API_KEY in ~/.hermes/.env
   wasn't reaching the Docker container despite being registered via
   the Notion skill's prerequisites.

Closes NousResearch#3665
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.

feat: mount skill credential files into remote terminal backends (Modal/Docker)

1 participant