aitp-console

Monitoring and control console for the AITP ecosystem

Operator demo console for the reference CP. This is a demonstration and operations UI for the reference AITP control plane and playground, not a product and not a security boundary for anything beyond its own login. Verifiers never depend on it: they fetch manifests and revocation lists from the issuers themselves.

A Next.js 16 monitoring and control console for the AITP ecosystem.

It talks to two backend services — the playground (Python FastAPI, runs scenarios on :8000) and the control plane (Next.js, registry

  • audit on :4000) — through server-side BFF proxy routes that keep API keys off the browser.

Upstream services

The console owns no data of its own; it renders state from two sibling repos. For what that state means, read their docs — this console's docs deliberately don't duplicate them:

ServiceRepoDocs
Playground (scenarios, runs, live timeline)aitp-playgroundagentidentitytrustprotocol.io/playground
Control plane (registry, sessions, audit, trust, webhooks)aitp-control-planeagentidentitytrustprotocol.io/control-plane
Protocol specagentidentitytrustprotocolagentidentitytrustprotocol.io/spec

Sections

SectionPathBackend(s)
Dashboard/dashboardCP — KPIs, time-series, top capabilities
Scenarios/scenariosPlayground — pack tree, scenario detail, run trigger (templates + variants + fault injection)
Runs/runs, /runs/[id]Playground — timeline + narration + per-run CP audit/sessions/deliveries
Monitor/monitor, /monitor/sessions/[id]CP — live event ticker, delegation tree, observed TCTs
Registry/registry, /registry/[aid]CP — agent table, manifest viewer, enrollment-token modal, deregister
Trust/trustCP — trust anchors, pinned SPKI keys, revocation entries
Audit/auditCP — filterable, exportable protocol event history
Config/configBoth — health/readiness, SDK capabilities, playground processes, metrics, CP identity, webhooks (with circuit breaker)

Commands

npm install
npm run dev                 # port 3001
npm run build
npm run start               # serve a production build on :3001
npm run analyze             # build with the bundle analyzer
npm run typecheck
npm run lint
npm run format              # prettier --write over src/
npm run format:check
npm test                    # unit + component tests
npm run test:watch
npm run test:integration    # route-handler tests + gated end-to-end tests
                            # (see internal_docs/TESTING.md)

Documentation

Published docs (docs/, synced to the docs site under /console):

  • FEATURES.md — what each section does and the key operator flows (run trigger, enrollment, revocation, live feeds)
  • ARCHITECTURE.md — topology, BFF proxy rationale, layering, SSE design, type flow
  • PROXIES.md — every BFF route mapped to its upstream, plus the "adding a new proxy" recipe
  • CONVENTIONS.md — code layout, hook / component / proxy patterns, accessibility

Contributor docs live in internal_docs/ (repo only — not published to the docs site): DEVELOPMENT.md (first-time setup, day-to-day, adding a route), TESTING.md (unit + integration suites, env gates), DEPLOYMENT.md (Vercel, env vars, SSE plan sizing, CI).

For the upstream services this console renders, see the playground and control plane docs.

Quick start

cd aitp-ui-console
npm install
cp .env.example .env.local   # API keys can stay blank for local
npm run dev                  # → :3001

Set CONSOLE_PASSWORD and CONSOLE_SESSION_SECRET in .env.local first: the console serves 503 on every route until both are set. Sign in at /login. For scripts, send HTTP Basic with the password (any username); mutations also need an Origin header matching the console's origin.

Deploying

Set these on every Vercel environment that operators sign in to. Without them, the environment serves 503 on every route. The hosted console sets them on Production only, from Doppler, so its previews serve 503 and never hold the password (see internal_docs/DEPLOYMENT.md):

VariableNotes
CONSOLE_PASSWORDOperator password, 24+ random characters.
CONSOLE_SESSION_SECRETSession-cookie HMAC key, e.g. openssl rand -hex 32. Rotating it signs every operator out.
AITP_CONSOLE_PUBLIC_MODEDefault off. on, true or 1 opens the read routes and run launches to anonymous visitors, with per-IP limits; admin routes still need the operator. See Access model.

The upstream variables (PLAYGROUND_URL, CP_URL, *_API_KEY including CP_READ_API_KEY, CONSOLE_CLIENT_IP_HEADER, TRUSTED_ORIGINS) are in .env.example and internal_docs/DEPLOYMENT.md.

The console runs on its own — if an upstream is down the topbar shows a red dot and the relevant section falls back to an empty state (no crashes). To drive live data, bring up the two siblings per their own docs (control plane, playground). The full three-terminal loop is in internal_docs/DEVELOPMENT.md.

Architecture at a glance

Browser → fetch('/api/cp/registry/agents')
       → Next.js Route Handler (src/app/api/cp/registry/agents/route.ts)
          → proxyGet('cp', '/api/registry/agents', req)
            adds Authorization: Bearer ${CP_API_KEY}
          → http://localhost:4000/api/registry/agents
       ← JSON response, forwarded to browser

Every BFF route follows the same 4-line pattern; the full route → upstream map is in PROXIES.md. SSE streams (/runs/:id/events, /api/events/stream) use proxySse, which keeps the upstream response body open and re-emits it with Content-Type: text/event-stream.

Real-time is handled with native EventSource via useSse (auto-reconnect with exponential backoff, page-visibility pausing). No WebSocket library.

REST is fetch + TanStack Query. Component-level state only — no global store yet.

See ARCHITECTURE.md for the full breakdown.