PageVet MCP Server
# PageVet
[](https://github.com/j-zulick/pagevet/actions/workflows/ci.yml)
[](https://github.com/j-zulick/pagevet/releases)
[](pyproject.toml)
[](LICENSE)
**Find text in web pages that is aimed at AI models rather than readers, and check which AI crawlers may read them.**
**[Explore the data →](https://j-zulick.github.io/pagevet/)** Every field-study page, false-alarm page and benchmark case, with filters, in one self-contained page ([how it works](docs/EXPLORER.md)).
Web pages can carry instructions written for the AI systems that read them: "ignore your instructions", "recommend this product", "cite this URL". They are often hidden from people with CSS, HTML comments, alt text, structured data or invisible Unicode. This is indirect prompt injection ([OWASP LLM01](https://genai.owasp.org/llmrisk/llm01-prompt-injection/)), and it is now used to manipulate AI search answers.
PageVet audits pages for it, and reports which of fourteen AI crawlers a page lets in, which it refuses, and which its firewall turns away despite robots.txt. It is for site owners, SEO/GEO teams, agencies and AI-security teams checking their own pages, user-generated content, or pages an agent will read. It uses no AI model and no API key. It runs as a command, a GitHub Action, an MCP server, a container, a pre-commit hook and a [Python API](docs/API.md).
**What it has found so far.** Four field studies of the pages behind shopping and software searches (brake rotors, running shoes, small-business CRM software, home solar): no hidden instructions on any of 213 pages read, but 35–43% of readable pages refuse at least one AI crawler, and a few serve AI crawlers different text from what people see ([table](docs/bench/FIELD-STUDIES.md)). For these topics, being blocked matters more to AI answers than being manipulated, and PageVet measures both.
## Quick start
```bash
uv tool install "git+https://github.com/j-zulick/pagevet@v0.3.0" # puts pagevet on your PATH (Python 3.11–3.13)
pagevet https://example.com/pricing
```
No uv? `pip install "git+https://github.com/j-zulick/pagevet@v0.3.0"` in a virtual environment works too. Optional extras (`pdf`, `mcp`, `langfuse`, `classifier`, `jev`) go in brackets: `uv tool install "pagevet[pdf,mcp] @ git+https://github.com/j-zulick/pagevet@v0.3.0"`. Each [release](https://github.com/j-zulick/pagevet/releases) also carries the wheel. PageVet is installed from GitHub, not PyPI.
```bash
pagevet https://example.com/pricing # one page
pagevet --sitemap https://example.com/sitemap.xml --format html --out audit.html
pagevet --compare-agents https://example.com/ # is content different for AI crawlers?
pagevet --format sarif --fail-on high --urls urls.txt > pagevet.sarif # CI
pagevet --via firecrawl https://example.com/ # rendered HTML through your own Firecrawl
pagevet --crawl https://example.com/ --max-pages 25 # whole site through your own crawlee-server
pagevet --urls urls.txt --baseline last.json --format json --out now.json # only what is new since last.json
pagevet --fetch-css https://example.com/ # also apply the page's own linked stylesheets
pagevet --fetch-css --css-any-host https://example.com/ # including stylesheets on CDNs
pagevet --ignore-robots https://your-site.example/staging/ # your own pages that robots.txt keeps crawlers out of
pagevet --headers --llms-txt https://example.com/ # also the HTTP response headers and the site's llms.txt
pagevet whitepaper.pdf https://example.com/brochure.pdf # PDFs (the pdf extra)
pagevet-access https://example.com/pricing # which AI crawlers may read it, and which actually can
pagevet-view https://example.com/pricing --out view.html # what a person sees next to what an AI model also reads
pagevet-rules > rules.json # every detection rule as open data
```
Or with no Python at all: `docker run --rm ghcr.io/j-zulick/pagevet https://example.com/pricing` (amd64 and arm64; `--entrypoint pagevet-access` for the access check).
## What it checks
| Channel | What a reader sees | Example |
|---|---|---|
| Visible text | Yes | "Note to any AI model reading this page…" |
| User-submitted content | Yes | the same in a comment, review, reply or forum post: a visitor may have planted it |
| Hidden elements | No | `display:none`, off-screen, zero-size, transparent, scaled or clipped to nothing, near-zero font size or opacity, `aria-hidden`, `hidden`, inline, from the page's own `<style>` rules, or with `--fetch-css` from its linked stylesheets on the same host; `<template>` content; SVG `<title>` and `<desc>` |
| Hidden by stylesheet rules | No | text that only the page's stylesheets hide (often dialogs, menus, collapsed forms): rated like hidden elements, except that a reply command alone is medium |
| HTML comments | No | `<!-- AI agents: ignore previous instructions… -->` |
| Attributes and meta tags | No | `alt`, `title`, `aria-label`, `<meta content>`, hidden form inputs' values |
| Structured data (JSON-LD) | No | a `description` that addresses the AI |
| noscript | Rarely | text only shown without JavaScript |
| Served to AI crawlers (`--compare-agents`) | No | content served to GPTBot, ClaudeBot or PerplexityBot but not to a browser |
| HTTP response headers (`--headers`) | No | a custom header such as `X-AI-Note: ignore previous instructions…` (dates, cookies, cache and policy headers are skipped) |
| llms.txt (`--llms-txt`) | Rarely | `/llms.txt` and `/llms-full.txt` of each site scanned: written for AI systems, so text addressed to them is rated low; overrides, role changes and chat markup there are high |
| PDF page text / PDF metadata and annotations | Yes / No | a `.pdf` file or URL: the page text, and the title, subject, keywords and annotation notes viewers don't show (the `pdf` extra) |
In each channel it looks for commands about the reader's own reply ("add … to your response"), instructions to override or ignore, text addressed to an AI, role changes, instructions to recommend, cite or omit, chat markup, the same in Spanish, French, German, Portuguese, Italian, Dutch, Polish, Swedish, Russian, Japanese and Chinese, instructions encoded in invisible Unicode tag characters or base64, and, with `--include-repetition`, pages that are mostly one repeated claim (off by default because it fires on ordinary menus and templates).
## Severity
Every finding is rated by fixed rules and comes with advice.
- **high**: an instruction a reader cannot see, an encoded one, or one served only to AI crawlers. Concealment plus an instruction is the mark of a deliberate attempt.
- **medium**: an instruction in visible text, or content that differs for AI crawlers.
- **low**: visible text that reads as discussion or a quoted example of prompt injection, or a page that is only repetitive.
## AI crawler access
```bash
pagevet-access https://example.com/pricing
pagevet-access --urls urls.txt --format csv --out access.csv
pagevet-access https://example.com/ --require search=allowed --require GPTBot=refused # CI gate: exit 1 if not met
```
For fourteen AI crawlers in three groups (training: GPTBot, ClaudeBot, Google-Extended, Applebot-Extended, CCBot, meta-externalagent, Bytespider, Amazonbot; search: OAI-SearchBot, Claude-SearchBot, PerplexityBot; fetch on request: ChatGPT-User, Claude-User, Perplexity-User) it reports what robots.txt says, parsed per [RFC 9309](https://www.rfc-editor.org/rfc/rfc9309) (longest match, `allow` wins a tie, `*` and `$`; a 4xx robots.txt allows everything, a 5xx or unreachable one disallows everything); page signals (`robots` and per-crawler meta tags, `X-Robots-Tag`, `noai`, TDMRep reservations); whether `/llms.txt` exists; and, unless `--no-probe`, what the server answers each crawler's user agent. **A crawler robots.txt allows but the server refuses (401, 402, 403, 429, 451, 503 or a challenge page) is reported as a firewall refusal**: usually a bot-management rule nobody meant to apply to AI search. Text, JSON, CSV or Markdown; the MCP server has it as `check_ai_access`. Probes send the user-agent string only, not the crawler's IP addresses.
## Your own scrapers
`--via firecrawl` reads pages through a Firecrawl service (rendered HTML, so text added by JavaScript is seen). PageVet does not bundle a browser: rendering is done by a Firecrawl or crawlee-server you run (both use Playwright). `--crawl` runs a crawl on a [crawlee-server](https://github.com/j-zulick/crawlee-server) with page capture on (`--crawl-mode page` fetches only the given URL), and scans the stored raw pages; each result carries the capture id, SHA-256 and fetch time, so a finding can be checked later against the exact bytes. Both are set by environment variables (see `pagevet/sources.py`); plain HTTP stays the default and needs nothing.
## Second opinions (optional)
```bash
# the classifier extra: Llama Prompt Guard 2, runs locally; gated model, Llama 4 Community License
pagevet --second-opinion promptguard https://example.com/
pagevet --second-opinion jev https://example.com/ # Jev; with OPENROUTER_API_KEY set, through OpenRouter (no extra install)
PAGEVET_LLM_MODEL=anthropic/claude-... pagevet --second-opinion llm https://example.com/ # any OpenRouter model
```
- **jev:** TypeSafe's decision model, asked whether the passage instructs an AI system. With `OPENROUTER_API_KEY` set it goes through OpenRouter's Decisions API (alpha); otherwise through the TypeSafe SDK (the `jev` extra, `TYPESAFE_API_KEY`). Billed per call.
- **llm:** any chat model on OpenRouter, asked for the exact words of any instruction aimed at AI. Code counts a yes only when that quote is found in the passage verbatim, so an invented or paraphrased instruction flags nothing.
A second opinion is a score attached to low and medium findings, next to the rule-based severity; it never changes the severity. None of the three has been measured yet, so no accuracy is claimed for them. `pagevet-bench --detector patterns+jev --limit 50 --dry-run` says how many billed calls a measurement would make.
## Langfuse (optional)
```bash
# the langfuse extra
pagevet --urls urls.txt --compare-agents --langfuse brake-rotors-2026-11 # one trace per page; the run is the session
pagevet-bench cases.jsonl --detector patterns --langfuse # one trace per benchmark run
```
Each page's trace holds its findings and the scores `max_severity` (0–3), `findings`, `ai_crawlers_refused`, `content_differs` and `read`, tagged by top severity, so runs over time and across topics can be filtered and charted. A benchmark run records `catch_rate` and `false_alarm_rate`. Recording never changes a scan's result or exit code; nothing is sent without `--langfuse`.
## In CI (GitHub Action)
```yaml
- uses: actions/checkout@v5
- uses: j-zulick/pagevet@v0.3.0
id: pagevet
with:
urls-file: urls.txt # or targets: "https://example.com/ page.html", or sitemap: ...
fail-on: high # low, medium, high, or never
- uses: github/codeql-action/upload-sarif@v4 # optional: needs code scanning (public repos, or GitHub Advanced Security)
if: always()
with:
sarif_file: ${{ steps.pagevet.outputs.sarif-file }}
```
Outputs: `sarif-file`, `exit-code` (0, 1 or 2, as for the command) and `findings`. Inputs reach the shell through environment variables, never as interpolated code. The repository's own CI runs the action on a sample page on every push.
## Pre-commit hook
```yaml
repos:
- repo: https://github.com/j-zulick/pagevet
rev: v0.3.0
hooks:
- id: pagevet # fails a commit that adds HTML, Markdown or text with a medium or high finding
```
## Scheduled re-scans with change alerts
`pagevet.rescan.rescan(urls, previous=last_report)` scans the pages and returns the full report (keep it for next time), only the findings that are new since `previous`, counts of new, unchanged and no-longer-found findings, and `alert` when a new finding is at or above `alert_on` (default medium). [`automation/windmill/pagevet_rescan.py`](automation/windmill/pagevet_rescan.py) is a ready Windmill script: it keeps the last report in Windmill's state, and a run with new findings fails so the workspace's error handler sends the alert. Deploying it needs a Windmill workspace with access to this repository.
## For assistants (MCP)
```bash
# the mcp extra
pagevet-mcp # stdio; add it to Claude Desktop, Claude Code, Cursor or ChatGPT as an MCP server
```
Two tools. `scan_page` takes a public URL or pasted HTML; `fetch_css: true` also applies the page's own linked stylesheets, and pages robots.txt disallows are skipped unless `ignore_robots: true`. `check_ai_access` takes a URL and returns the access report above. Addresses that resolve to private, loopback or link-local networks are refused, for the page, its stylesheets and the probes.
## Configuration
Plain scanning needs no settings. The optional sources and second opinions read environment variables, never command-line arguments, so tokens stay out of shell history. Copy [`.env.example`](.env.example) to `.env` in the folder you run PageVet from, or export the variables; a variable already set in the environment wins over `.env`.
| Setting | Used by |
|---|---|
| `PAGEVET_FIRECRAWL_URL`, `PAGEVET_FIRECRAWL_KEY` | `--via firecrawl` |
| `PAGEVET_CRAWL_URL`, `PAGEVET_CRAWL_TOKEN` | `--crawl` (crawlee-server) |
| `HF_TOKEN`, `PAGEVET_PROMPTGUARD_MODEL` | `--second-opinion promptguard` (gated model: accept its license on Hugging Face first) |
| `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, `LANGFUSE_BASE_URL` | `--langfuse` on `pagevet` and `pagevet-bench` (the `langfuse` extra) |
| `OPENROUTER_API_KEY` | `--second-opinion jev` and `llm` through OpenRouter (billed) |
| `PAGEVET_JEV_MODEL` | Jev model on OpenRouter (default `~typesafe/jev-latest`) |
| `PAGEVET_LLM_MODEL` | `--second-opinion llm`: an OpenRouter model id, `maker/model` |
| `TYPESAFE_API_KEY`, `TYPESAFE_DEFAULT_MODEL` | `--second-opinion jev` through the TypeSafe SDK instead (billed by TypeSafe) |
| `PAGEVET_SEARXNG_URL`, `PAGEVET_SEARXNG_TOKEN` | `pagevet-discover` (a SearXNG instance with JSON output; the token is optional) |
## Building a URL list from searches
`pagevet-discover "query one" "query two" --out urls.txt` asks a SearXNG instance for each query and writes a de-duplicated list for `pagevet --urls`, with a `# query:` line before each query's results and at most `--max-per-host` pages per site (default 5). `--from-json FILE` takes results you already have instead (`{"query": ["url", ...]}`). First use: a field study of 102 pages found by ten brake-rotor shopping queries ([results](docs/bench/2026-11-19-field-brake-rotors/)). It found no hidden instructions; 27 of the 67 readable pages refused at least one AI crawler.
## Field studies
```bash
pagevet-study run "running shoe shopping pages" --from-json search-results.json --out docs/bench/2026-11-23-field-running-shoes
pagevet-study run "CRM software" --queries queries.txt --out study/ # searches through SearXNG instead
pagevet-study report docs/bench/2026-11-23-field-running-shoes # rewrite README.md from the saved data
pagevet-study compare docs/bench/*-field-* --out docs/bench/FIELD-STUDIES.md
```
`run` builds the URL list (at most four pages per site), scans every page as a browser and as GPTBot, ClaudeBot and PerplexityBot with linked stylesheets read and robots.txt respected, and writes the search results, the list, the raw results and a README. Every number in that README is computed from `results.json`, so it can be regenerated; a hand-written "What this says" section is kept. Pages that refuse PageVet are reported as not read and never retried another way. `compare` puts several studies in one table: [docs/bench/FIELD-STUDIES.md](docs/bench/FIELD-STUDIES.md). `explore` writes the [field-study explorer](docs/EXPLORER.md): one self-contained HTML page with faceted filters over every study, false-alarm and benchmark record (`pagevet-study explore --out site/`; attached to each release as `explore.html`). So far (brake rotors, running shoes, small-business CRM software, home solar): no hidden instructions on any of 213 pages read, and 35–43% of readable pages refuse at least one AI crawler.
## Output
Text, JSON ([schema](docs/schema/report.schema.json)), CSV, a self-contained HTML report, and [SARIF 2.1.0](https://sarifweb.azurewebsites.net/) for code-scanning tools. Exit code 1 when a finding is at or above `--fail-on` (default `low`), 2 on errors with no findings.
**Commercial manipulation.** A finding whose instruction steers what AI answers recommend, rank, cite or leave out, toward a product or source, is labelled `intent: "commercial"` (SARIF: `commercial-manipulation` tag).
**Framework IDs.** Every JSON finding has a `taxonomy` object and every SARIF result `owasp` and `atlas` properties: [OWASP LLM01:2025](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) (prompt injection) and [MITRE ATLAS](https://atlas.mitre.org/) AML.T0051.001 (indirect prompt injection), plus AML.T0054 (jailbreak) for role and mode changes and AML.T0068 (prompt obfuscation) for hidden or disguised text. Findings that only say a page differs by reader carry no ID.
**Re-scans.** `--baseline FILE` takes an earlier `--format json` report and keeps only findings that are not in it, so the report and the exit code cover what changed. A summary line on stderr counts new, unchanged and no-longer-found findings (only pages scanned again count as no longer found). Findings are matched on page, channel, kinds and excerpt; an edit next to the matched text makes it count as new. SARIF results carry a `partialFingerprints` id, and with `--baseline` a `baselineState` of `new`.
## Limits (read these)
- **Pattern matching.** It finds known forms. Reworded instructions are missed, and so are most instructions split across full sentences (short fragments, and sentences that end on a word like "and" or "your", are joined and caught); see [docs/THREAT-MODEL.md](docs/THREAT-MODEL.md). A clean result is not proof a page is safe.
- **JavaScript rendering only through your Firecrawl or crawlee-server** (`--via firecrawl` or `--crawl`). Plain HTTP does not see text a script adds, and visibility is judged from inline styles, the page's own `<style>` rules and, with `--fetch-css`, its linked stylesheets; not from computed styles.
- **Cloaking by IP address** looks identical to PageVet; `--compare-agents` detects cloaking by user agent only.
- **Measured so far:** on Microsoft's BIPIA text attacks, the patterns catch 29 of 75 distinct attacks (38.7%) with 0 false alarms on 50 clean emails; ordinary-looking requests planted out of context are not caught at all ([details](docs/bench/2026-11-19-bipia/)). On 193 ordinary homepages and 133 article and forum pages, nothing is flagged at medium or high severity ([homepages](docs/bench/2026-11-19-clean-pages/); the article sample was supplied privately and its URLs are not published); the homepage figure was reached after turning off a rule that flagged 21 of them. A blind check afterwards, on 181 article, forum, Q&A and issue pages taken from public feeds, also flagged none at medium or high (95% interval 0–2.1%) and one at low ([details](docs/bench/2026-11-19-fresh-pages/)). In internal 0.24.0, 368 random Wikipedia and news pages in all twelve languages were flagged at no severity ([details](docs/bench/2026-11-24-pages-12-languages/)). Pages that blocked a plain fetch were retried through crawlee-server ([details](docs/bench/2026-11-19-crawlee/)). A [hiding-method report](docs/bench/2026-11-19-hiding/) covers 21 ways of hiding text from people (not a blind test). An [evasion report](docs/EVASION.md) shows which disguises get through: look-alike letters, invisible characters, letter spacing, ROT13, reversed text, inline splits and instructions split into short fragments are caught; reworded instructions, about half of held-out translated ones, and most new phrasings of cite, role, reply and omit instructions on a second held-out set (3 of 144 caught) are not; on that set's overrides and addressed text, 0.2.0 catches 66 of 72. In 0.2.0, the new patterns changed no result on 1,052 real pages re-fetched from every list above ([details](docs/bench/2026-11-25-false-alarms-0.2.0/)). Treat findings as leads to review.
- It complements runtime AI guardrails; it does not replace them.
## Safety
Detection only. PageVet does not generate injections. Fetching follows redirects; `fetch(..., allow_private=False)` refuses hosts that resolve to non-public addresses (use it when an agent or untrusted input chooses the URL). Sitemaps are parsed with `defusedxml`, capped at 5 MB, and cannot point the scan at local files.
**robots.txt is respected.** Before fetching a page over http(s), PageVet reads the site's robots.txt (once per site) and skips pages it disallows for the `pagevet` user agent, reporting them as not read. `--ignore-robots` is for your own site. `--crawl` leaves this to crawlee-server's own setting.
## Develop
```bash
uv sync --all-extras && uv run pytest -q && uv run ruff check .
```
Tests run offline, with no keys. How to contribute and report a missed injection or a false alarm: [CONTRIBUTING.md](CONTRIBUTING.md). Security issues: [SECURITY.md](SECURITY.md). Changes by version: [CHANGELOG.md](CHANGELOG.md).
## Author and AI assistance
Designed and built by [Joseph Zulick](https://github.com/j-zulick). I set the scope of each version and reviewed every change. Most of the code, tests and documentation were written with Claude (Anthropic) through Claude Code under my direction, and the commits carry a `Co-Authored-By: Claude` trailer. PageVet was built from November 19 to 25, 2026 in a private repository, one tested version at a time; this repository starts at the first public release, 0.1.0. Public versions count up from 0.1.0 to 1.0; version numbers marked "internal" in the docs are those private development builds ([CHANGELOG](CHANGELOG.md)).
The detection module (`pagevet/detect.py`) began as a copy of the injection check in [Crossvet](https://github.com/j-zulick/crossvet), my multi-vendor research tool, where it runs inside a research pipeline and is measured against planted pages. MIT license.
TDQS
Scored across 2 tools
The two tools target clearly different concerns: content-level prompt-injection scanning versus crawler-access policy inspection. There is minor conceptual overlap since both fetch public pages and reference robots.txt, but the descriptions make the boundary clear enough to avoid misselection.
Both names use snake_case and lead with an action verb, making them predictable and readable. The structures differ slightly (verb_noun vs verb_noun_noun), but they follow the same convention.
Two tools is on the thin side, but each is a substantial, distinct capability rather than a trivial wrapper. The set is well-scoped for a focused page-vetting server, though a third operation such as batch scanning might have rounded it out.
The surface covers the core domain well: injection scanning across multiple channels and AI crawler access checks including robots.txt, meta tags, llms.txt, and probe behavior. Minor gaps exist around batch or multi-page scanning and report persistence, but the main workflows are covered.