Agent-Served Site
A WordPress plugin that serves an entire website generated on the fly by an AI agent — example consumer of Automattic/agents-api + wp-ai-client (WP 7.0 core).
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/lezama/agent-served-site/archive/refs/heads/master.zipReadme
Agent-Served Site
A WordPress plugin where the website has no templates. A short markdown spec
(a bundled preset in presets/, or a custom one) is the entire source
of truth. Every page is generated on the
fly by an AI agent that reacts to what the visitor does — page load, clicks,
form submits, typing — and renders the HTML for the next page state. Navigation,
a menu, a cart, a checkout form: all invented per-request by the model, with
continuity carried across the session.
It's a proof-of-concept of a "generative UI" / LLM-served site, built as a
consumer of Automattic/agents-api
— a worked example of how to plug a product onto that substrate.
⚠️ Proof of concept. The agent's HTML+JS output is injected into the page by design (this is the whole point), so it is XSS-by-construction. Don't run this on a production site without an output policy. See Security.
How it works
Browser shell (iframe) WordPress
───────────────────── ─────────
load / click / submit ──POST /chat──▶ agents-api ──▶ agent-served-site handler
agents/chat │ site spec + session history + event
(canonical) │ │
│ ▼
rendered HTML ◀──── reply ─────────┘ wp-ai-client → AI provider (Claude, …)
(swapped into the iframe)
- The shell (
/?served=1) is a tiny HTML document hosting a sandboxed `