feat: secure skill env setup on load (core #688)#1153
Merged
Conversation
When a skill declares required_environment_variables in its YAML frontmatter, missing env vars trigger a secure TUI prompt (identical to the sudo password widget) when the skill is loaded. Secrets flow directly to ~/.hermes/.env, never entering LLM context. Key changes: - New required_environment_variables frontmatter field for skills - Secure TUI widget (masked input, 120s timeout) - Gateway safety: messaging platforms show local setup guidance - Legacy prerequisites.env_vars normalized into new format - Remote backend handling: conservative setup_needed=True - Env var name validation, file permissions hardened to 0o600 - Redact patterns extended for secret-related JSON fields - 12 existing skills updated with prerequisites declarations - ~48 new tests covering skip, timeout, gateway, remote backends - Dynamic panel widget sizing (fixes hardcoded width from original PR) Cherry-picked from PR #723 by kshitijk4poor, rebased onto current main with conflict resolution. Fixes #688 Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
05332b2 to
ccfbf42
Compare
This was referenced Mar 13, 2026
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…42bc21fb feat: secure skill env setup on load (core NousResearch#688)
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…42bc21fb feat: secure skill env setup on load (core NousResearch#688)
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
…42bc21fb feat: secure skill env setup on load (core NousResearch#688)
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…42bc21fb feat: secure skill env setup on load (core NousResearch#688)
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.
Summary
Merges PR #723 by @kshitijk4poor — rebased onto current main with conflict resolution and minor fixes.
When a skill declares
required_environment_variablesin its YAML frontmatter, missing env vars trigger a secure TUI prompt (identical to the sudo password widget) when the skill is loaded. Secrets flow directly to~/.hermes/.env, never entering LLM context.Key Changes
Core feature (
tools/skills_tool.py):required_environment_variablesfrontmatter fieldSkillReadinessStatusenum (AVAILABLE, SETUP_NEEDED, UNSUPPORTED)_capture_required_environment_variables()— orchestrates secure promptingset_secret_capture_callback()— callback pattern (same as sudo)setup_needed=Truefor docker/ssh/modal/etc.CLI integration (
cli.py,hermes_cli/callbacks.py):prompt_for_secret()— 120s TUI prompt with masked input (🔑 icon)getpass.getpass()_panel_box_width()(improved over original PR)Skill slash commands (
agent/skill_commands.py):build_skill_invocation_message()now routes throughskill_view()for env setupConfig (
hermes_cli/config.py):save_env_value_secure()— writes to .env with 0o600 permissionsos.environupdate12 skills updated with prerequisites:
gif-search, himalaya, notion, apple-notes/reminders/imessage, codebase-inspection, mcporter, songsee, blogwatcher, duckduckgo-search, openhue
Security: Secrets never enter LLM context. The callback result contains only metadata (
stored_as,skipped,validated) — never the secret value.Merge Details
Original PR #723 was 264 commits behind main with 7 merge conflicts. All conflicts resolved:
CONTRIBUTING.md— kept both conditional activation + setup metadata sectionscli.py— merged command_running state + secret state, hint height, honcho flushskills/research/duckduckgo-search/SKILL.md— kept both fallback_for_toolsets + prerequisitestests/agent/test_prompt_builder.py— updated imports for renamed functiontests/test_run_agent.py— kept currentcall_llmmock (not staleget_text_auxiliary_client)tools/skills_tool.py— preserved disabled skill filtering + platform check orderingwebsite/docs/user-guide/features/skills.md— kept both conditional activation + secure setup sectionsMinor Fix
_panel_box_width()for dynamic sizing instead of hardcoded width (matches sudo/approval widget pattern)Test Plan
Closes #688
Co-authored-by: kshitijk4poor kshitijk4poor@users.noreply.github.com