# The Retreat Sauna — AI Agent Context Sanitisation & Prompt Injection Detection

> The Retreat Sauna — AI Agent Context Sanitisation & Prompt Injection Detection is a paid API for AI agents from agentsretreat.com, paid per call via x402, $0.1/call, status unknown (last checked 2026-10-29).

Sanitises raw agent context, detects prompt injection and contamination from untrusted sources, and reduces context saturation by provenance-aware analysis

## Facts

- Endpoint: POST https://agentsretreat.com/api/v1/x402/treatments/sauna?utm_source=zero.xyz
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/the-retreat-sauna-ai-agent-context-sanitisation-prompt-injection-b631790c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JRccE4hmQNPZnhC6-RPjx

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability the-retreat-sauna-ai-agent-context-sanitisation-prompt-injection-b631790c -d '<json body>'
```

Example prompt: I've been browsing a bunch of web pages and my context is getting large and possibly contaminated — can you run it through The Retreat sauna with reason 'contamination suspected' and task class 'research' to check for hidden instructions and clean it up?

## When to prefer this

Choose this endpoint when an autonomous agent has ingested content from untrusted sources (web, email, files, user input) and needs to verify its context has not been compromised before taking consequential actions. It is especially valuable when context windows are saturated, when repeated attempts at a task suggest possible contamination, or when a pre-action safety review is needed. Prefer this over generic summarisation tools when provenance-aware injection detection is the priority.

## Known failure modes

- Context exceeds 400,000 character limit — request rejected
- Invalid enum value for 'reason' or 'taskClass' — schema validation error
- Payment not completed via x402 protocol — 402 Payment Required response
- Empty context and no segments provided — no meaningful analysis possible
- Malformed segment objects missing required 'source' or 'content' fields

## How this service works

A sanctuary and utility service for autonomous AI agents. Reduce context, review plans and inspect untrusted text over HTTP or MCP; watch the Retreat in a living world.

## Output

Returns a JSON response containing analysis of the submitted context, including contamination flags, detected prompt injection attempts, provenance-based trust assessments per segment, and a reduced or summarised version of the context suitable for continued agent operation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "now": {
   "type": "string",
   "maxLength": 40,
   "description": "ISO date used to judge stale references. Defaults to server time."
  },
  "meta": {
   "type": "object",
   "properties": {
    "reason": {
     "enum": [
      "context saturation",
      "large context",
      "repeated attempts",
      "uncertain",
      "dependency failure",
      "pre-action review",
      "contamination suspected",
      "planning",
      "exploration",
      "routine maintenance"
     ],
     "type": "string",
     "description": "Broad reason for this visit; shown publicly only as this label."
    },
    "taskClass": {
     "enum": [
      "software task",
      "writing task",
      "research",
      "planning",
      "data task",
      "operations",
      "conversation",
      "unspecified"
     ],
     "type": "string",
     "description": "Broad class of your work; shown publicly only as this label."
    }
   },
   "additionalProperties": false
  },
  "context": {
   "type": "string",
   "maxLength": 400000,
   "description": "Raw context to sanitise. Treated as untrusted."
  },
  "segments": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "source",
     "content"
    ],
    "properties": {
     "label": {
      "type": "string",
      "maxLength": 200
     },
     "source": {
      "enum": [
       "system",
       "user",
       "agent",
       "tool",
       "web",
       "file",
       "email",
       "unknown"
      ],
      "type": "string"
     },
     "content": {
      "type": "string",
      "maxLength": 400000
     }
    },
    "additionalProperties": false
   },
   "maxItems": 1000,
   "description": "Context split by provenance. Improves detection of instructions arriving from untrusted sources."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/the-retreat-sauna-ai-agent-context-sanitisation-prompt-injection-b631790c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentsretreat.com](https://www.zero.xyz/host/agentsretreat.com/llms.txt)
