Back to skill

Security audit

Agent Spend Gate

Security checks for vulnerabilities and agentic risk

Overview

The scanners report weaknesses in a payment approval gate, including approvals that may be reused for payments with changed destinations; the verdict is suspicious because these risks are not clearly aligned with the stated purpose.

Consider the payment approval and policy-loading behavior carefully before installing, especially whether missing policy or reused approvals could permit unintended payments. Also review the external Trust Rank request and the unversioned installation commands. The scan was partial: 7 of 8 components were scanned, and SKILL.md had a manifest parsing issue, so the evidence is incomplete.

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

T09 · Insecure Skill Coding Practices

Warning
Location
engine/gate_policy.py
Finding

Human approval can be replayed for subsequent payments and changed recipients

Content
View full analysis

Impact

The gate returns allow=true and status=approved for additional payments without renewed human consent. An agent following the Skill's instructions can consequently initiate unwanted payments through its separate wallet. Stored approvals have no expiry, so reuse can continue in later budget periods.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (23)

The approval lookup claims to match an exact intent but ignores the payment rail and recipient.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Approval matching checks only agent, resource, and amount, omitting the payment rail and recipient even though both are part of the evaluated payment intent. A previously approved request can therefore authorize a payment with changed routing or destination when those values pass the other policy checks, violating the human's approval scope.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · README.md (reported line 18)May include surrounding context.

md
|---|---|
| Monthly budgets | per-agent / per-team, month-to-date computed from your own audit stream |
| Merchant allowlists | pinned merchants, or Trust Rank floor from real on-chain settlement behaviour |
| Approval thresholds | auto-approve below X, human approval between X and Y, hard cap above Y |
| Human approvals | `--approve <eventHash>` — recorded as part of the audit trail |
| Rail permissions | which rails (x402 / MPP / stablecoin / card) each agent may use |
| Tamper evidence | every audit event links to the previous one by SHA-256; edited or deleted entries fail verification |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| status | meaning | what you do |
|---|---|---|
| `auto-approved` | amount ≤ auto-approve threshold | proceed with payment |
| `approved` | human pre-approved this exact intent | proceed with payment |
| `pending` | between thresholds — needs a human | Pause and tell the user the reason and the `eventHash`; after they approve (see below), re-evaluate |
| `rejected` | policy violation (budget, rail, merchant, floor, hard cap) | Do not continue; tell the user the reason verbatim — re-evaluate only after the user changes the policy |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| status | meaning | what you do |
|---|---|---|
| `auto-approved` | amount ≤ auto-approve threshold | proceed with payment |
| `approved` | human pre-approved this exact intent | proceed with payment |
| `pending` | between thresholds — needs a human | Pause and tell the user the reason and the `eventHash`; after they approve (see below), re-evaluate |
| `rejected` | policy violation (budget, rail, merchant, floor, hard cap) | Do not continue; tell the user the reason verbatim — re-evaluate only after the user changes the policy |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · engine/gate_policy.py (reported line 210)May include surrounding context.

python
% (amount_usd, auto, require))

    return _finish(agent, resource, amount_usd, rail,
                   status or ("auto-approved" if ok else "rejected"),
                   "; ".join(reasons) or "policy empty", scopes, audit_path, pay_to)

MCP server referenced without pinned version: 'npx clawhub'.

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The installation command invokes an unversioned npm CLI through npx, potentially downloading and executing a changing package release with the user's privileges. A compromised future release could execute arbitrary code; this is a supply-chain exposure, although the referenced tool is not an MCP server.

Content

No source excerpt is available for this finding.

MCP server referenced without pinned version: 'npx skills'.

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The command executes an unversioned skills package through npx and references a GitHub skill source without an immutable revision. Changes to either dependency can alter what gets executed or installed without a corresponding change to these instructions; the MCP-specific label is inaccurate, but the supply-chain concern is valid.

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 · README.md (reported line 53)May include surrounding context.

python3 scripts/gate_check.py
--agent agent:my-org:main
--amount 0.005
--resource https://api.example.com/x402/data
--rail x402 --payto 0xABCdef...

text

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

python3 scripts/gate_check.py
--agent agent:me:main
--amount 0.01
--resource https://api.example.com/x402/data
--rail x402
--payto 0xABCdef...

text

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · engine/gate_policy.py (reported line 16)May include surrounding context.

python
- no rank data            -> rejected when a trustRank floor is configured

Decision statuses:
  auto-approved  (amount <= autoApproveBelow)
  approved       (human approval found for this intent)
  pending        (between thresholds, awaiting approval)
  rejected       (policy violation or above hard cap)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · engine/gate_policy.py (reported line 16)May include surrounding context.

python
- no rank data            -> rejected when a trustRank floor is configured

Decision statuses:
  auto-approved  (amount <= autoApproveBelow)
  approved       (human approval found for this intent)
  pending        (between thresholds, awaiting approval)
  rejected       (policy violation or above hard cap)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · engine/gate_policy.py (reported line 192)May include surrounding context.

python
require = float(th.get("requireApprovalAbove", auto))
        if amount_usd <= auto:
            status = "auto-approved"
            reasons.append("amount %.4f <= autoApprove %.2f" % (amount_usd, auto))
        elif amount_usd > require:
            ok = False
            status = "rejected"

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The evaluator returns allow=true when no policy is loaded, including when the policy file is missing or unreadable and when the resulting policy is empty. This fail-open bootstrap path bypasses merchant restrictions, budgets, and approval thresholds for callers that rely on this function as their payment gate.

Content

Scanner excerpt · engine/gate_policy.py (reported line 146)May include surrounding context.

python
policy=None, audit_path=AUDIT_PATH):
    pol = policy or load_policy()
    if not pol:
        return _finish(agent, resource, amount_usd, rail, "auto-approved",
                       "no policy loaded - allow (bootstrap)", [], audit_path, pay_to)
    reasons = []
    scopes = []

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · engine/gate_policy.py (reported line 188)May include surrounding context.

python
# approval thresholds
    if ok:
        th = pol.get("thresholds", {})
        auto = float(th.get("autoApproveBelow", 0.01))
        require = float(th.get("requireApprovalAbove", auto))
        if amount_usd <= auto:
            status = "auto-approved"

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · engine/gate_policy.py (reported line 191)May include surrounding context.

python
auto = float(th.get("autoApproveBelow", 0.01))
        require = float(th.get("requireApprovalAbove", auto))
        if amount_usd <= auto:
            status = "auto-approved"
            reasons.append("amount %.4f <= autoApprove %.2f" % (amount_usd, auto))
        elif amount_usd > require:
            ok = False

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · engine/gate_policy.py (reported line 216)May include surrounding context.

python
def _finish(agent, resource, amount_usd, rail, status, reason, scopes,
            audit_path, pay_to=None):
    allow = status in ("auto-approved", "approved")
    ev = {
        "v": "aspl/v0.1",
        "type": "payment.evaluated",

Tainted flow: 'audit_path' from os.environ.get (line 209, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · engine/gate_policy.py (reported line 232)May include surrounding context.

python
canon = json.dumps(ev, sort_keys=True, separators=(",", ":"))
    ev["hash"] = hashlib.sha256(canon.encode()).hexdigest()
    os.makedirs(os.path.dirname(audit_path), exist_ok=True)
    with open(audit_path, "a") as f:
        f.write(json.dumps(ev, sort_keys=True) + "\n")
    out = dict(ev["decision"])
    out["eventHash"] = ev["hash"]

Tainted flow: 'APPROVALS_PATH' from os.environ.get (line 32, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · engine/gate_policy.py (reported line 248)May include surrounding context.

python
entry.update(intent)
    aps = [a for a in aps if a.get("eventHash") != event_hash] + [entry]
    os.makedirs(os.path.dirname(APPROVALS_PATH), exist_ok=True)
    with open(APPROVALS_PATH, "w") as f:
        json.dump(aps, f, indent=1)
    return entry

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · examples/policy.json (reported line 24)May include surrounding context.

json
}
    }
  ],
  "thresholds": {"autoApproveBelow": 0.01, "requireApprovalAbove": 1.0},
  "keys": {"paymentSign": {"source": "external", "note": "signing happens in your wallet; this check is read-only. production: kms/hsm/webauthn"}},
  "audit": {"chain": "hashlinked", "retention": "7y"}
}

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/gate_check.py (reported line 56)May include surrounding context.

python
}
        }
    ],
    "thresholds": {"autoApproveBelow": 0.01, "requireApprovalAbove": 1.0},
    "keys": {"paymentSign": {"source": "external",
                             "note": "signing happens in your wallet, outside this policy check"}},
    "audit": {"chain": "hashlinked", "retention": "7y"}

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · scripts/gate_check.py (reported line 12)May include surrounding context.

python
Usage:
  gate_check.py --init
  gate_check.py --agent agent:me:main --amount 0.01 \
                --resource https://api.example.com/x402/data \
                [--rail x402] [--payto 0xABC...] [--policy PATH]
  gate_check.py --approve <eventHash> --approver alice
"""

The documented local-only privacy guarantee is contradicted by an external Trust Rank request.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Despite the unqualified local-only privacy claim, evaluation can contact an external Trust Rank server automatically when the cache is stale or absent. The request exposes network metadata such as the public IP address and request timing, but the shown code does not send payment intents, wallet data, or policy contents.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/gate_check.py (reported line 91)May include surrounding context.

python
ap = argparse.ArgumentParser(
        description="Agent Spend Gate - ASPL v0.1 policy evaluation (local, private)")
    ap.add_argument("--init", action="store_true",
                    help="create ~/.paycensus-gate/ with a starter policy")
    ap.add_argument("--agent", help="agent identity, e.g. agent:org:name")
    ap.add_argument("--amount", type=float, help="payment amount in USD")
    ap.add_argument("--resource", help="payment resource URL")