Skip to content

Security: ttiimmaahh/pi-setup

Security

docs/security.md

Security model

This repo is intended to be safe for a public GitHub repository.

Allowed

  • Pi package/resource settings
  • Keyboard shortcuts
  • Prompt templates
  • Custom skills/extensions/themes that contain no secrets
  • Empty MCP placeholder config (config/mcp.json) unless a server is intentionally public and auth-free
  • Empty model placeholder config (config/models.json) unless a model provider is intentionally public and auth-free
  • Extension preference files that contain only display/configuration options

Not allowed

  • Pi auth files
  • OAuth token directories
  • API keys or bearer tokens
  • Session logs/transcripts
  • Run history
  • Usage databases
  • Trust decisions
  • Memory databases or user/project memories
  • Caches
  • .env files

Before publishing or pushing

Run:

bash security-scan.sh

On Windows PowerShell:

powershell -ExecutionPolicy Bypass -File .\SecurityScan.ps1

The scanner checks tracked files, non-ignored untracked files, and full reachable Git history from all refs. It fails closed in a shallow clone. Ignored local node_modules/ trees are excluded from working-tree content scanning, while any tracked node_modules path remains banned in both the working tree and history.

Path classes rejected by the scanner are Pi auth/OAuth state, sessions and run history, usage state, trust decisions, MCP caches/onboarding state, Hermes/project memory, session databases, tracked dependency trees, and every .env or .env.* file.

Token classes include Anthropic and OpenAI keys; GitHub and GitLab tokens; Google API keys; AWS access-key IDs and assigned secret/session credentials; Hugging Face, npm, and Slack tokens; bearer headers; concrete access/refresh/client-secret assignments; common AI-provider API-key assignments; private-key blocks; and sensitive JSON keys with anything other than an uppercase environment-variable reference.

Also manually review:

git diff --cached
git status --short

The scanner is intentionally conservative. If it fails, either remove the sensitive file/value or change the config to use an environment-variable reference.

Installer mutation safety

All apply entry points use the same Node implementation. It rejects filesystem roots, the home directory itself, and symbolic links at managed destinations. Resources, web-tools dependencies, terminal adapters, and legacy cleanup are prepared in sibling staging directories; the previous directory trees stay active until every preparation and validation step succeeds. Activation uses same-filesystem renames and rolls back already-swapped trees if a later swap fails.

Legacy Hermes cleanup requires a valid Pi settings.json. Generic memory/ and projects-memory/ directories are preserved unless an installed pi-hermes-memory package or a package-specific Hermes remnant verifies ownership.

Authentication on a new machine

Authentication is intentionally out of band. After applying this setup, authenticate with Pi directly:

pi
# /login

Provider/model and MCP configuration are intentionally left empty in this public setup. Add those locally after applying the setup.

There aren't any published security advisories