Skip to content

Add public read-only Data API (v1) over the AISafety.com directories#417

Open
NoahLloyd wants to merge 14 commits into
StampyAI:mainfrom
NoahLloyd:NoahLloyd/aisafety-data-apis
Open

Add public read-only Data API (v1) over the AISafety.com directories#417
NoahLloyd wants to merge 14 commits into
StampyAI:mainfrom
NoahLloyd:NoahLloyd/aisafety-data-apis

Conversation

@NoahLloyd

Copy link
Copy Markdown
Contributor

Adds a public, read-only JSON Data API (v1) over the existing Airtable-backed AISafety.com directories: 10 collection endpoints under /api/v1 plus a self-describing index, a generated OpenAPI spec, and an on-brand /developers docs page. Every endpoint reuses the existing src/lib/data functions and returns a wrapped { data, meta } envelope with query-param filtering, free-text q search, open CORS, absolute image URLs, and CC-BY-4.0 licensing. A new events normalizer is added (events was previously an Airtable iframe embed), and there are no changes to shared data-layer code. Verified with type-check, lint, and a full production build.

🤖 Generated with Claude Code

NoahLloyd and others added 13 commits May 6, 2026 20:56
Initial index for sitewide LLM assistant research. Frames the assistant
as a directory navigator (not a general AI safety tutor), since the site
is structured as curated resource lists rather than editorial content.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Maps the ~10 Airtable tables and hand-written pages that would feed a
RAG pipeline. Proposes one-document-per-Airtable-record granularity
(~900-1200 docs total) with structured metadata for filtering, and
calls out edge cases: Publish?/Hide? filters, magic rows on /map,
inactive orgs, job staleness, and the 4x4 donation-guide tree.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Frames the assistant as a directory navigator: routes, recommends,
walks the donation tree, and disambiguates listings. Hand-off rules
for conceptual AI safety questions (route to aisafety.info), explicit
no-go list (career coaching, news, application drafting), and a
behaviour checklist for evals.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Compares pure-prompt, RAG-vector, RAG-hybrid (tools + vector rerank),
and fine-tuning. Recommends hybrid: tool calls expose the same filters
the resource pages already have (type, location, experience, etc.),
with vector similarity ranking within the filtered subset. Inference
on Vercel Edge; index refresh hooks into existing check-rebuild cron.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Compares floating widget, dedicated /ask page, and inline-on-resource-
page filter parsing. Recommends /ask page as the primary surface
(reuses existing design tokens — text-field, button-primary,
container-default — and the FeaturedCard pattern for citations),
with floating widget deferred and inline-filter U3 as a v1.5
follow-up. Covers naming, state (client-only via useChat),
streaming/tool-call UX, accessibility, and rate limiting.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Concrete picks for model, embeddings, vector store, runtime, SDK,
rate limit, observability, and index build pipeline. Also flags
open questions that need decisions before implementation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pulls together the analysis in 01-05 into a single readable brief
with a v0 -> v1 -> v1.5 -> v2 plan, cost ballpark, risks table,
decision log, and explicit open questions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
06-evaluation.md spec: 30-query eval set, hybrid programmatic +
LLM-as-judge scoring, harness layout, launch gate at >=80%
pass-rate per row.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
07-prompt-injection.md enumerates realistic attack scenarios
against the Airtable-backed corpus (the main vector) and the
chat surface, then specs layered mitigations: system-prompt
clauses, tool-result sandboxing, pre-index sanitisation,
output filtering, tool-loop budget, rate limit, and moderation
queue. Includes a mitigation matrix and explicit non-goals.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
08-cost-model.md walks through per-turn token math, the three
traffic regimes (quiet/busy/peak), prompt-caching impact,
optimisation levers in order of impact, and concrete spending-cap
numbers. Headline: chat-time output tokens dominate everything
else; a quiet-to-busy first-month ramp projects ~$370.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Exposes the existing Airtable-backed directories as 10 JSON endpoints under
/api/v1 (communities, organizations, events, jobs, funding, courses, advisors,
media-channels, founder-resources, projects), plus a self-describing index, a
generated OpenAPI spec, and a /developers docs page. Responses use a wrapped
{ data, meta } envelope with query-param filtering, free-text q search, open
CORS, absolute image URLs, and CC-BY-4.0 licensing. Reuses the existing
src/lib/data getX() functions and adds a new events normalizer (events was
previously an Airtable iframe embed); no shared-code changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-safety-com Ready Ready Preview, Comment Jun 18, 2026 5:32am

Request Review

@NoahLloyd

Copy link
Copy Markdown
Contributor Author

Sorry about the messy commit list. Please ignore the AI-research / project-idea commits, all the changes are reverted, but still accidentally included the commits as part of the PR

…blic API

- Remove `sort` from the communities and founder-resources endpoints (and
  their data shapes); ordering still comes from the Airtable query sort.
- Strip `email` from the projects endpoint at the route layer so it can't be
  bulk-harvested; the /projects page still renders it for human visitors.
- Remove code/doc text that named internal Airtable fields (Internal notes,
  submitter email, etc.) so the source no longer advertises them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bryceerobertson

bryceerobertson commented Jun 18, 2026

Copy link
Copy Markdown
Member

This PR was reviewed to confirm no non-public Airtable fields are exposed. The design is sound — each endpoint explicitly selects its output fields, so internal fields such as Internal notes are never reachable. Commit b8f0381 tightens three judgment-call fields:

  • sort removed from the communities and founder-resources endpoints (and their data shapes). The output value was unused on the site — ordering is still driven by the Airtable query sort — so it only served to expose an internal ordering number.
  • email removed from the projects endpoint at the route layer (mirroring how organizations strips isMagic). The /projects page continues to render the contact email for human visitors, but it is no longer present in the machine-readable API, where it could be bulk-harvested. The contact name is unchanged.
  • Internal field names removed from source text — the allowlist comment in events.ts and the "Privacy" section in docs/api.md previously listed the hidden Airtable fields (Internal notes, Submitter's email, and others). Both now state only that internal and personal fields are excluded.

Type-check, lint, and a production build all pass.

🤖 Written by Claude Code

@bryceerobertson

Copy link
Copy Markdown
Member

LGTM now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants