# SafeFetch

> SafeFetch is a paid API for AI agents from safefetch.schemasure.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-10).

Fetches a public web page and returns clean Markdown with citation anchors, a content hash, a retrieval timestamp, and per-span detection of hidden text, invisible Unicode, and prompt-injection attempts.

## Facts

- Endpoint: POST https://safefetch.schemasure.com/v1/fetch?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/safefetch-90699e93
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NXeJSIITHzTJYme6j6mhQ

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 safefetch-90699e93 -d '<json body>'
```

Example prompt: Can you safely fetch https://example.com/blog/article and return the clean markdown version, with prompt-injection detection on, respecting robots.txt, and allowing up to 2 redirect hops?

## When to prefer this

Choose SafeFetch when you need to retrieve a web page for use in an AI pipeline and need security guarantees: SSRF protection on every redirect hop, detection of prompt-injection payloads embedded in page content, and evidence of hidden text or invisible Unicode that could manipulate downstream LLMs. Prefer it over generic fetch/scrape tools when auditability (content hash, citation anchors, retrieval timestamp) or adversarial content detection matters. It is particularly well-suited for RAG ingestion pipelines, citation-requiring research tasks, and any agent that browses the open web autonomously.

## Known failure modes

- URL uses a non-standard port (not 80/443) — rejected with SSRF policy error
- URL contains credentials or a literal IP address — rejected
- robots.txt disallows the URL and respect_robots is true — returns 403 POLICY_BLOCKED with matched rule, not charged
- Document exceeds max_bytes — truncated, remainder unanalysed, injection verdict becomes unknown
- Redirect hop limit exceeded or a redirect hop resolves to a private IP — SSRF rejection
- user_initiated not set to true when respect_robots is false — request rejected
- Network timeout or unreachable host — fetch error returned

## How this service works

Fetch a public web page and return clean Markdown with stable citation anchors, a content hash, and a retrieval timestamp — plus evidence of hidden text, invisible Unicode, and prompt-injection attempts found in the page. Strict SSRF protection on every redirect hop. Returns a per-span verdict with the decoded payload, not a confidence score. Zero retention.

## Output

Returns the fetched page as clean Markdown and/or plain text, a SHA-based content hash, a retrieval timestamp, stable per-paragraph citation anchors, and a per-span security verdict for each detected anomaly (hidden text, invisible Unicode, prompt-injection). Each verdict includes the decoded payload. No data is retained after the response.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "maxLength": 2048,
   "description": "An http or https URL naming a hostname. Ports other than 80 and 443, credentials in the URL, and literal IP addresses are rejected."
  },
  "output": {
   "enum": [
    "markdown",
    "text",
    "both"
   ],
   "type": "string",
   "default": "markdown",
   "description": "Which rendering to include in the result. Defaults to markdown."
  },
  "policy": {
   "type": "object",
   "properties": {
    "max_bytes": {
     "type": "integer",
     "maximum": 20971520,
     "minimum": 1024,
     "description": "Analysis cap. A document larger than this is truncated before parsing and the verdict becomes unknown, because an unanalysed remainder exists."
    },
    "respect_robots": {
     "type": "boolean",
     "default": true,
     "description": "Honour robots.txt. A disallow returns 403 POLICY_BLOCKED with the matched rule and is not charged. Setting this false requires user_initiated:true."
    },
    "user_initiated": {
     "type": "boolean",
     "default": false,
     "description": "Attestation that a person explicitly asked for this specific page. Required to set respect_robots:false. Logged."
    },
    "allow_redirects": {
     "type": "integer",
     "maximum": 3,
     "minimum": 0,
     "description": "Redirect hops permitted. Every hop is revalidated against the SSRF policy."
    },
    "flag_prompt_injection": {
     "type": "boolean",
     "default": true,
     "description": "Run injection detection. Setting this false makes the verdict unknown rather than allow: `allow` means no signal was found, and with detection off nothing looked."
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/safefetch-90699e93/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from safefetch.schemasure.com](https://www.zero.xyz/host/safefetch.schemasure.com/llms.txt)
