--- title: Security Kernel description: Enforce server-side redaction, propose-only AI agent sandboxes, mutation budgets, revision-pinned approvals, and WORM audit chains from one policy. --- `@plate-business/security-kernel` installs a copy-owned server security policy kernel into `src/server/plate-security/security-kernel/`. You instantiate one `createPlateSecurity(policy)` kernel and wire it into your `SyncServer`, server-side AI agents, document exports, and governance routes so every entry point obeys the same rules. ## What it enforces - **Wire-level read redaction, field ACLs, and aggregate oracle guards:** Strips restricted blocks, heading sections, named document tabs, synced components, comments, backlinks, ink passages and rounds, and record fields before bytes leave the server, and enforces contributor-level `k`-anonymity, `(1, k)`/`p%` dominance, and 2D complementary pivot suppression on aggregate-only chart and pivot queries (`evaluateSecureAggregateQuery`). - **Propose-only AI agent sandboxes:** Confines agent grants to `access: 'suggest'` and `decide: false`, restricts server tools and media URLs to explicit allowlists, supports token revocation, and scrubs sensitive fields from agent traces. - **Mutation budgets and pre-parse frame limits:** Caps ops per commit, change bytes, deleted character ratio, touched blocks, per-actor and room-wide commit rates, and raw WebSocket frame sizes before JSON parsing. - **Revision-pinned approvals and signed receipts:** Mints and verifies single-use Ed25519 or HMAC-SHA256 tokens for approvals, change-request comparisons, voting quorums, template signing packets, ink-loop review execution gates (`policy.inkLoop` with `pir1.` receipts), and Git/MDX sync gates. - **Tamper-evident WORM audit chains:** Seals admitted commits, refusals, governance sign-offs, and exports into SHA-256 hash chains backed by PostgreSQL or Cloudflare D1, with crash recovery and compaction vetoes before archival. - **Honest wire-redaction scope:** `SyncServerOptions.projectRead` isolates `access: 'read'` WebSocket peers, `server.getDocument`, server-side `createSyncServerAgent`, and document exports. Live `access: 'suggest'` peers sharing one canonical room receive canonical room state, so isolate counterparties with `kernel.createSubRoomConfig(...)` whenever they need isolated live co-editing. ## Quickstart ```ts import { createSyncServer } from 'platejs/sync/server'; import { createPlateSecurity, createPostgresWormAuditStore, } from '@/server/plate-security/security-kernel'; export const kernel = createPlateSecurity({ agent: { proposeOnly: true }, audit: { storage, store: createPostgresWormAuditStore(query) }, budgets: { maxChangeBytes: 65_536, maxOpsPerCommit: 100 }, policyVersion: '2026-01', redaction: { canReadBlock: ({ block, grant }) => block.visibility !== 'internal' || grant.meta?.internal === true, }, }); export const syncServer = createSyncServer({ ...kernel.syncServerHooks(), storage }); ``` ## Private reference included Running `npx @platejs/cli sync @plate-business/security-kernel` also copies `src/server/plate-security/security-kernel/README.md` into your repository. That private manual documents every `PlateSecurityPolicy` option, PostgreSQL and Cloudflare D1 WORM storage adapters, sub-room and frame-limiter wiring, and `plate-security-hardening` skill notes. ## Related - [Plate Business](/docs/business) - [Compliance PDF](/docs/business/compliance-pdf) - [Security Proof](/docs/business/security-proof) - [Plate Verify CI](/docs/business/verify) - [Pro Installation](/docs/pro/installation) - [Pricing](/pricing)