Back to skill

Security audit

Hermes Guard

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent AI quality-control helper, but it advertises automatic persistent changes to agent instructions without clear approval, rollback, or scoping.

Review this carefully before installing. Use it only in a disposable or version-controlled project until you can confirm whether corrections are proposed for review before they modify AGENTS.md or register tools. Pin and verify the Python package version, inspect diffs, and avoid running it where agent instruction files, credentials, or production repositories could be changed automatically.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:55
Finding

Unpinned Third-Party Package Installation and Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 55-58
Vulnerability Type: Unpinned external executable dependency
Risk Level: Medium

Vulnerable Code Snippet

bash
pip install hermes-guard
hermes-guard audit

Technical Analysis

The installation command retrieves the latest available hermes-guard package from the default Python Package Index without pinning a reviewed version or verifying an integrity hash. The subsequently invoked console command executes code supplied by that external package.

The implementation of the dependency is not included in the audited artifact. Consequently, its behavior cannot be verified, and the code users receive may change independently after this skill has been reviewed. A compromised publisher account, malicious future release, package-index compromise, or dependency-confusion condition could introduce attacker-controlled code.

This finding does not establish that the current package is malicious. It identifies an unsafe supply-chain trust model in the documented installation process.

Attack Path

  1. An attacker compromises the package publisher, package distribution channel, or a transitive dependency.
  2. The attacker publishes a malicious release under the package name used by the documentation.
  3. A user follows the documented pip install hermes-guard command.
  4. Because no version or hash is specified, pip retrieves the attacker-controlled release.
  5. Package installation hooks, imported modules, or the subsequent hermes-guard audit command execute the malicious code.
  6. The code runs with the privileges of the user or service account performing the installation and audit.

Impact Assessment

Successful exploitation could permit arbitrary code execution with the installing user's privileges. Depending on that account's permissions, this may expose project files, environment variables, API credentials, Agent configuration, and oth ...[truncated 223 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin the package to a specifically reviewed version rather than installing the latest release.
  2. Publish a lock file containing exact versions for all transitive dependencies.
  3. Require cryptographic hashes by using a hash-locked requirements file and pip's --require-hashes option.
  4. Document the authoritative package repository and verify that package ownership matches the linked source repository.
  5. Build packages in a controlled pipeline and verify signed release artifacts where supported.
  6. Run the package inside an isolated environment with minimal filesystem, network, and credential access.
  7. Include the executable implementation in the review scope so its actual behavior can be audited before deployment.

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:62
Finding

Unreviewed Corrections Can Be Persisted into Agent Instructions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 62-69; persistent rule behavior is also described at lines 24 and 31
Vulnerability Type: Persistent Agent instruction modification
Risk Level: High

Vulnerable Code Snippet

python
from hermes_guard import CompletionGate

gate = CompletionGate()
result = gate.check(agent_output)
if result.passed:
    return result.content
else:
    gate.correct(result)

Technical Analysis

The documented failure path passes a rejected Agent result directly to gate.correct(result). Elsewhere in the same file, the feature is described as generating correction rules and persisting them into AGENTS.md so that they affect later sessions.

AGENTS.md is an instruction-bearing file commonly consumed by Agents. Automatically deriving persistent instructions from potentially attacker-influenced output creates a memory-poisoning boundary: content from an untrusted interaction may be transformed into durable control instructions without human approval.

The documentation does not specify validation, provenance tracking, rule scoping, integrity protection, conflict resolution, rollback, or an approval gate. It also does not establish that generated corrections are restricted to declarative quality metadata rather than executable Agent instructions.

The implementation is absent from the artifact, so it is not possible to confirm whether undocumented safeguards exist. The risk is based on the explicitly documented persistence design and invocation pattern.

Attack Path

  1. An attacker supplies input that influences agent_output, such as adversarial text embedded in a user request or processed document.
  2. The resulting output fails the completion gate.
  3. The failure branch invokes gate.correct(result).
  4. The correction mechanism derives a rule from the attacker-influenced result.
  5. The generated rule is persisted into AGENTS.md without a docum ...[truncated 893 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require explicit human approval before any generated correction is written to an Agent instruction file.
  2. Treat model output and rejected results as untrusted data; never copy them directly into persistent instructions.
  3. Validate corrections against a restrictive schema that permits only narrowly scoped, declarative quality rules.
  4. Reject correction content containing instruction-precedence changes, tool directives, external resource references, secret requests, or unrelated behavioral commands.
  5. Store proposed corrections in a separate, non-executable review queue rather than directly in AGENTS.md.
  6. Record the source interaction, author, timestamp, generated diff, approval identity, and affected scope for every accepted rule.
  7. Add versioning, integrity checks, conflict detection, expiration, and one-step rollback for all persisted corrections.
  8. Scope approved rules to the relevant task or Agent instead of applying them globally.
  9. Add adversarial tests demonstrating that prompt-injected output cannot become a persistent instruction.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly claims it will automatically write correction rules into project control files, but does not warn users that it may persist changes to repository state or agent configuration. In an agent environment, undocumented self-modification can alter future behavior, introduce unsafe rules, or create hard-to-audit drift without operator approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The architecture states that low-scoring outputs automatically write CORRECTION rules with no review gate, implying autonomous modification of system behavior based on model judgments alone. That is risky because false positives, prompt-injected content, or bad evaluations could be converted into persistent policy changes that affect later runs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The example code invokes gate.correct(result) directly after a failed check, normalizing automatic persistence behavior without disclosing side effects. Users may copy-paste this pattern into production and unknowingly enable self-modifying behavior that changes rules or files based on potentially unreliable model output.

Content

No source excerpt is available for this finding.