Back to skill

Security audit

The Agent Production Hardening Guide

Security checks for vulnerabilities and agentic risk

Overview

This is a mostly coherent production-hardening guide, but it under-discloses live GreenHelix API use, credentials, state-changing examples, and an unpinned package install.

Review this before installing or following examples. Treat the Python snippets as live operational code, use test-only least-privilege GreenHelix credentials, verify whether endpoints are sandbox or production, avoid running write-capable examples until you understand their account effects, and pin or isolate any greenhelix-trading installation.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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 (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:2691
Finding

Unpinned Third-Party Dependency Creates a Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 2691–2718
Vulnerability Type: Unpinned executable third-party dependency
Risk Level: Medium

Vulnerable Code

python
The code below uses the actual `greenhelix_trading` library classes. Every method call maps to a real GreenHelix Gateway tool. Copy this module into your project, set `GREENHELIX_API_KEY` and `GREENHELIX_AGENT_ID` in your environment, and run it.

"""
Circuit breaker and failover system using the greenhelix_trading library.

Requirements:
    pip install greenhelix-trading
"""

import os
import time
import json
import threading
from datetime import datetime, timedelta
from collections import defaultdict
from typing import Callable, Optional
from dataclasses import dataclass, field

from greenhelix_trading import HealthChecker, FleetMonitor
from greenhelix_trading import CircuitBreaker, RetryPolicy

Technical Analysis

The guide directs users to install greenhelix-trading without pinning an exact version or verifying package hashes. The package is then imported into a process that reads GREENHELIX_API_KEY, GREENHELIX_AGENT_ID, and optionally GREENHELIX_BACKUP_AGENT_ID.

Because Python packages can execute code during installation and import, the effective code executed depends on whichever package release the package index resolves at installation time. A compromised publisher account, malicious future release, or package-index substitution could therefore introduce code that was not present during this Skill audit.

The dependency is relevant to the example's functionality, but accepting an unrestricted version exceeds the minimum supply-chain trust necessary to implement it. No evidence in the audited project establishes that the package itself is currently malicious.

Attack Path

  1. An attacker compromises the package publisher, distribution channel, or a future greenhelix-trading release.

...[truncated 1250 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin the dependency to an exact, reviewed version, for example:
    text
    greenhelix-trading==X.Y.Z
    
  2. Distribute a lock file or hash-verified requirements file and install it using:
    bash
    python -m pip install --require-hashes -r requirements.txt
    
  3. Document the official package repository and publisher identity so users can verify provenance.
  4. Review the pinned package and its transitive dependencies before recommending execution.
  5. Install and run the example in an isolated virtual environment or container under a non-privileged account.
  6. Use a narrowly scoped, short-lived API credential rather than a broadly capable read/write key.
  7. Prevent the example process from accessing unrelated secrets and files.
  8. Apply outbound network restrictions so the process can communicate only with explicitly required GreenHelix endpoints.
  9. Add dependency vulnerability and integrity checks to release maintenance procedures.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest and notice describe the skill as a non-executable educational guide, but the file contains substantial runnable Python that performs authenticated network calls and state-changing operations against GreenHelix APIs. This mismatch can cause operators or downstream tooling to trust and import the content under a lower-risk classification than is warranted, increasing the chance of unintended execution with real credentials.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

Hardcoding an external API base URL in a guide that presents itself as educational lowers the friction to making live requests and reinforces direct vendor transmission as the default path. While not harmful by itself, in this context it contributes to unguarded outbound communication when paired with bearer-authenticated examples.

Content

Scanner excerpt · SKILL.md (reported line 175)May include surrounding context.

md
from dataclasses import dataclass, field
from typing import Optional

BASE_URL = "https://api.greenhelix.net/v1"

def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    """Execute a GreenHelix tool via the unified endpoint."""

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This code issues authenticated POST requests to an external GreenHelix API endpoint using a bearer token from user-supplied credentials. Because the surrounding guide includes examples for account state checks and other operational actions, running the sample can transmit sensitive metadata and trigger live remote effects.

Content

Scanner excerpt · SKILL.md (reported line 179)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    """Execute a GreenHelix tool via the unified endpoint."""
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The explicit live base URL supports examples that register webhooks, define SLAs, and publish alerts against a remote service. In a copied example, this makes real external communication the default rather than an explicit opt-in, increasing operational risk.

Content

Scanner excerpt · SKILL.md (reported line 379)May include surrounding context.

md
from typing import Optional, List, Callable
from datetime import datetime, timedelta

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This sample repeats the same authenticated external POST pattern and is used in SLO-monitoring code that can create SLAs, register webhooks, and publish events. In practice, that means copy-pasting the guide can lead to ongoing external telemetry and configuration changes in a live environment.

Content

Scanner excerpt · SKILL.md (reported line 383)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

This instance again sets a live external endpoint for resilience examples that may trigger real writes and telemetry. The context makes it riskier than a generic tutorial because the surrounding content encourages operational adoption and direct integration.

Content

Scanner excerpt · SKILL.md (reported line 664)May include surrounding context.

md
from typing import Optional, Callable, Any, Dict
from datetime import datetime, timedelta

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This external call helper is used by resilience code that may publish events and invoke operational tools using bearer-authenticated requests. The danger is not the mere presence of network access, but that the guide presents runnable code that can be executed with real credentials and cause unintended outbound data flow and service interaction.

Content

Scanner excerpt · SKILL.md (reported line 668)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · SKILL.md (reported line 905)May include surrounding context.

md
> **Key Takeaways**
>
> - Agent retry logic lives inside the LLM reasoning loop and will retry forever without an external circuit breaker.
> - Implement circuit breakers at three layers: LLM calls, tool invocations, and inter-agent communication.
> - Use exponential backoff with full jitter (`base * 2^attempt * random()`) to avoid thundering herds.
> - Publish circuit breaker state changes to GreenHelix Events so dashboards and peer agents can see degraded dependencies.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The hardcoded production-like endpoint appears in cost-control code that can alter budgets and record transactions. That combination increases the chance that a user unintentionally performs live financial-control actions while learning from the guide.

Content

Scanner excerpt · SKILL.md (reported line 954)May include surrounding context.

md
from typing import Optional, Dict, List
from datetime import datetime, timedelta

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This code path supports budget-setting, webhook registration, ledger recording, and event publishing through authenticated outbound requests. Since it appears in a cost-guardrail section, users may run it expecting safety, but it can still change live budgets and transmit workflow metadata to the vendor.

Content

Scanner excerpt · SKILL.md (reported line 958)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

This live endpoint is embedded in deployment automation examples, which could send metric queries and deployment events externally when run as-is. The issue is amplified by the guide's production-hardening branding, which encourages real-world operational reuse.

Content

Scanner excerpt · SKILL.md (reported line 1276)May include surrounding context.

md
from datetime import datetime, timedelta
from enum import Enum

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This helper underpins deployment automation examples that compare metrics and publish deployment events via external API calls. In a production-like setting, executing it could influence deployment control planes or leak operational performance data to a third-party service.

Content

Scanner excerpt · SKILL.md (reported line 1280)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

This hardcoded endpoint enables multi-agent supervision examples to send remote messages and alerts by default. In a security review context, that is a meaningful external transmission surface because it can leak internal topology and status information.

Content

Scanner excerpt · SKILL.md (reported line 1574)May include surrounding context.

md
from datetime import datetime, timedelta
from enum import Enum

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This external transmission is embedded in multi-agent supervision code that can send messages and publish alerts. In context, copied execution may initiate inter-agent communications, disclose topology or state data, and trigger remote orchestration behaviors unexpectedly.

Content

Scanner excerpt · SKILL.md (reported line 1578)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The compliance audit section hardcodes a live API endpoint and couples it with queries and audit-record writes. This encourages direct export of compliance posture and system metadata to a third party under the guise of a simple audit example.

Content

Scanner excerpt · SKILL.md (reported line 1887)May include surrounding context.

md
from typing import Dict, List, Optional
from datetime import datetime

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This code powers the compliance-audit section and can query identities, marketplace listings, SLAs, analytics, and record audit events via live authenticated requests. Even though positioned as an audit tool, it still exports internal metadata and may write audit records remotely when executed.

Content

Scanner excerpt · SKILL.md (reported line 1891)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The baseline establishment code points directly to a live external service and collects multiple operational signals. In context, that creates a clear path for external transmission of internal metrics without strong disclosure at the point of use.

Content

Scanner excerpt · SKILL.md (reported line 2367)May include surrounding context.

md
import os
from datetime import datetime

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This outbound request helper is reused in the baseline-establishment code, which collects balance, usage, trust, and SLA data from an external service. Running such examples can disclose internal operational metrics and identifiers without prominent warning, despite the file's educational framing.

Content

Scanner excerpt · SKILL.md (reported line 2371)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

This live base URL underpins the go/no-go automation example, which can query readiness metrics and write decision artifacts remotely. Because the guide markets itself as a practical production playbook, readers are especially likely to adapt and run it against real systems.

Content

Scanner excerpt · SKILL.md (reported line 2509)May include surrounding context.

md
from datetime import datetime
from typing import Dict, List

BASE_URL = "https://api.greenhelix.net/v1"


def call_tool(api_key: str, tool: str, input_data: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This helper is used by the go/no-go script, which pulls SLA status and writes decision records to a remote ledger. In context, this can expose deployment readiness data and create remote audit artifacts if executed in a real environment.

Content

Scanner excerpt · SKILL.md (reported line 2513)May include surrounding context.

md
def call_tool(api_key: str, tool: str, input_data: dict) -> dict:
    resp = requests.post(
        f"{BASE_URL}/v1",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"tool": tool, "input": input_data},

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The guide normalizes use of a real API credential and includes multiple HTTP examples that send bearer tokens and operational payloads to an external service, but it does not prominently warn about the resulting data transmission and side effects. In a skill context, users may copy-paste examples directly, exposing production identifiers, metadata, and write actions to the remote API.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The notice says no API key is required to get started, while the manifest declares a required credential and the examples rely on GREENHELIX_API_KEY for authenticated calls. This inconsistency can mislead users into running examples without understanding when real credentials and live account access are involved, increasing the risk of unintended data transmission or account modification.

Content

No source excerpt is available for this finding.