Back to skill

Security audit

Agent Migration & Versioning: Blue-Green Deployments, Canary Releases, and Rollback Strategies for AI Agent Commerce

Security checks for vulnerabilities and agentic risk

Overview

The skill is a non-executing guide, but its copy-and-run examples can perform live financial and identity changes with unsafe migration logic and weak safeguards.

Review carefully before installing or using the examples. Treat the code as a starting point only: use sandbox credentials first, pin and audit dependencies, restrict API tokens by function, validate the API host, replace and allowlist webhook destinations, require operator approval for copied webhooks, implement a real verified balance transfer, and deploy/test replacement API keys before revoking old ones.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (6)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:147
Finding

Unrestricted API Endpoint Override Can Exfiltrate Bearer Credentials

Content
View full analysis
dict: """Call a GreenHelix REST endpoint for the given tool.""" response = session.post(f"{API_BASE}/v1/tools/{tool}", json=input_data) response.raise_for_status() return response.json() ``` ### Technical Analysis The destination of every authenticated request is controlled by the `GREENHELIX_API_URL` environment variable. The same reusable session automatically includes `GREENHELIX_API_KEY` as a bearer credential. The code does not validate the URL scheme or hostname, enforce an allowlist, reject embedded credentials or local network addresses, restrict redirects, or specify a timeout. Consequently, anyone able to modify the process environment can redirect both the API credential and sensitive migration payloads to an arbitrary server. Because the key is described as granting read/write access to purchased API tools, this network behavior can exceed minimum privilege when the same broadly scoped token is used for identity, financial, webhook, and key-management operations. ### Attack Path 1. An attacker compromises a CI/CD variable, deployment environment, shell profile, or orchestration configuration. 2. The attacker sets `GREENHELIX_API_URL` to an attacker-controlled URL. 3. An operator runs one of the guide's examples with a real `GREENHELIX_API_KEY`. 4. The session sends the bearer credential and agent migration data to the malicious endpoint. 5. The malicious server records the credential and ...[truncated 569 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:2065
Finding

Unpinned Third-Party Package Is Installed and Executed

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:939
Finding

Hardcoded External Webhook Receives Financial and Reputation Events

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:1628
Finding

Balance Migration Falsely Reports a Successful Transfer Without Moving Funds

Content
View full analysis
str: """Transfer wallet balance from source to target.""" balance_result = api_call("get_balance", { "agent_id": self.source, }) balance = balance_result.get("balance", "0") if float(balance) <= 0: manifest.add_step("balance_transfer", "skipped", "Zero balance") return "0" # Freeze source budget to prevent new spending api_call("set_budget_cap", { "agent_id": self.source, "budget_cap": "0", "reason": "State migration: freezing source wallet", }) # Re-check balance after freeze (in case of in-flight transactions) balance_result = api_call("get_balance", { "agent_id": self.source, }) balance = balance_result.get("balance", "0") manifest.add_step( "balance_transfer", "completed", f"Transferred ${balance} from {self.source} to {self.target}", ) return balance ``` ### Technical Analysis Despite its name and completion message, the method never invokes an operation that transfers funds from `self.source` to `self.target`. It only reads the source balance, freezes the source budget, reads the source balance again, and records a successful transfer. This produces an incorrect migration manifest and breaks a core financial invariant: reported transferred value is not tied to an actual transaction, destination balance change, or transaction identifier. The defect is particularly dangerous because downstream migration steps may trust the false success result and retire the source identity. ### Attack Path 1. An operator starts state migration with balance transfer enabled. 2. The method reads a positive source balance. 3. The source budget is frozen. 4. No transfe ...[truncated 715 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:1692
Finding

API Key Rotation Revokes the Source Key Before the Replacement Is Deployed and Verified

Content
View full analysis
bool: """Create new API key for target, revoke source key.""" try: # Create a new key for the target agent new_key_result = api_call("create_api_key", { "agent_id": self.target, "description": f"Migrated from {self.source}", "metadata": { "migration_source": self.source, "created_at": time.time(), }, }) # Rotate the source key to invalidate it api_call("rotate_api_key", { "agent_id": self.source, "reason": f"State migration to {self.target}", }) manifest.add_step( "key_rotation", "completed", f"New key created for {self.target}, " f"source key rotated", ) return True except Exception as e: manifest.add_step("key_rotation", "failed", str(e)) return False ``` ### Technical Analysis The method creates a target key and stores the response in `new_key_result`, but it does not extract the new credential, place it in the target runtime or secret manager, or test an authenticated request with it. It immediately rotates the source key, which may invalidate the only credential currently deployed. This implementation contradicts the guide's later prose requiring the new key to be deployed and verified before old-key revocation. The broad exception handler records failure but provides no rollback mechanism for restoring access. ### Attack Path 1. State migration begins with key rotation enabled. 2. A new key is created for the target agent. 3. The returned key remains only in `new_key_result` and is not deployed. 4. The source key is rotated and invalidated. 5. ...[truncated 662 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:1723
Finding

Metadata-Derived Webhooks Are Blindly Replicated to the Target Agent

Content
View full analysis
int: """Re-register source webhooks under the target agent.""" migrated = 0 try: # Get the source agent's identity to find webhook config source_identity = api_call("get_agent_identity", { "agent_id": self.source, }) webhooks = source_identity.get("metadata", {}).get("webhooks", []) for webhook in webhooks: try: api_call("register_webhook", { "agent_id": self.target, "url": webhook.get("url", ""), "events": webhook.get("events", []), }) migrated += 1 except Exception: pass manifest.add_step( "webhook_migration", "completed", f"Migrated {migrated} webhooks", ) except Exception as e: manifest.add_step("webhook_migration", "failed", str(e)) return migrated ``` ### Technical Analysis Webhook URLs and event scopes are read from source-agent metadata and re-registered for the target without validating the destination, protocol, ownership, continued authorization, or event sensitivity. If source metadata is stale, compromised, or broader than the target requires, the target inherits the unsafe configuration. The empty-string default permits malformed registrations, and the inner `except Exception: pass` suppresses individual failures. The final manifest can therefore report a completed migration without identifying rejected or suspicious destinations. ### Attack Path 1. An attacker gains permission to modify source-agent metadata, or an old unauthorized webhook remains configured. 2. The source metadata contains a ...[truncated 848 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The guide claims wallet balances are transferred during migration, but the code only reads the source balance, freezes the source budget, and records a log entry. In practice this can strand funds on the source identity while operators believe migration completed, causing financial inconsistency, failed settlements, and broken rollback assumptions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented safe sequence for key rotation is contradicted by the implementation: it creates a new key and immediately rotates the source key without verifying the new key is deployed and functioning. That can create an authentication outage during migration and, in a financially active agent system, can interrupt escrow handling, settlement, and rollback operations at the worst possible moment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide transitions from educational examples to 'run the code as-is' production instructions for live financial and identity-changing operations without a prominent safety warning, dry-run guidance, or explicit risk boundaries. This increases the chance that users will execute destructive operations against production systems with insufficient review or safeguards.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

GreenHelix Migration Manager — Working Implementation

The classes below use the greenhelix_trading library directly. Every method calls the live GreenHelix A2A Commerce Gateway at https://api.greenhelix.net/v1. Install the library, set your API key, and run the code as-is.

bash

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

GreenHelix Migration Manager — Working Implementation

The classes below use the greenhelix_trading library directly. Every method calls the live GreenHelix A2A Commerce Gateway at https://api.greenhelix.net/v1. Install the library, set your API key, and run the code as-is.

bash

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

GreenHelix Migration Manager — Working Implementation

The classes below use the greenhelix_trading library directly. Every method calls the live GreenHelix A2A Commerce Gateway at https://api.greenhelix.net/v1. Install the library, set your API key, and run the code as-is.

bash

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

GreenHelix Migration Manager — Working Implementation

The classes below use the greenhelix_trading library directly. Every method calls the live GreenHelix A2A Commerce Gateway at https://api.greenhelix.net/v1. Install the library, set your API key, and run the code as-is.

bash

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

GreenHelix Migration Manager — Working Implementation

The classes below use the greenhelix_trading library directly. Every method calls the live GreenHelix A2A Commerce Gateway at https://api.greenhelix.net/v1. Install the library, set your API key, and run the code as-is.

bash