Permissions & Security
AI enforces strict security boundaries across ProcessWire users, outbound provider HTTP calls, editorial field mutations, visitor chat, and external MCP clients.
All 5 RBAC Permissions (UsageGovernance)
Section titled “All 5 RBAC Permissions (UsageGovernance)”| 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. |
1. Credential Encryption (SecretBox)
Section titled “1. Credential Encryption (SecretBox)”- API keys saved in
ai-connectionsare encrypted at rest withSecretBox(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 apwai_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 localollamaloopback hosts. - Re-validates DNS resolution and redirects on the socket layer to prevent DNS rebinding SSRF attacks.
3. Privacy & PII Scrubbing (PiiScrubber)
Section titled “3. Privacy & PII Scrubbing (PiiScrubber)”When Personal Data (PII) Scrubbing is enabled in Routing & Governance:
PiiScrubberdetects 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
privateModelTier(pointing to localollamaor 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 exampleseo.*, -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_logsand pruned automatically byPruneAiUsageLogsTask.