Skip to content

Permissions & Security

AI enforces strict security boundaries across ProcessWire users, outbound provider HTTP calls, editorial field mutations, visitor chat, and external MCP clients.

Permission Scope & Access
ai-admin Full administrative access to Setup -> AI: manage providers, API keys, models, routing, governance caps, rules, brand voices, glossaries, assistants, MCP keys, and audit logs.
ai-use Standard editorial access: run approved assistants in Page Edit, Entry Edit, and Editorial Sandbox; preview and apply grounded field proposals on pages the user can already edit.
ai-translate Grants permission to run single-page and bulk multi-language localization (translate(), localize(), enqueueLocalization(), and ai:translate).
ai-image Grants permission to run vision image analysis (analyzeImage()) and AI image generation (generateImage()) in the Media library and API.
ai-audit Grants permission to run pre-publish editorial quality audits (audit(), ai:audit) and inspect audit findings.
  • API keys saved in ai-connections are encrypted at rest with SecretBox (enc:v1: ciphertext envelope) and masked in admin responses (sk-o••••••••c12b).
  • Environment variable references ($env:OPENAI_API_KEY, $env:GEMINI_API_KEY, etc.) are resolved at runtime without ever storing secrets in the database.
  • MCP access keys (ai-mcp-keys) are generated with a pwai_ prefix and stored as one-way hashes; the plaintext secret is shown once at creation time.

2. Outbound SSRF Protection (EndpointUrlValidator & SsrfSafeCurlHttpClient)

Section titled “2. Outbound SSRF Protection (EndpointUrlValidator & SsrfSafeCurlHttpClient)”

Custom endpoints (openai-compatible, ollama, QdrantVectorStore) are validated by EndpointUrlValidator and executed over SsrfSafeCurlHttpClient:

  • Blocks private/link-local/metadata IP ranges (such as 169.254.169.254) unless explicitly permitted for local ollama loopback hosts.
  • Re-validates DNS resolution and redirects on the socket layer to prevent DNS rebinding SSRF attacks.

When Personal Data (PII) Scrubbing is enabled in Routing & Governance:

  • PiiScrubber detects and redacts emails, phone numbers, credit card numbers, and sensitive personal tokens before prompts leave ProcessWire for external model providers.
  • Combine PII scrubbing with the private ModelTier (pointing to local ollama or a zero-retention provider) for regulated workflows.

4. Field Scopes, Proposal Diffs & Budget Caps

Section titled “4. Field Scopes, Proposal Diffs & Budget Caps”
  • FieldScopeMatcher: Every assistant and rule explicitly whitelists readable and writable fields (for example seo.*, -seo.robots_noindex) so an assistant can never modify locked system fields or publishing flags.
  • ProposalApplier: Editorial edits are generated as reviewable field proposals with before/after diffs and batch rollback support (BulkEditorialService::rollbackBatch()).
  • Usage & Spend Governance: Configure daily token limits, monthly USD spend caps, and per-user rate limits in Routing & Governance; all requests are recorded in ai_usage_logs and pruned automatically by PruneAiUsageLogsTask.

Next steps