mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
improve(agent): guidance for plain-text URLs, subagent language/verification, hermes-config routing (#16325)
Four small tool-description / skill-content tweaks addressing recurring model mistakes seen in @versun's docx feedback (Kimi 2.6, but the patterns apply to every model): 1. browser_navigate description: call out .md/.txt/.json/.yaml/.csv/.xml, raw.githubusercontent.com, and API endpoints as specifically preferring curl or web_extract. The generic "prefer web_search or web_extract" was too weak; models kept firing up the browser for plain-text URLs. 2. delegate_task description: two additions. (a) Pass user language / output-style preferences in 'context' when they differ from English — otherwise subagents default to English and their summaries contaminate the final reply (caused the bilingual digest bug). (b) Subagent summaries are self-reports, not verified facts. For operations with external side-effects (HTTP uploads, remote writes, file creation at shared paths), require a verifiable handle (URL, ID, path) and verify it yourself before claiming success. 3. agent/prompt_builder.py Skills-mandatory block: new explicit line "Whenever the user asks to configure / set up / modify / install / enable / disable / troubleshoot Hermes Agent itself, load the `hermes-agent` skill first." The generic "load what's relevant" didn't route Hermes-meta questions (like "how do I turn off redaction?") to the one skill that has the answer. 4. skills/autonomous-ai-agents/hermes-agent/SKILL.md: new "Security & Privacy Toggles" section covering security.redact_secrets (with the import-time-snapshot restart-required caveat), privacy.redact_pii, approvals.mode (manual/smart/off) + --yolo + HERMES_YOLO_MODE, shell hooks allowlist, and how to disable network/media tools entirely. Every command verified against the actual config keys — no invented knobs. Co-authored-by: teknium1 <teknium@noreply.github.com>
This commit is contained in:
@@ -848,6 +848,11 @@ def build_skills_system_prompt(
|
|||||||
"Skills also encode the user's preferred approach, conventions, and quality standards "
|
"Skills also encode the user's preferred approach, conventions, and quality standards "
|
||||||
"for tasks like code review, planning, and testing — load them even for tasks you "
|
"for tasks like code review, planning, and testing — load them even for tasks you "
|
||||||
"already know how to do, because the skill defines how it should be done here.\n"
|
"already know how to do, because the skill defines how it should be done here.\n"
|
||||||
|
"Whenever the user asks you to configure, set up, install, enable, disable, modify, "
|
||||||
|
"or troubleshoot Hermes Agent itself — its CLI, config, models, providers, tools, "
|
||||||
|
"skills, voice, gateway, plugins, or any feature — load the `hermes-agent` skill "
|
||||||
|
"first. It has the actual commands (e.g. `hermes config set …`, `hermes tools`, "
|
||||||
|
"`hermes setup`) so you don't have to guess or invent workarounds.\n"
|
||||||
"If a skill has issues, fix it with skill_manage(action='patch').\n"
|
"If a skill has issues, fix it with skill_manage(action='patch').\n"
|
||||||
"After difficult/iterative tasks, offer to save as a skill. "
|
"After difficult/iterative tasks, offer to save as a skill. "
|
||||||
"If a skill you loaded was missing steps, had wrong commands, or needed "
|
"If a skill you loaded was missing steps, had wrong commands, or needed "
|
||||||
|
|||||||
@@ -402,6 +402,63 @@ Tool changes take effect on `/reset` (new session). They do NOT apply mid-conver
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Security & Privacy Toggles
|
||||||
|
|
||||||
|
Common "why is Hermes doing X to my output / tool calls / commands?" toggles — and the exact commands to change them. Most of these need a fresh session (`/reset` in chat, or start a new `hermes` invocation) because they're read once at startup.
|
||||||
|
|
||||||
|
### Secret redaction in tool output
|
||||||
|
|
||||||
|
Hermes auto-redacts strings that look like API keys, tokens, and secrets in all tool output (terminal stdout, `read_file`, web content, subagent summaries, etc.) so the model never sees raw credentials. If the user is intentionally working with mock tokens, share-management tokens, or their own secrets and the redaction is getting in the way:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hermes config set security.redact_secrets false # disable globally
|
||||||
|
```
|
||||||
|
|
||||||
|
**Restart required.** `security.redact_secrets` is snapshotted at import time — setting it mid-session (e.g. via `export HERMES_REDACT_SECRETS=false` from a tool call) will NOT take effect for the running process. Tell the user to run `hermes config set security.redact_secrets false` in a terminal, then start a new session. This is deliberate — it prevents an LLM from turning off redaction on itself mid-task.
|
||||||
|
|
||||||
|
Re-enable with:
|
||||||
|
```bash
|
||||||
|
hermes config set security.redact_secrets true
|
||||||
|
```
|
||||||
|
|
||||||
|
### PII redaction in gateway messages
|
||||||
|
|
||||||
|
Separate from secret redaction. When enabled, the gateway hashes user IDs and strips phone numbers from the session context before it reaches the model:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hermes config set privacy.redact_pii true # enable
|
||||||
|
hermes config set privacy.redact_pii false # disable (default)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Command approval prompts
|
||||||
|
|
||||||
|
By default (`approvals.mode: manual`), Hermes prompts the user before running shell commands flagged as destructive (`rm -rf`, `git reset --hard`, etc.). The modes are:
|
||||||
|
|
||||||
|
- `manual` — always prompt (default)
|
||||||
|
- `smart` — use an auxiliary LLM to auto-approve low-risk commands, prompt on high-risk
|
||||||
|
- `off` — skip all approval prompts (equivalent to `--yolo`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hermes config set approvals.mode smart # recommended middle ground
|
||||||
|
hermes config set approvals.mode off # bypass everything (not recommended)
|
||||||
|
```
|
||||||
|
|
||||||
|
Per-invocation bypass without changing config:
|
||||||
|
- `hermes --yolo …`
|
||||||
|
- `export HERMES_YOLO_MODE=1`
|
||||||
|
|
||||||
|
Note: YOLO / `approvals.mode: off` does NOT turn off secret redaction. They are independent.
|
||||||
|
|
||||||
|
### Shell hooks allowlist
|
||||||
|
|
||||||
|
Some shell-hook integrations require explicit allowlisting before they fire. Managed via `~/.hermes/shell-hooks-allowlist.json` — prompted interactively the first time a hook wants to run.
|
||||||
|
|
||||||
|
### Disabling the web/browser/image-gen tools
|
||||||
|
|
||||||
|
To keep the model away from network or media tools entirely, open `hermes tools` and toggle per-platform. Takes effect on next session (`/reset`). See the Tools & Skills section above.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Voice & Transcription
|
## Voice & Transcription
|
||||||
|
|
||||||
### STT (Voice → Text)
|
### STT (Voice → Text)
|
||||||
|
|||||||
@@ -995,7 +995,7 @@ atexit.register(_stop_browser_cleanup_thread)
|
|||||||
BROWSER_TOOL_SCHEMAS = [
|
BROWSER_TOOL_SCHEMAS = [
|
||||||
{
|
{
|
||||||
"name": "browser_navigate",
|
"name": "browser_navigate",
|
||||||
"description": "Navigate to a URL in the browser. Initializes the session and loads the page. Must be called before other browser tools. For simple information retrieval, prefer web_search or web_extract (faster, cheaper). Use browser tools when you need to interact with a page (click, fill forms, dynamic content). Returns a compact page snapshot with interactive elements and ref IDs — no need to call browser_snapshot separately after navigating.",
|
"description": "Navigate to a URL in the browser. Initializes the session and loads the page. Must be called before other browser tools. For simple information retrieval, prefer web_search or web_extract (faster, cheaper). For plain-text endpoints — URLs ending in .md, .txt, .json, .yaml, .yml, .csv, .xml, raw.githubusercontent.com, or any documented API endpoint — prefer curl via the terminal tool or web_extract; the browser stack is overkill and much slower for these. Use browser tools when you need to interact with a page (click, fill forms, dynamic content). Returns a compact page snapshot with interactive elements and ref IDs — no need to call browser_snapshot separately after navigating.",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -2316,6 +2316,18 @@ DELEGATE_TASK_SCHEMA = {
|
|||||||
"IMPORTANT:\n"
|
"IMPORTANT:\n"
|
||||||
"- Subagents have NO memory of your conversation. Pass all relevant "
|
"- Subagents have NO memory of your conversation. Pass all relevant "
|
||||||
"info (file paths, error messages, constraints) via the 'context' field.\n"
|
"info (file paths, error messages, constraints) via the 'context' field.\n"
|
||||||
|
"- If the user is writing in a non-English language, or asked for "
|
||||||
|
"output in a specific language / tone / style, say so in 'context' "
|
||||||
|
"(e.g. \"respond in Chinese\", \"return output in Japanese\"). "
|
||||||
|
"Otherwise subagents default to English and their summaries will "
|
||||||
|
"contaminate your final reply with the wrong language.\n"
|
||||||
|
"- Subagent summaries are SELF-REPORTS, not verified facts. A subagent "
|
||||||
|
"that claims \"uploaded successfully\" or \"file written\" may be wrong. "
|
||||||
|
"For operations with external side-effects (HTTP POST/PUT, remote "
|
||||||
|
"writes, file creation at shared paths, publishing), require the "
|
||||||
|
"subagent to return a verifiable handle (URL, ID, absolute path, HTTP "
|
||||||
|
"status) and verify it yourself — fetch the URL, stat the file, read "
|
||||||
|
"back the content — before telling the user the operation succeeded.\n"
|
||||||
"- Leaf subagents (role='leaf', the default) CANNOT call: "
|
"- Leaf subagents (role='leaf', the default) CANNOT call: "
|
||||||
"delegate_task, clarify, memory, send_message, execute_code.\n"
|
"delegate_task, clarify, memory, send_message, execute_code.\n"
|
||||||
"- Orchestrator subagents (role='orchestrator') retain "
|
"- Orchestrator subagents (role='orchestrator') retain "
|
||||||
|
|||||||
Reference in New Issue
Block a user