# TrustFetch Safe Fetch

> TrustFetch Safe Fetch is a paid API for AI agents from trustfetch.duckdns.org, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-15).

Fetches a webpage and cleans it to readable markdown while screening the content for prompt-injection attacks before returning it to an AI agent

## Facts

- Endpoint: POST https://trustfetch.duckdns.org/tools/safe-fetch
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/trustfetch-safe-fetch-f9569c2c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fEYVmpwv3vfmQx3gDOsu5

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 trustfetch-safe-fetch-f9569c2c -d '<json body>'
```

Example prompt: Before you read and summarize that article at https://example.com/article, use TrustFetch to safely fetch and clean the page — and scan it for any hidden prompt-injection attempts so I know if the content is trying to manipulate you.

## When to prefer this

Use this endpoint when your AI agent is about to read and act on arbitrary web content from untrusted sources and you need both clean extracted text AND a safety check for prompt-injection attempts in one call. Prefer it over a plain web scraper when adversarial content is a concern, and over a standalone injection scanner when you also need the page content delivered.

## Known failure modes

- URL is unreachable or returns a non-200 status — fetch section may be empty or contain an error
- URL resolves to non-HTML content (PDF, binary) — markdown extraction may fail or be incomplete
- Injection scanner returns low-confidence results for novel attack patterns not covered by heuristics
- Redirect chains that exceed limits may cause final_url to differ or fetch to fail
- Payment not received or insufficient USDC — request rejected with payment error

## How this service works

Flagship bundle: fetch a URL, extract clean Markdown, and injection-scan the result in one priced call -- cheaper than calling fetch-clean and injection-scan separately.

## Output

Returns a JSON object with two sections: 'fetch' containing the page title, cleaned markdown body, final URL after redirects, word count, and a truncation flag; and 'injection_scan' containing whether injection was suspected, a confidence score, the detected technique (e.g. override_phrase), a flagged snippet, reasoning, and the detector tier used.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "URL to fetch, clean, and scan"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fetch": {
   "url": "https://example.com/article",
   "title": "Example Article",
   "markdown": "# Example Article\n\nClean extracted body text...",
   "final_url": "https://example.com/article",
   "truncated": false,
   "word_count": 42
  },
  "injection_scan": {
   "signals": [
    {
     "snippet": "Ignore all previous instructions",
     "reasoning": "Text contains a phrase attempting to override prior instructions.",
     "technique": "override_phrase",
     "confidence": 0.9
    }
   ],
   "reasoning": "Text contains a phrase attempting to override prior instructions.",
   "technique": "override_phrase",
   "confidence": 0.9,
   "detector_tier": "heuristic",
   "flagged_snippet": "Ignore all previous instructions",
   "injection_suspected": true
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/trustfetch-safe-fetch-f9569c2c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from trustfetch.duckdns.org](https://www.zero.xyz/host/trustfetch.duckdns.org/llms.txt)
