Skip to content

Security: ossamamehmood/Design-Intelligence

Security

SECURITY.md

Security & Privacy: DESIGN INTELLIGENCE (DI)

DI runs on your machine, renders untrusted-looking content in a real browser, talks to optional AI models, and loads third-party skills. This page covers what protects you in each of those areas and how to use DI safely.

Contents:

Quick checklist

Do Why
Keep keys in .env (gitignored), never in code or briefs DI redacts secrets from outbound text, but the safest secret is one that never leaves
Leave DI_LLM_PROVIDER empty until you want an AI model Keys in the environment do nothing until you opt in
Set a 40+ character DI_API_TOKEN before any non-localhost bind or tunnel DI refuses network binds without one
Stop tunnels when you're done Anyone with the tunnel URL and token can use your DI
Read a third-party skill before di skills approve Approval lets its scripts run (sandboxed)
Replace sample copy, metrics and testimonials before publishing DI generates them as clearly labelled samples

Data separation

  • Never committed: data/private/, data/clients/, .env, *.sqlite, output/ and .cache/ are gitignored.
  • Public knowledge: global and technical knowledge lives in data/public/.
  • Private data: your profile, previous projects, Figma tracker, feedback, preference weights, skill approvals and the model cache live in data/private/.
  • Portable paths: the committed skill registry stores repo skills as @di/… and other skills as ~/…, so it never contains your username or absolute paths.

Credentials and models

  • Where keys come from: .env or the environment (see .env.example). They are never hard-coded.
  • LLM use is opt-in. A key does nothing until DI_LLM_PROVIDER is set. auto only considers keys that exist solely for inference, so GITHUB_TOKEN and HF_TOKEN are never used.
  • Outbound redaction. Before any text goes to a model provider or back to an external agent, DI removes:
    • key and token patterns (Anthropic, OpenAI, GitHub, Figma, AWS, Google, Slack, Hugging Face, private keys, bearer tokens);
    • the values of secret-named environment variables;
    • your home-directory path.
  • Private knowledge:
    • It reaches a model only when the model runs locally, or when you set DI_LLM_SHARE_PRIVATE=1.
    • It's returned to agents only for local callers with DI_EXPOSE_PRIVATE=1.
    • It's never served over HTTP.

Network exposure

  • Binding. di serve binds 127.0.0.1 by default and refuses any other address unless DI_API_TOKEN is set. The token is compared in constant time. Send it as Authorization: Bearer …, or as a /t/<token>/ path prefix for clients that can't send headers.
  • MCP over HTTP. It rejects foreign Origin headers (403) unless they're listed in DI_ALLOWED_ORIGINS, and checks that the protocol, method and name headers match the body. It doesn't mint or trust session IDs.
  • Files. Remote callers can reach only DI's output folder, and paths are resolved through realpath so symlinks can't escape. Local callers may also use the DI folder, a working directory inside your home folder, and DI_ALLOWED_ROOTS.
  • Remote URLs. Audits are limited to localhost unless DI_ALLOW_REMOTE_URLS=1.
  • Requests and served files. Request bodies are capped at 2 MB. Served deliverables carry nosniff and a restrictive CSP.

Skills

Skills are instructions that AI agents follow, so DI treats them as untrusted until proven otherwise.

Trust tiers

Tier Source What DI does
DI packs skills/ in this repository Written for DI, reviewed with the code
Vetted packs external-skills/ (109 skills, listed in catalog.json) Reviewed by hand before inclusion; MIT/Apache only; pinned to an upstream commit; text only
Local library ~/.agents/skills, DI_SKILLS_DIR Security-scanned on indexing; never trusted automatically

Vendoring policy (enforced by tests/skills.test.ts)

  • external-skills/catalog.json and the vendored folders must match exactly. Nothing uncatalogued ships, and nothing catalogued goes missing.
  • Only instructions, references, data and licence/NOTICE files are vendored. No scripts, binaries, fonts or images, and no single file over 500 KB.
  • Every vendored skill has a SOURCE.json with the repo, commit, licence, every excluded path with the reason, and the DI tool that replaces it. For example, Impeccable's launcher downloads and runs a native binary, so it isn't vendored.
  • Updating a pack means downloading it into a fresh folder, reviewing it again (injection phrases, secret access, network and exec instructions), and re-vendoring it.

Scanning and loading

  • Scanning: every indexed skill is scanned for remote shell pipes, Invoke-Expression, dynamic eval and base64-to-shell.
  • Flagged skills: they can't be loaded through the tool or MCP layer. They're never planned, listed as MCP resources or autocompleted. Search results still show them, marked "review", so you know they exist.
  • Provenance on load: loading a vendored skill returns its provenance, so an agent knows what was excluded and what to use instead.

One-line requests (di_do)

  • The intent engine is deterministic and offline. It never executes text from the request; it only chooses which DI tool to call and with which validated arguments.
  • File paths and URLs in a request still go through the normal confinement rules: remote callers can reach only the output folder, and remote URLs need DI_ALLOW_REMOTE_URLS=1.
  • di_do never overwrites your files. Fixes are written to *.fixed.html.

Skill router and precedence

  • Every plan carries a fixed precedence: the user's explicit instructions, then accessibility and legal requirements, then DI's verified design system, then skill guidance. Skills can't override what the user asked for.
  • Only rules from DI and vetted packs are injected into model prompts. Local skills are suggested by name ("unreviewed — load and judge"), so text from an unreviewed skill never enters a prompt automatically.
  • Meta skills (routers, skill tooling) are never planned.

Scripts

  • Scripts run only after a person approves the skill locally with di skills approve <name>. Agents can't approve themselves.
  • Approval pins the list of scripts, so a script added later needs re-approval.
  • Approved scripts run in a fresh temp directory with a minimal environment (no API keys or tokens), a 60 s timeout and capped output.
  • Remote callers can't run scripts unless DI_ALLOW_REMOTE_SKILL_EXEC=1.

MCP surface

Skill prompts (use_skill, design_with_skills), resources (di://skills/<name>) and completions are read-only. They return instructions; they never execute anything.

Rendering and media

  • Browser. Rendering uses your local Chromium-based browser in headless mode with a fresh temporary profile, removed after use, and no extensions.
  • Runtimes. Page runtimes (motion, shaders, 3D) are classic scripts written by DI. The three.js bundle is built locally from the pinned npm package; nothing is fetched from a CDN.
  • MP4 export. It runs entirely in the browser (WebCodecs) and in DI's own muxer. Files are verified by playback; nothing is uploaded.
  • Accessibility as a safety property. Live visuals pause off-screen, in background tabs and on request, and render a still frame under reduced motion.

AI critique patches

Vision-model CSS suggestions are kept only when all of these hold:

  • They target classes that exist on the page.
  • They use allow-listed properties only.
  • They contain no url(), !important, braces or markup.
  • Re-auditing doesn't lower the QA score.

Supply chain

  • Pinned dependencies: @anthropic-ai/sdk, openai, three and esbuild are pinned to exact versions. Model SDKs are loaded lazily, only when you enable a provider.
  • No ffmpeg, Puppeteer or Playwright. The browser engine is a small CDP client in this repo.
  • Vendored third-party skills: they're pinned to commits and contain no executable code (see Skills).

Reporting

This is a private repository. Report vulnerabilities directly to the owner, and don't open public issues for security problems. Include steps to reproduce, the affected version (di doctor prints it) and whether any credentials may have been exposed. If a key may have leaked, rotate it first.

There aren't any published security advisories