Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(rate-limit): budget the onboarding interview and GitHub seeding lanes separately

nirholas23c5360746f4
diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.js
index a23340b44..57f71fc36 100644
--- a/api/_lib/rate-limit.js
+++ b/api/_lib/rate-limit.js
@@ -1383,6 +1383,15 @@ export const limits = {
// Persona extraction: Claude API call — 5 per user per day.
personaExtract: (userId) =>
getLimiter('persona:extract', { limit: 5, window: '1 d' }).limit(userId),
+ // Onboarding interview (POST /api/persona/interview) in the create-agent
+ // wizard. Same try-first shape as agentSuggest: signed-in callers get room to
+ // re-run the interview while they tune their answers, signed-out callers get a
+ // tight per-IP budget because the call hits the shared LLM chain with no user
+ // attribution behind it. Keyed per IP in both cases (the wizard is one browser
+ // per build) with the global daily spend cap in api/_lib/llm.js behind it.
+ personaInterview: (ip) => getLimiter('persona:interview', { limit: 30, window: '1 h' }).limit(ip),
+ personaInterviewAnon: (ip) =>
+ getLimiter('persona:interview:anon', { limit: 8, window: '1 h' }).limit(ip),
// Persona preview: Claude API call on the server key. Looser than extract (it's
// interactive) but still per-user critical so a free-signup loop can't run up an
// unbounded LLM bill. Anonymous shouldn't reach it (auth required), so per-user.
@@ -1502,6 +1511,10 @@ export const limits = {
getLimiter('brain:chat:ip', { limit: 20, window: '1 m', critical: true }).limit(ip),
// X (Twitter) memory seeding: 1 seed per agent per 6 hours.
xSeed: (agentId) => getLimiter('memory:seed:x', { limit: 1, window: '6 h' }).limit(agentId),
+ // Consent-first GitHub memory seeding: reads the GitHub API and one LLM pass
+ // per run. 1 seed per agent per 6 hours, matching the X lane.
+ githubSeed: (agentId) =>
+ getLimiter('memory:seed:github', { limit: 1, window: '6 h' }).limit(agentId),
// Withdrawal requests: 5 per user per day. This is the daily cap on the only
// owner-initiated path that sweeps real funds out of custody, so it is critical
// — a missing Redis in prod must fail closed rather than fall back to the