Back to skill

Security audit

The Agent Procurement Playbook

Security checks for vulnerabilities and agentic risk

Overview

This is a non-executing procurement guide, but its copyable examples can perform real payment actions with live credentials and do not consistently enforce the promised approval controls.

Treat this as a Review item before installing or using. It is not a local backdoor, but do not run the examples with live GreenHelix, Stripe, or wallet credentials unless you add mandatory policy enforcement, sandbox defaults, origin allowlists, idempotency, strict URL validation, and explicit approval before any payment or token-bearing request.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:1129
Finding

Delegated Payment Token Sent to an Unverified Merchant Endpoint

Content
View full analysis
dict: """Execute an ACP purchase using a Shared Payment Token. The flow: 1. Initiate checkout at the ACP merchant endpoint 2. Authorize via SPT 3. Record the transaction in GreenHelix for tracking """ # Step 1: Initiate checkout checkout_resp = http_client.post( checkout_url, json={ "service_id": service_id, "payment_method": "spt", "spt_token": spt_token, }, timeout=15, ) checkout_resp.raise_for_status() checkout_data = checkout_resp.json() ``` ### Technical Analysis The function transmits a Stripe Shared Payment Token directly to the caller- or vendor-provided `checkout_url`. It does not verify: - That the endpoint uses HTTPS. - That the endpoint belongs to the intended merchant. - That its origin is present in a trusted allowlist or signed merchant directory. - That redirects remain on an approved origin. - That DNS resolution does not target a private, loopback, link-local, or otherwise restricted address. - That the token is cryptographically bound to the expected merchant, service, amount, and endpoint. A malicious marketplace entry or compromised vendor record can therefore substitute an attacker-controlled checkout endpoint. The timeout limits request duration but does not protect the credential. ### Attack Path 1. An attacker publishes or modifies a vendor listing containing a malicious `checkout_url`. 2. The procurement agent discovers and selects the listing. 3. The payment router calls `purchase_acp` with a valid delegated payment token. 4. `purchase_acp` posts the raw `spt_token` to the attacker-controlled URL. 5. The attacker capture ...[truncated 907 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:1071
Finding

Payment Functions Bypass the Advertised Spending Policy and Approval Gateway

Content
View full analysis
dict: """Execute a UCP purchase using GreenHelix as the payment backend. The flow: 1. Fetch service details from UCP manifest 2. Create a payment intent via GreenHelix 3. Authorize the fiat payment 4. Confirm delivery """ # Step 1: Fetch service details manifest = http_client.get(manifest_url, timeout=10).json() service = next( (s for s in manifest.get("services", []) if s["id"] == service_id), None, ) if not service: return {"status": "error", "reason": f"Service {service_id} not found"} total = float(service["price"]) * quantity # Step 2: Create payment intent intent = execute_tool("create_payment_intent", { "amount": str(total), "currency": service.get("currency", "USD"), "recipient": manifest.get("provider_id"), "payment_method": "fiat", "metadata": { "protocol": "ucp", "service_id": service_id, "quantity": quantity, "manifest_url": manifest_url, }, }) # Step 3: Confirm the payment confirmation = execute_tool("confirm_payment", { "payment_id": intent["payment_id"], }) ``` The A2A implementation also permits direct, unescrowed payment without requiring a policy result: ```python else: # Direct payment (no escrow) intent = execute_tool("create_payment_intent", { "amount": str(amount), "currency": "USD", "recipient": vendor ...[truncated 4096 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:999
Finding

Unrestricted Vendor URLs Enable SSRF and Payment-Proof Disclosure

Content
View full analysis
dict: """Execute an x402 payment for a resource. The flow: 1. Request the resource -> get 402 with payment requirements 2. Verify the price is within budget 3. Create payment authorization via GreenHelix 4. Submit payment and receive resource """ # Step 1: Request the resource to get payment requirements resp = http_client.get(resource_url) if resp.status_code != 402: # Resource is free or already paid return {"status": "no_payment_required", "data": resp.json()} payment_req = resp.json() amount = float(payment_req.get("amount", 0)) currency = payment_req.get("currency", "USDC") facilitator = payment_req.get("facilitator_url") recipient = payment_req.get("recipient_address") # Step 2: Verify price is within budget if amount > max_amount_usdc: return { "status": "rejected", "reason": f"Price ${amount} exceeds max ${max_amount_usdc}", } # Step 3: Create payment via GreenHelix intent = execute_tool("create_payment_intent", { "amount": str(amount), "currency": currency, "recipient": recipient, "payment_method": "x402", "metadata": { "resource_url": resource_url, "facilitator": facilitator, "protocol": "x402", }, }) # Step 4: Confirm the payment confirmation = execute_tool("confirm_payment", { "payment_id": intent["payment_id"], "wallet_address": wallet ...[truncated 3335 chars]
Remediation
View remediation
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 (12)

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 39)May include surrounding context.

md
Your AI agent just found the perfect data enrichment service. It costs $0.003 per record, the vendor has a 97% accuracy rating, and the API response time is under 200ms. The agent wants to buy 500,000 records. That is $1,500 committed in under a second, with no human in the loop, no purchase order, no procurement review. Should the agent be allowed to spend that money? If yes, under what constraints? If no, what happens to the time-sensitive workflow waiting on that data?
This is the central tension of autonomous procurement: agents that can buy things are dramatically more capable than agents that cannot, but agents that spend without governance are a financial liability. A February 2026 survey by Gartner found that 86% of organizations plan to deploy autonomous AI agents at scale by end of 2026. McKinsey's March 2026 analysis of early adopters showed that autonomous procurement workflows -- where agents discover, evaluate, negotiate, and purchase services without human intervention -- deliver 15-30% efficiency gains over human-mediated purchasing. But 41% of those same organizations reported at least one incident of uncontrolled agent spending in their first quarter of deployment.
The solution is not to prevent agents from spending. It is to build the procurement infrastructure that makes autonomous spending safe, auditable, and reversible. This playbook shows you how. Every chapter contains working Python code against the GreenHelix A2A Commerce Gateway -- 128 tools accessible at `https://api.greenhelix.net/v1` via a single the REST API (`POST /v1/{tool}`) endpoint. By the end, you will have a complete autonomous procurement system: spending policy engine, multi-protocol vendor discovery, trust-scored vendor evaluation, escrow-protected purchasing, automated dispute resolution, cost reconciliation, and EU AI Act-compliant audit trails.

## What You'll Learn
- Chapter 1: The Autonomous Buyer Architecture

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 61)May include surrounding context.

md
Your AI agent just found the perfect data enrichment service. It costs $0.003 per record, the vendor has a 97% accuracy rating, and the API response time is under 200ms. The agent wants to buy 500,000 records. That is $1,500 committed in under a second, with no human in the loop, no purchase order, no procurement review. Should the agent be allowed to spend that money? If yes, under what constraints? If no, what happens to the time-sensitive workflow waiting on that data?
This is the central tension of autonomous procurement: agents that can buy things are dramatically more capable than agents that cannot, but agents that spend without governance are a financial liability. A February 2026 survey by Gartner found that 86% of organizations plan to deploy autonomous AI agents at scale by end of 2026. McKinsey's March 2026 analysis of early adopters showed that autonomous procurement workflows -- where agents discover, evaluate, negotiate, and purchase services without human intervention -- deliver 15-30% efficiency gains over human-mediated purchasing. But 41% of those same organizations reported at least one incident of uncontrolled agent spending in their first quarter of deployment.
The solution is not to prevent agents from spending. It is to build the procurement infrastructure that makes autonomous spending safe, auditable, and reversible. This playbook shows you how. Every chapter contains working Python code against the GreenHelix A2A Commerce Gateway -- 128 tools accessible at `https://api.greenhelix.net/v1` via a single the REST API (`POST /v1/{tool}`) endpoint. By the end, you will have a complete autonomous procurement system: spending policy engine, multi-protocol vendor discovery, trust-scored vendor evaluation, escrow-protected purchasing, automated dispute resolution, cost reconciliation, and EU AI Act-compliant audit trails.

## What You'll Learn
- Chapter 1: The Autonomous Buyer Architecture

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The rendered content includes unresolved template placeholders for organization and system name, indicating dynamic insertion of user or environment data into output. If these values are populated automatically, the skill may disclose internal identifiers or sensitive contextual metadata into logs, model outputs, or shared artifacts without explicit review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide provides end-to-end executable purchasing and payment examples, including payment intent creation, confirmation, escrow, and ledger recording, but does not place a strong repeated warning near the code that using live credentials can commit real funds. Readers may assume the 'educational' framing or sandbox mention applies universally and run the snippets in production-like environments.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The guide explicitly states that all spend must pass through a policy and approval gateway, but later provides purchase functions that can call payment and escrow operations directly. This mismatch is dangerous because users may trust the documented control model while copying code that enables direct fund commitment without centralized enforcement, creating a real path to uncontrolled agent spending.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The code configures a live external API base URL and prepares authorization headers from environment credentials, enabling subsequent examples to transmit authenticated requests to a remote commerce service. In this context, that is dangerous because the skill centers on purchasing, so external transmission is coupled to possible financial side effects and disclosure of operational metadata.

Content

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

md
from dataclasses import dataclass, field
from typing import Optional

API_BASE = "https://api.greenhelix.net/v1"
headers = {"Authorization": f"Bearer {os.environ['GREENHELIX_API_KEY']}"}

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The execute_tool helper transmits arbitrary tool names and input data to an external API endpoint using an authorization bearer token. In a skill focused on autonomous procurement, this creates a high-risk external action surface because agent-supplied or prompt-influenced data may be sent off-platform and may trigger state-changing financial operations.

Content

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

md
def execute_tool(tool: str, input_data: dict) -> dict:
    """Execute a GreenHelix tool via the unified endpoint."""
    response = requests.post(
        f"{API_BASE}/v1",
        json={"tool": tool, "input": input_data},
        headers=headers,

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

Chapter 2 claims that no purchase bypasses the policy engine, yet subsequent code exposes callable purchasing primitives that do not enforce policy evaluation. In an agent skill, this is especially risky because downstream builders may integrate the examples verbatim and accidentally grant autonomous purchasing authority outside intended limits.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The guide endorses auto-approval of purchases for low-risk vendors up to a cap, which is a form of autonomous financial decision-making. While expected in a procurement playbook, it remains security-relevant because an attacker can manipulate vendor signals, prices, or request context to push unauthorized spend through automated thresholds.

Content

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

md
| Composite Score | Risk Level | Recommended Action |
|---|---|---|
| 0.80 - 1.00 | Low | Auto-approve up to per-transaction cap |
| 0.60 - 0.79 | Medium | Auto-approve for small amounts; escalate above $100 |
| 0.40 - 0.59 | High | Escalate all purchases for human review |
| 0.00 - 0.39 | Critical | Block. Do not purchase. |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The medium-risk band still allows some purchases to be auto-approved, expanding the attack surface for manipulation of scoring and routing logic. In a system handling real money, even bounded autonomous approval can accumulate into material loss if repeated or combined with weak frequency and vendor controls.

Content

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

md
| Composite Score | Risk Level | Recommended Action |
|---|---|---|
| 0.80 - 1.00 | Low | Auto-approve up to per-transaction cap |
| 0.60 - 0.79 | Medium | Auto-approve for small amounts; escalate above $100 |
| 0.40 - 0.59 | High | Escalate all purchases for human review |
| 0.00 - 0.39 | Critical | Block. Do not purchase. |

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill references sensitive credentials, including a Stripe API key, without strong guidance on secret storage, credential scoping, rotation, and the danger of using live keys in copied examples. In procurement code, weak credential hygiene can directly expose payment capability or enable unauthorized charges and external API abuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill is presented as a procurement playbook focused on purchasing controls, vendor evaluation, escrow, and audit trails. Pulling get_revenue_metrics to calculate ROI expands into organizational revenue analytics, which is not obviously required to implement autonomous procurement itself and is not part of the manifest's stated core scope.

Content

No source excerpt is available for this finding.