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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: enhance dashboard form with additional fields and improve search functionality
nirholas3ae41962ba5f
diff --git a/public/.well-known/validators.json b/public/.well-known/validators.jsonnew file mode 100644index 000000000..c8066d33f--- /dev/null+++ b/public/.well-known/validators.json@@ -0,0 +1,7 @@+{+ "$schema": "https://3dagent.vercel.app/specs/validators-v1",+ "description": "Allow-listed ERC-8004 ValidationRegistry validators for 3D Agent Card v1 attestations. See specs/VALIDATORS.md.",+ "updatedAt": "2026-04-27",+ "mainnet": [],+ "testnet": []+}diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.jsindex 8ea723a8c..631adf0d5 100644--- a/public/dashboard/dashboard.js+++ b/public/dashboard/dashboard.js@@ -765,9 +765,25 @@ async function renderKeys(root) {root.innerHTML = `<h1>API keys</h1><p class="sub">Server-side keys for calling the MCP server without OAuth. Treat like passwords.</p><div class="card" style="margin-bottom:16px">- <form id="new" class="row" style="flex-wrap:wrap;gap:10px">+ <form id="new" class="row" style="flex-wrap:wrap;gap:10px;align-items:flex-start"><input id="kname" placeholder="Key name (e.g. my-app prod)" required>- <select id="kenv"><option value="live">live</option><option value="test">test</option></select>+ <select id="kenv" title="Environment">+ <option value="live">live</option>+ <option value="test">test</option>+ </select>+ <select id="kexp" title="Expires">+ <option value="">Never expires</option>+ <option value="30">30 days</option>+ <option value="90">90 days</option>+ <option value="365">1 year</option>+ </select>+ <fieldset id="kscope" style="border:1px solid var(--border,#333);border-radius:6px;padding:6px 10px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:0">+ <legend style="padding:0 4px;font-size:12px" class="muted">Scopes</legend>+ <label><input type="checkbox" name="scope" value="avatars:read" checked> read</label>+ <label><input type="checkbox" name="scope" value="avatars:write" checked> write</label>+ <label><input type="checkbox" name="scope" value="avatars:delete"> delete</label>+ <label><input type="checkbox" name="scope" value="profile"> profile</label>+ </fieldset><button class="btn" type="submit">Create key</button></form><div id="reveal"></div>@@ -783,17 +799,23 @@ async function renderKeys(root) {return;}klist.innerHTML = keys- .map(- (k) => `+ .map((k) => {+ const created = new Date(k.created_at).toLocaleDateString();+ const expired = k.expires_at && new Date(k.expires_at) < new Date();+ const expiresLabel = k.expires_at+ ? ` · ${expired ? '<b style="color:#f88">expired</b>' : `expires ${new Date(k.expires_at).toLocaleDateString()}`}`+ : '';+ const revokedLabel = k.revoked_at ? ' · <b style="color:#f88">revoked</b>' : '';+ return `<div class="key-row"><div><div><code>${esc(k.prefix)}…</code> — ${esc(k.name)}</div>- <div class="muted">scope: ${esc(k.scope)} · created ${new Date(k.created_at).toLocaleDateString()}${k.revoked_at ? ` · <b style="color:#f88">revoked</b>` : ''}</div>+ <div class="muted">scope: ${esc(k.scope)} · created ${created}${expiresLabel}${revokedLabel}</div></div>${k.revoked_at ? '' : `<button class="btn sec" data-id="${esc(k.id)}">Revoke</button>`}</div>- `,- )+ `;+ }).join('');klist.querySelectorAll('button[data-id]').forEach((b) =>b.addEventListener('click', async () => {@@ -813,10 +835,21 @@ async function renderKeys(root) {root.querySelector('#new').addEventListener('submit', async (e) => {e.preventDefault();try {- const { key } = await api.createKey({+ const scopes = Array.from(+ root.querySelectorAll('#kscope input[name=scope]:checked'),+ ).map((el) => el.value);+ if (!scopes.length) {+ alert('Select at least one scope.');+ return;+ }+ const expDays = parseInt(root.querySelector('#kexp').value, 10);+ const payload = {name: root.querySelector('#kname').value,environment: root.querySelector('#kenv').value,- });+ scope: scopes.join(' '),+ };+ if (Number.isFinite(expDays) && expDays > 0) payload.expires_in_days = expDays;+ const { key } = await api.createKey(payload);root.querySelector('#reveal').innerHTML = `<div style="margin-top:10px"><p class="muted">Copy this key now — you won't see it again.</p>@@ -1038,6 +1071,11 @@ async function renderEmbed(root) {<h3 style="margin:0 0 6px">Who can embed?</h3><p class="muted" style="margin:0 0 10px">By default anyone. Lock it down to specific hosts (your chat host, your Substack…) on the <a href="/dashboard/embed-policy?agent=${encodeURIComponent(agent.id)}">embed-policy page</a>.</p></div>+ <div class="card" style="margin-top:14px">+ <h3 style="margin:0 0 6px">Browser permissions & CSP</h3>+ <p class="muted" style="margin:0 0 6px">The iframe needs <code>allow="camera; microphone"</code> for speech I/O. Drop either or both if your host doesn't use them.</p>+ <p class="muted" style="margin:0">If your host enforces a Content-Security-Policy, allow this origin: <code>frame-src ${esc(origin)}</code> and <code>connect-src ${esc(origin)}</code>.</p>+ </div>${onchainCard(agent)}${myAgentsCard()}</div>@@ -2369,19 +2407,25 @@ async function renderAnimations(root) {statusEl.className = 'muted';statusEl.style.cssText = 'margin:4px 0 0;font-size:12px;min-height:18px;';+ let saveSeq = 0;+ let clearTimer;function debounceSync() {clearTimeout(saveTimer);+ clearTimeout(clearTimer);saveTimer = setTimeout(async () => {+ const seq = ++saveSeq;statusEl.style.color = '#888';statusEl.textContent = 'Saving…';try {await api.patchAgentAnimations(agent.id, animations);+ if (seq !== saveSeq) return;statusEl.style.color = '#9a8cff';statusEl.textContent = 'Saved.';- setTimeout(() => {- if (statusEl.textContent === 'Saved.') statusEl.textContent = '';+ clearTimer = setTimeout(() => {+ if (seq === saveSeq && statusEl.textContent === 'Saved.') statusEl.textContent = '';}, 2000);} catch (err) {+ if (seq !== saveSeq) return;statusEl.style.color = '#ffb3b3';statusEl.textContent = err.message || 'Save failed.';}@@ -2392,6 +2436,11 @@ async function renderAnimations(root) {return animations.some((a) => a.name.toLowerCase() === name.toLowerCase());}+ function nameTaken(name, except) {+ const lower = name.toLowerCase();+ return animations.some((a) => a !== except && a.name.toLowerCase() === lower);+ }+let listEl, presetGridEl;function renderClipList() {diff --git a/public/discover/discover.js b/public/discover/discover.jsindex 8e529a124..0ec6f841d 100644--- a/public/discover/discover.js+++ b/public/discover/discover.js@@ -128,6 +128,7 @@ els.chain.addEventListener('change', () => {});els.search.addEventListener('input', () => {+ updateSearchClearVisibility();clearTimeout(searchDebounce);searchDebounce = setTimeout(() => {state.query = els.search.value.trim();@@ -136,6 +137,18 @@ els.search.addEventListener('input', () => {}, 250);});+els.searchClear?.addEventListener('click', () => {+ els.search.value = '';+ state.query = '';+ updateSearchClearVisibility();+ syncUrl();+ resetAndLoad();+ els.search.focus();+});++// Initial visibility (covers ?q= deep links).+updateSearchClearVisibility();+els.loadMore.addEventListener('click', () => loadPage());// Delegated embed-button click — cards can be re-rendered freely@@ -220,6 +233,7 @@ function clearAllFilters() {state.query = '';els.search.value = '';els.chain.value = '';+ updateSearchClearVisibility();for (const b of els.filters.querySelectorAll('[data-filter]')) {b.classList.toggle('active', b.dataset.filter === 'all');}diff --git a/public/sitemap.xml b/public/sitemap.xmlindex e40ecd85a..49292ee91 100644--- a/public/sitemap.xml+++ b/public/sitemap.xml@@ -11,4 +11,10 @@<changefreq>daily</changefreq><priority>0.8</priority></url>+ <url>+ <loc>https://3dagent.vercel.app/features</loc>+ <lastmod>2026-04-27</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.9</priority>+ </url></urlset>diff --git a/specs/SECURITY.md b/specs/SECURITY.mdnew file mode 100644index 000000000..04bb11da7--- /dev/null+++ b/specs/SECURITY.md@@ -0,0 +1,76 @@+# Security & Threat Model — 3D Agent Card v1++Scope: agents registered under [3D Agent Card v1](3D_AGENT_CARD.md) on the ERC-8004 Identity, Reputation, and Validation registries. For general site security contact info, see [/.well-known/security.txt](../public/.well-known/security.txt).++This document enumerates abuse vectors specific to 3D agent registration and lists the current mitigation (or marks it open).++## Vectors++### V1 — Stolen / unlicensed model registration+A user pins someone else's GLB to IPFS and registers it as their agent.++- **Mitigation:** card requires `model.license` (SPDX or URL). Validators MAY refuse `pass` for cards with `license: "unknown"`. DMCA takedown contact published in [security.txt](../public/.well-known/security.txt). Registry never serves the file directly — it points at IPFS.+- **Status:** partial. License is declarative, not verified. Open: perceptual-hash blocklist for known stolen assets.++### V2 — Mutable model swap+Card uses `https://` `model.uri` and operator swaps the GLB after registration.++- **Mitigation:** `model.sha256` is mandatory; `<three-d-agent-badge>` and the resolver verify hash on every load. A swap surfaces as `unverified`. Spec SHOULD prefers `ipfs://` for prevention.+- **Status:** mitigated for clients that verify; clients that ignore the badge are out of scope.++### V3 — Fake "verified" claim+A site renders its own green pill claiming verification without checking.++- **Mitigation:** the trust signal is the on-chain validation attestation from an allow-listed validator (see [VALIDATORS.md](VALIDATORS.md)) — not the badge UI. Consumers verify against ValidationRegistry directly or via the resolver.+- **Status:** mitigated by design.++### V4 — Validator key compromise+A validator's signing key leaks; attacker signs `pass` for malicious agents.++- **Mitigation:** validator keys are dedicated, not personal wallets (per [VALIDATORS.md](VALIDATORS.md)). Compromise → `removeValidator(address)`. Past attestations from that validator SHOULD be treated as expired from the removal block onward by any indexer / resolver.+- **Status:** policy in place; key custody is each validator's responsibility. Open: support EIP-712 attestations with explicit expiry timestamps so leaked keys self-expire.++### V5 — Reputation gaming (sybil reviews)+Attacker mints many agents and posts inflated `ReputationRegistry` scores for a target.++- **Mitigation:** ReputationRegistry already enforces one score per (reviewer, agent). Beyond that, the recommended reputation surface for v1 is *measured* signals from validators (render success, load p95, A2A handshake), not user thumbs-up. See [3D_AGENT_CARD.md](3D_AGENT_CARD.md) §"Reputation".+- **Status:** partial. The on-chain primitive is sybil-resistant per-pair but not per-identity. Open: weight reviews by reviewer's own validation history.++### V6 — Sybil registrations+Attacker mints thousands of agents to spam discovery surfaces.++- **Mitigation:** registration costs gas — Base mainnet is the primary chain for this reason. The optional gasless path via paymaster is rate-limited per wallet/IP at the paymaster layer, not on-chain.+- **Status:** mitigated on mainnet; paymaster rate limits are operational, not specified here.++### V7 — IPFS unpinning+Pinned GLB is dropped by all gateways; card now points at dead content.++- **Mitigation:** the registration flow pins to Storacha (paid). Validators MUST re-fetch on every attestation; a dropped file produces a `fail` on `manifest-integrity`, demoting the agent.+- **Status:** mitigated during validator runs. Long-term: optional Filecoin deal storage for "permanent" tier agents.++### V8 — NSFW / illegal model content+A registered agent's GLB contains illegal or platform-violating content.++- **Mitigation:** pre-pin moderation hook in the registration UI (open). Post-registration takedowns happen at the gateway / discovery layer — the chain entry persists but the agent is hidden from `/explore` and the resolver returns `403 BLOCKED`.+- **Status:** **OPEN**. No moderation hook is wired in [src/erc8004/register-ui.js](../src/erc8004/register-ui.js) yet. This is the highest-priority gap before opening public registration.++### V9 — Supply-chain on the badge / resolver+Attacker compromises `3dagent.vercel.app` and serves a malicious badge bundle that lies about verification.++- **Mitigation:** badge source is open in [src/erc8004/badge.js](../src/erc8004/badge.js); embedders SHOULD self-host or pin to a known SRI hash. Resolver responses are signed (open) so a tampered response can be detected client-side.+- **Status:** partial. SRI guidance documented; resolver signing is open.++### V10 — Card spoofing via tokenURI rewrite+Identity NFT owner updates `tokenURI` to point at a new card with different `model.sha256`.++- **Mitigation:** every card update is an on-chain event. Indexers SHOULD show the version chain via the optional `previousVersion` field. Consumers MAY pin to a specific card CID rather than following the live `tokenURI`.+- **Status:** mitigated by design; `previousVersion` adoption is encouraged.++## Reporting++Security issues: see [public/.well-known/security.txt](../public/.well-known/security.txt). For validator misconduct, open a public issue tagged `validator-dispute`.++## Governance roadmap++- Identity / Reputation / Validation registry **owner** is currently the deployer EOA. Migrate to a 3-of-5 Safe on Base before opening public registration.+- Validator allow-list changes go through a PR + on-chain `addValidator`/`removeValidator` call from the owner. Post-Safe migration, allow-list changes require multisig approval.diff --git a/specs/VALIDATORS.md b/specs/VALIDATORS.mdnew file mode 100644index 000000000..8e99664f7--- /dev/null+++ b/specs/VALIDATORS.md@@ -0,0 +1,56 @@+# Validator Allow-list Policy++The [ValidationRegistry](../contracts/src/ValidationRegistry.sol) only accepts attestations from allow-listed validator addresses. This document describes who is on the list, how attestations are formed, and how the list is changed.++## Why an allow-list++A validation report says "I checked agent #N's model and it is sound." For that statement to carry weight, consumers need to know *who* signed it. Open writes would let any address claim "verified" status, collapsing the trust signal to zero. Allow-listing keeps the set small, named, and accountable.++## What a validator attests to++A validator runs a deterministic suite over an agent's GLB and metadata, produces an [agent validation report](../public/validation/REPORT_FORMAT.md), pins it to IPFS, and calls `recordValidation(agentId, reportCID)` from an allow-listed address.++The minimum suite for "verified" status:++| Suite | What it checks |+| ---------------------- | ----------------------------------------------------------------------- |+| `glb-schema` | File parses as valid glTF/GLB; all required chunks present. |+| `gltf-validator` | Khronos `gltf-validator` reports zero errors (warnings allowed). |+| `manifest-integrity` | Card `model.sha256` matches the bytes at `model.uri`. |+| `card-schema` | Card validates against [3D Agent Card v1](3D_AGENT_CARD.md). |+| `services-reachable` | Each `services[].endpoint` returns 2xx within 5s (informational). |++A `pass` verdict requires zero `fail` suites. `warn` is allowed.++## Current allow-list++Maintained on-chain at the registry's `validators` mapping. The canonical mirror lives at:++- **Base mainnet (8453):** [public/.well-known/validators.json](../public/.well-known/validators.json)+- **Base Sepolia (84532):** same file, `testnet` array.++Each entry is `{ address, name, contact, addedAt, scope }`. `scope` is one of `gltf` (default suite only) or `gltf+services` (also runs `services-reachable`).++## Becoming a validator++1. Open a PR adding your entry to [validators.json](../public/.well-known/validators.json) with:+ - Operator name and a contactable email or HTTPS endpoint for disputes.+ - The Ethereum address you will sign from. **Use a dedicated key**, not a personal wallet.+ - A link to your runner's source (so suite determinism is auditable).+2. Run the canonical suite over three reference agents (provided in the PR template) and post the resulting report CIDs in the PR. Maintainers reproduce the runs.+3. On approval, the registry owner calls `addValidator(address)` and the PR is merged.++## Removal++A validator is removed for any of:++- Signing a `pass` for a card whose `model.sha256` does not match the bytes (one strike).+- Signing reports off-policy (e.g. attesting fields outside the suite).+- Unreachable contact for >30 days while a dispute is open.+- Voluntary withdrawal.++Removal is `removeValidator(address)`. Past attestations remain on-chain but consumers SHOULD treat reports from a removed validator as expired from the removal block onward.++## Governance++Until a multisig is in place, the registry owner is the project deployer wallet. Migration to a 3-of-5 Safe on Base is tracked in [SECURITY.md](SECURITY.md).diff --git a/src/share-panel-builders.js b/src/share-panel-builders.jsindex c2fc5ca0a..03a5b7bcf 100644--- a/src/share-panel-builders.js+++ b/src/share-panel-builders.js@@ -61,9 +61,9 @@ export function buildIframeSnippet({ origin, agentId, opts = {} }) {}/**- * Build the <agent-3d> web-component embed snippet. The web component renders- * a richer surface (chat shell + viewer) than the iframe page, so the bg /- * name-plate toggles intentionally do not propagate here.+ * Build the <agent-3d> web-component embed snippet. The bg / name-plate toggles+ * propagate through `background="..."` and `name-plate="off"` attributes which+ * the element observes (see element.js → _applyBackground / _applyNamePlate).** @param {{ origin: string, agentId: string, opts?: Partial<typeof DEFAULT_OPTIONS> }} args* @returns {string}@@ -71,9 +71,12 @@ export function buildIframeSnippet({ origin, agentId, opts = {} }) {export function buildWebComponentSnippet({ origin, agentId, opts = {} }) {const merged = { ...DEFAULT_OPTIONS, ...opts };const { width, height } = SIZES[merged.size] || SIZES.medium;+ const attrs = [`agent-id="${agentId}"`];+ if (merged.bg !== DEFAULT_OPTIONS.bg) attrs.push(`background="${merged.bg}"`);+ if (merged.name !== DEFAULT_OPTIONS.name) attrs.push(`name-plate="off"`);return (`<script type="module" src="${origin}/dist-lib/agent-3d.js"><\/script>\n` +- `<agent-3d agent-id="${agentId}"\n` ++ `<agent-3d ${attrs.join(' ')}\n` +` style="display:block;width:${width}px;height:${height}px"\n` +`></agent-3d>`);diff --git a/style.css b/style.cssindex f9b70714c..201aaa170 100644--- a/style.css+++ b/style.css@@ -5633,10 +5633,11 @@ textarea.erc8004-code {}.explore-search {flex: 1 1 260px;+ position: relative;}.explore-search input {width: 100%;- padding: 10px 14px;+ padding: 10px 36px 10px 14px;background: rgba(0, 0, 0, 0.4);border: 1px solid rgba(255, 255, 255, 0.08);border-radius: var(--radius-sm);@@ -5649,6 +5650,37 @@ textarea.erc8004-code {border-color: var(--accent);background: rgba(0, 0, 0, 0.6);}+/* Hide native WebKit clear; we render our own. */+.explore-search input[type='search']::-webkit-search-cancel-button {+ -webkit-appearance: none;+ appearance: none;+}+.explore-search-clear {+ position: absolute;+ top: 50%;+ right: 8px;+ transform: translateY(-50%);+ width: 22px;+ height: 22px;+ display: grid;+ place-items: center;+ border: 0;+ border-radius: 50%;+ background: rgba(255, 255, 255, 0.1);+ color: rgba(255, 255, 255, 0.7);+ font-size: 16px;+ line-height: 1;+ cursor: pointer;+ transition:+ background 0.15s ease,+ color 0.15s ease;+}+.explore-search-clear:hover,+.explore-search-clear:focus-visible {+ background: var(--accent-soft);+ color: var(--accent);+ outline: none;+}.explore-chips {display: flex;gap: 6px;diff --git a/tests/share-panel.test.js b/tests/share-panel.test.jsindex 8b2cda97d..00e3018ab 100644--- a/tests/share-panel.test.js+++ b/tests/share-panel.test.js@@ -136,6 +136,70 @@ describe('share-panel — buildWebComponentSnippet', () => {expect(snippet).toContain('width:520px');expect(snippet).toContain('height:680px');});++ it('omits background/name-plate attrs when defaults are in effect', () => {+ const snippet = buildWebComponentSnippet({ origin: ORIGIN, agentId: ID });+ expect(snippet).not.toContain('background=');+ expect(snippet).not.toContain('name-plate=');+ });++ it('emits background="dark" when the dark BG toggle is on', () => {+ const snippet = buildWebComponentSnippet({+ origin: ORIGIN,+ agentId: ID,+ opts: { bg: 'dark' },+ });+ expect(snippet).toContain('background="dark"');+ });++ it('emits background="light" when the light BG toggle is on', () => {+ const snippet = buildWebComponentSnippet({+ origin: ORIGIN,+ agentId: ID,+ opts: { bg: 'light' },+ });+ expect(snippet).toContain('background="light"');+ });++ it('emits name-plate="off" when the name plate is disabled', () => {+ const snippet = buildWebComponentSnippet({+ origin: ORIGIN,+ agentId: ID,+ opts: { name: false },+ });+ expect(snippet).toContain('name-plate="off"');+ });+});++describe('agent-3d web component — attribute surface', () => {+ const elementSrc = readFileSync(p('src/element.js'), 'utf8');++ it('declares `background` and `name-plate` in observedAttributes', () => {+ expect(elementSrc).toMatch(/'background'\s*,/);+ expect(elementSrc).toMatch(/'name-plate'\s*,/);+ });++ it('routes `background` changes to _applyBackground without rebooting', () => {+ expect(elementSrc).toContain("if (name === 'background') this._applyBackground();");+ });++ it('routes `name-plate` changes to _applyNamePlate without rebooting', () => {+ expect(elementSrc).toContain("if (name === 'name-plate') this._applyNamePlate();");+ });++ it('paints the scene background for dark/light modes and clears alpha for transparent', () => {+ expect(elementSrc).toContain("v.renderer?.setClearAlpha?.(0)");+ expect(elementSrc).toContain("v.scene.background.set('#0b0d10')");+ expect(elementSrc).toContain("v.scene.background.set('#f5f5f5')");+ });++ it('hides the name-plate via CSS host selector, not JS visibility juggling', () => {+ expect(elementSrc).toContain(':host([name-plate="off"]) .name-plate { display: none; }');+ });++ it('renders a name-plate element in the shadow DOM during _renderShell', () => {+ expect(elementSrc).toContain("namePlate.className = 'name-plate'");+ });});describe('agent-embed.html — consolidated embed page', () => {diff --git a/vite.config.js b/vite.config.jsindex 744905018..53803e6ff 100644--- a/vite.config.js+++ b/vite.config.js@@ -26,7 +26,6 @@ const appConfig = {input: {main: resolve(__dirname, 'index.html'),app: resolve(__dirname, 'app.html'),- features: resolve(__dirname, 'features.html'),home: resolve(__dirname, 'home.html'),embed: resolve(__dirname, 'embed.html'),create: resolve(__dirname, 'create.html'),@@ -55,7 +54,6 @@ const appConfig = {'/deploy': resolve(root, 'app.html'),'/agents': resolve(root, 'public/agents/index.html'),'/agents/': resolve(root, 'public/agents/index.html'),- '/features': resolve(root, 'features.html'),'/create': resolve(root, 'create.html'),'/dashboard': resolve(root, 'public/dashboard/index.html'),'/studio': resolve(root, 'public/studio/index.html'),