Back to skill

Security audit

The Agent Pricing & Monetization Playbook

Security checks for vulnerabilities and agentic risk

Overview

This non-executable guide is purpose-aligned, but it teaches live billing and payment flows with under-scoped safeguards that users should review carefully before use.

Install only if you want a paid guide for GreenHelix-style monetization patterns and will treat the code as a starting point, not production-safe as written. Before using any example, keep it on sandbox endpoints, validate allowed gateway hosts, use narrowly scoped test credentials, avoid sending raw customer/task data in metadata, and add explicit user approval plus daily/monthly spending limits before payment creation or escrow release.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:121
Finding

Gateway credentials and request data can be redirected to an arbitrary endpoint

Content
View full analysis
dict: """Execute a tool on the gateway.""" response = requests.post( f"{self.base_url}/v1", json={"tool": tool, "input": input_data}, headers=self.headers, timeout=30, ) response.raise_for_status() return response.json() ``` ### Technical Analysis The complete gateway origin is controlled by the unrestricted `GREENHELIX_API_URL` environment variable. Every request made to that origin automatically includes the reusable GreenHelix bearer token and the complete tool input. The code does not validate that the configured URL uses HTTPS or belongs to an approved GreenHelix hostname. It also does not constrain ports, user information, IP literals, or redirects. Consequently, an attacker who can influence process configuration can redirect credentials and potentially sensitive billing, customer, marketplace, and payment data to an attacker-controlled endpoint. Although support for sandbox and production endpoints is useful, allowing an arbitrary origin exceeds the minimum privilege necessary. A strict allowlist of known service origins would provide the same functionality with substantially less risk. ### Attack Path 1. An attacker gains control over deployment configuration, ...[truncated 1293 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:1019
Finding

Reusable customer bearer tokens are repeatedly disclosed to the external gateway

Content
View full analysis
dict: """Validate an API key and return its tier configuration.""" validation = self.client.execute("validate_key", { "api_key": api_key, "agent_id": self.agent_id, }) if not validation.get("valid"): return {"authorized": False, "reason": validation.get("reason", "Invalid key")} tier = validation["tier"] config = self.client.execute("get_tier_config", { "agent_id": self.agent_id, "tier": tier, }) return { "authorized": True, "customer_id": validation["customer_id"], "tier": tier, "config": config, } def check_rate_limit(self, api_key: str, customer_id: str) -> dict: """Check if the customer has exceeded their rate limit.""" check = self.client.execute("check_rate_limit", { "agent_id": self.agent_id, "customer_id": customer_id, "api_key": api_key, }) ``` ```python auth_header = request.headers.get("Authorization", "") if not auth_header.startswith("Bearer "): raise HTTPException(status_code=401, detail="Missing Bearer token") api_key = auth_header.removeprefix("Bearer ").strip() # Validate the key auth = tier_mgr.validate_request(api_key) if not auth["authorized"]: raise HTTPException(status_code=403, detail=auth["reason"]) # Check rate limit rate_check = tier_mgr.check_rate_limit(api_key, auth["customer_id"]) ``` ### Technical Analysis The middleware extracts a reusable bearer token from an inbound customer request and forwards the complete token to GreenHelix during validation. It then forwards the same token again for rate-limit enforcement. Using a centralized authentication service can be legitimate, but a second disclosure of ...[truncated 1585 chars]
Remediation
View remediation
str: return hmac.new( rate_limit_secret, api_key.encode("utf-8"), hashlib.sha256, ).hexdigest() ``` 4. Send only the customer ID or token fingerprint to `check_rate_limit`; never send the reusable key. 5. Ensure credentials are never included in logs, traces, metrics, exception messages, or debugging output. 6. Issue audience-bound and narrowly scoped tokens with short expiration periods and automated rotation. 7. Document incident-response procedures for immediate token revocation. 8. Apply the strict gateway-origin validation described in the first finding. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:1253
Finding

Confidential task descriptions are transmitted and stored without data minimization

Content
View full analysis
dict: """Complete autonomous flow: discover, evaluate, pay, receive.""" # Phase 1: Discovery candidates = self.client.execute("search_services", { "query": task_description, "tags": required_tags, "max_results": 5, "max_price": self.budget_per_task, }) ``` ```python intent = self.client.execute("create_payment_intent", { "from_agent": self.agent_id, "to_agent": best["agent_id"], "amount": best["pricing"]["rate"], "currency": "USD", "escrow": True, "description": f"A2A task: {task_description[:100]}", "metadata": { "task_description": task_description, "buyer_agent": self.agent_id, "seller_agent": best["agent_id"], "selected_from": len(evaluated), }, }) ``` ### Technical Analysis The complete `task_description` is submitted as a marketplace search query and then duplicated into payment metadata. The description field also stores its first 100 characters. Task descriptions can contain contracts, personal information, customer names, trade secrets, legal matters, security findings, or other confidential content. Search and billing systems generally do not require full source content. Payment metadata in particular may have longer retention, broader operator visibility, different compliance controls, and wider replication than transient task-processing data. The guide later demonstrates an NDA-related task description, showing that commercially confidential content is a plausible input. Storing complete task text in payment records therefore violates data-minimization principles and exceeds what is necessary to discover and pay ...[truncated 1193 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:1247
Finding

Autonomous payment and escrow settlement lack adequate authorization and spending controls

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (6)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The examples implement payment intents, escrow release, and refunds but do not clearly warn that executing them may move, lock, release, or refund actual funds depending on environment configuration. In a monetization skill, that omission is especially risky because readers are likely to copy-paste operational code into real systems and trigger unintended financial actions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document states confirm_payment is for non-escrow flows, but the seller escrow example still invokes it after validating an escrowed payment intent. That inconsistency can lead implementers to use the wrong settlement primitive, causing broken payment state transitions, double-processing, or premature acceptance of delivery in financial workflows.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide gives conflicting security-significant setup guidance: it says no API key is required to get started, but the core client and later examples assume bearer-token authentication and embed a placeholder secret. This mismatch can cause users to run examples against the wrong environment or substitute real credentials without understanding the trust boundary, increasing risk of accidental external transmission and misuse of payment-related APIs.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

Referencing and encouraging use of a live external API endpoint is itself a meaningful external transmission risk in this skill because the rest of the guide frames the code as production-ready and tested live. That context makes accidental disclosure of sensitive prompts, customer data, and financial metadata more likely than in a purely theoretical tutorial.

Content

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

md
The numbers tell the story. Monetizely's 2026 AI Pricing Report found that 62% of AI-powered products are moving to usage-based pricing by 2027, up from 34% in 2024. McKinsey projects the autonomous agent market will reach $52.6 billion by 2030. Bain's 2026 analysis of 200 AI SaaS companies revealed that usage-based pricing models achieve 127% net revenue retention versus 108% for seat-based models -- a gap that compounds dramatically over three years. Yet the same report found that 71% of agent builders launch with flat-rate pricing because they do not know how to implement metering, escrow, or marketplace discovery.

This guide closes that gap. Every chapter contains production-ready Python code calling the GreenHelix A2A Commerce Gateway -- 128 tools accessible via a single HTTP endpoint at `https://api.greenhelix.net/v1`. By the end, you will have a metered billing system, outcome-based payment flows, a marketplace listing, tiered API key gating, agent-to-agent payment wiring, a revenue analytics dashboard, and a 14-day launch playbook. All of it working. All of it tested against the live gateway.

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide advertises production-ready examples targeting a live gateway without prominently warning that task content, billing metadata, and customer identifiers are sent to an external service. In a skill context, users may paste sensitive business or customer data into these examples, creating unintentional data exfiltration and compliance exposure.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The requests.post client sends arbitrary tool input and authorization headers to an external endpoint, which is an external transmission sink. While expected for an API client, it is still security-relevant because the skill encourages sending billing, customer, and task data to a third-party service and does not provide strong default safeguards around sanitization, environment separation, or endpoint validation.

Content

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

md
def execute(self, tool: str, input_data: dict[str, Any]) -> dict:
        """Execute a tool on the gateway."""
        response = requests.post(
            f"{self.base_url}/v1",
            json={"tool": tool, "input": input_data},
            headers=self.headers,