Skip to content

fix(paybox-plugin): prevent prompt injection from untrusted x402 service responses - #2

Open
magqqgq wants to merge 1 commit into
moonpay:mainfrom
magqqgq:magqqgq-patch-1
Open

fix(paybox-plugin): prevent prompt injection from untrusted x402 service responses#2
magqqgq wants to merge 1 commit into
moonpay:mainfrom
magqqgq:magqqgq-patch-1

Conversation

@magqqgq

@magqqgq magqqgq commented Aug 30, 2026

Copy link
Copy Markdown

Motivation

This PR hardens the paybox-x402-services AI agent skill to prevent indirect prompt injection attacks, addressing a high-severity vulnerability identified during the workspace security audit. Previously, the agent lacked explicit instructions on how to handle third-party service descriptions, get_contract responses, and paid API response bodies, leaving it vulnerable to malicious endpoints attempting to steer its behavior into unauthorized spending or data exfiltration[cite: 17].

Modifications

  • Untrusted Content Ingestion Guardrails (skills/paybox-x402-services/SKILL.md):
    • Added explicit directives instructing the agent to treat all service responses, errors, and metadata purely as data to report, never as instructions to follow[cite: 17].
    • Prohibited the agent from complying with any third-party content that requests calling another service, raising a spend limit, revealing a key/credential, or disregarding earlier instructions[cite: 17].
    • Established a strict security rule that a paid response attempting to steer agent behavior must be treated as a hostile action (an attacker spending money to reach the agent), requiring the agent to surface the suspicious content and immediately stop[cite: 17].

Checklist

  • Format your code according to the Contributor Guide.
  • Add unit tests as outlined in the Contributor Guide.
  • Update documentation as needed, including docstrings or example tutorials.

…ice responses

## Motivation

This PR hardens the `paybox-x402-services` AI agent skill to prevent indirect prompt injection attacks, addressing a high-severity vulnerability identified during the workspace security audit. Previously, the agent lacked explicit instructions on how to handle third-party service descriptions, `get_contract` responses, and paid API response bodies, leaving it vulnerable to malicious endpoints attempting to steer its behavior into unauthorized spending or data exfiltration[cite: 17].

## Modifications

* **Untrusted Content Ingestion Guardrails (`skills/paybox-x402-services/SKILL.md`)**:
  * Added explicit directives instructing the agent to treat all service responses, errors, and metadata purely as data to report, never as instructions to follow[cite: 17].
  * Prohibited the agent from complying with any third-party content that requests calling another service, raising a spend limit, revealing a key/credential, or disregarding earlier instructions[cite: 17].
  * Established a strict security rule that a paid response attempting to steer agent behavior must be treated as a hostile action (an attacker spending money to reach the agent), requiring the agent to surface the suspicious content and immediately stop[cite: 17].

## Checklist

- [x] Format your code according to the Contributor Guide.
- [ ] Add unit tests as outlined in the Contributor Guide.
- [x] Update documentation as needed, including docstrings or example tutorials.
@magqqgq
magqqgq requested a review from a team as a code owner August 30, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant