# Agent Permissions Playground A small Next.js app for drafting, testing, and explaining `agent-permissions.json` files. You can try it live at https://agent-permissions-tools.vercel.app/. ## Features - **Quick Builder**: Toggle common rules (navigation, forms, downloads, rate limits) and copy a ready-to-ship JSON. - **Generator**: Fetch a single landing page, stream intermediate logs, and get an LLM-generated draft policy. Shows any existing `.well-known/agent-permissions.json`. - **Parser / Explainer**: Paste a policy to see human-friendly summaries of verbs, selectors, and directives. - **Themes**: Light/dark toggle (defaults to system). ## Getting Started ### Prerequisites - Node.js 18+ - `OPENAI_API_KEY` set in `.env.local` ### Install & Run ```bash npm install npm run dev # visit http://localhost:3000 ``` ## API - `POST /api/generate` – body: `{ url: string, instructions?: string }` - Returns crawl snapshot, existing policy (if found), streamed process log, and generated policy. ## Notes - Retrieval is single-page only; links are not crawled. - Robots.txt is respected when present. ## Project Structure - `src/app/page.tsx` – UI (tabs, builder, generator, parser) - `src/app/api/generate/route.ts` – generation endpoint - `src/lib/crawl.ts` – single-page fetcher - `src/lib/robots.ts` – robots.txt handling