Enterprise Governance • Section 13, 14, 15, 19 & 27

Security & Multi-Tenancy Architecture

The WorkAgent OS security model is specified with defense-in-depth principles: untrusted content firewalls, canonical action hashing, identity delegation binding, and strict tenant isolation by design. Everything on this page is a design specification — production implementation and verification evidence have not been published.

Strict Authority Hierarchy

System Policy > Tenant Policy > User Prompt > External Tool Data. Untrusted web or email content can never override tenant policies or inject executable instructions.

Delegated Identity Chain

Every run binds: Tenant → User Identity → Agent Identity → Scoped Tool. Agents never execute as unconstrained tenant-wide service accounts.

Zero Credential Context

Third-party OAuth tokens and database passwords reside inside Vault. Model context receives only opaque tool references—never credentials.

Action Integrity Hashing

Human approval binds to a deterministic canonical JSON SHA-256 action hash. Parameter drift between approval and execution forces immediate denial.

Section 27 Multi-Tenancy Specification

Tenant Isolation Across the Complete Stack

Tenant boundaries are designed to be enforced systematically across every data and execution tier: API Gateway, Auth, Query layers, Storage, Cache, and MCP Connectors.

PostgreSQL Row-Level Security (RLS) bound to session tenant_id
pgvector embeddings tagged with mandatory tenant and department access scopes
Redis cache keys prefixed deterministically as tenant_{id}:user_{id}:key
S3 Object storage organized in strict tenant/{tenant_id}/... directory prefixes
MCP Connectors authenticated with tenant-scoped credentials and separate tokens
Planned automated CI/CD suite for cross-tenant retrieval resistance tests on every commit
policy_engine.abac.jsonSection 13 Rules
{
  "tenant_policies": [
    {
      "rule": "ALLOW read_email",
      "condition": "tenant_match AND mailbox_scope == user"
    },
    {
      "rule": "ALLOW read_project",
      "condition": "project_member == true"
    },
    {
      "rule": "REQUIRE_APPROVAL send_email",
      "risk_tier": "MEDIUM",
      "condition": "recipients.has_external == true"
    },
    {
      "rule": "REQUIRE_APPROVAL create_financial_transaction",
      "risk_tier": "CRITICAL",
      "approval_type": "ELEVATED_APPROVAL"
    },
    {
      "rule": "DENY cross_tenant_access",
      "condition": "ALWAYS"
    }
  ]
}
Section 11 Audit Specification

Tamper-Evident Audit Schema

In the design, every high-impact action, human approval, tool invocation, and read-back verification commits a record into an append-only audit ledger. Events are sequentially chained with cryptographic hashes so that retroactive modification is detectable — tamper-evident, not literally immutable.

audit_event_schema.sql (PostgreSQL Append-Only Ledger)Cryptographic Integrity
CREATE TABLE audit_ledger_events (
    event_id               UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    tenant_id              VARCHAR(64) NOT NULL REFERENCES tenants(id),
    actor_type             VARCHAR(32) NOT NULL, -- 'USER' | 'AGENT' | 'SYSTEM'
    actor_id               VARCHAR(128) NOT NULL,
    user_id                VARCHAR(128) NOT NULL,
    agent_id               VARCHAR(64) NOT NULL,
    action_id              VARCHAR(64) NOT NULL,
    tool_id                VARCHAR(128) NOT NULL,
    canonical_action_hash  CHAR(64) NOT NULL, -- SHA-256 of canonical action JSON
    policy_version         VARCHAR(32) NOT NULL,
    risk_score             SMALLINT NOT NULL,
    approval_id            UUID REFERENCES approvals(id),
    request_id             VARCHAR(64) NOT NULL,
    trace_id               VARCHAR(64) NOT NULL,
    result                 VARCHAR(32) NOT NULL, -- 'SUCCESS' | 'DENIED' | 'FAILED'
    verification_status    VARCHAR(32) NOT NULL, -- 'READ_BACK_MATCHED' | 'DISCREPANCY'
    prev_event_hash        CHAR(64) NOT NULL,    -- Sequential Hash Chaining
    created_at             TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
Negative Architectural Invariants

What AI Models Cannot Do — Intended Design Constraints SPEC

The specification treats foundation models as untrusted reasoning engines and defines the structural constraints below. These are intended design constraints — not guarantees of an implemented, invulnerable system. In particular, the model is forbidden from performing any of these authority changes:

Cannot Grant Itself Permissions

By design, policy evaluation occurs out-of-band in deterministic runtime code. The model must never evaluate or grant its own permissions, approve its own actions, or self-authorize elevated scope.

Cannot Access Raw Credentials

Third-party OAuth tokens, DB passwords, and API keys are intended to live in a dedicated vault. The LLM is designed to receive only opaque tool handles — never raw secrets.

Cannot Bypass Policy Gates or Self-Approve

Any mutation with Risk Score > 50 is specified to halt the execution DAG until a human provides a hash-bound approval. The model cannot approve its own high-risk actions.

Cannot Expand Tool Scope or Act as External Data Authority

The model cannot widen a tool's schema, grant new tool permissions, or treat external content as an authority source. External data may inform, never authorize.

Cannot Alter Audit Trails or Security Policy

The model cannot modify, redact, or suppress audit events, nor change tenant or platform security policy. Audit events are designed to be append-only with sequential hash chaining — tamper-evident.

Cannot Execute Arbitrary Code or Reach Cross-Tenant Data

Agents are restricted to predefined, schema-validated MCP tool interfaces — no shell access. Tenant isolation is designed to be enforced at the PostgreSQL RLS and storage layer, not by the model.

Data Residency & Sovereignty

Data Residency Design ROADMAP

The roadmap targets tenant-designated hosting regions to support GDPR, CCPA, and industry-specific sovereignty mandates, plus isolated multi-tenant and single-tenant VPC deployment options. No region or residency guarantee is deployment-verified today — see the residency matrix in the Trust Center.

EU Region (Roadmap)Candidate regions: Frankfurt (eu-central-1) & Dublin (eu-west-1). Not deployment-verified.
US Region (Roadmap)Candidate regions: N. Virginia (us-east-1) & Oregon (us-west-2). Not deployment-verified.
Trust Boundary Architecture (Zones 1-5)Strict Isolation
[Zone 1] Enterprise SSO / ClientmTLS • OIDC Auth
[Zone 2] Policy & Context KernelDeterministic RLS • ABAC
[Zone 3] Model Inference GatewayStateless API Mode (target; provider terms vary)
[Zone 4] MCP Gateway & VaultSecret Isolation • Schemas
[Zone 5] External Enterprise SaaSRead-Back Verified State
Threat Model — SPEC

Threat Model & Proposed Controls

The threats, controls, detections, and recovery paths below are specification design targets. No control listed here has been verified against a production deployment or third-party penetration assessment.

ThreatSurfaceProposed ControlDetectionRecovery
Prompt injection (direct)User prompt / chat inputAuthority hierarchy (System > Tenant > User); policy evaluation outside model contextPolicy-decision audit events; anomalous tool-plan patternsDeny action; revoke session; forensic audit review
Indirect injection via tool contentEmails, docs, web pages retrieved as contextUntrusted content firewall; external data treated as information, never authorityQuarantine flags on embedded instructions; refusal telemetryDrop tainted context; re-plan without untrusted instructions
Compromised user accountDelegated identity chain (Tenant → User → Agent)Scoped delegation, short-lived sessions, approval gates on high-risk writesImpossible-travel / anomalous run telemetry; approval auditSuspend identity; revoke sessions; replay audit ledger
Compromised agentAgent identity & tool scopePer-agent scoped tools; agents cannot expand scope or self-approveOut-of-scope tool invocation attempts logged to auditSuspend/revoke agent identity; rotate bindings; incident review
Malicious tool / connectorMCP tool gateway & connector registrySchema validation, allowlisted tools, tenant-scoped credentialsSchema violations; unexpected response shapes in tracesDisable connector; rotate credentials; reconcile affected runs
Credential theftOAuth tokens / API keysVault-isolated credentials; zero raw secrets in model contextVault access audit; anomalous connector auth failuresRotate credentials; invalidate tokens; scope review
Replay of approvals or requestsApproval grants & API surfaceHash-bound approvals with expiry; idempotency keys; nonce bindingHash mismatch on recompute; duplicate idempotency key rejectionReject replayed request; audit incident; invalidate grant
Approval tamperingCanonical action payload between approval & executionCanonical JSON SHA-256 action hash bound to approval; recompute before dispatchRecomputed hash mismatch halts executionAbort execution; escalate to approver; audit the divergence
Cross-tenant accessPostgreSQL, vector store, cache, object storeRLS bound to session tenant_id; tenant-scoped namespaces and prefixesPlanned cross-tenant retrieval attack test suite; query auditDeny at storage layer; security incident process; tenant notification
Data exfiltrationTool writes, memory export, logsEgress-scoped tools; sensitivity classification gates; approval for external sendsDLP-style egress audit events; unusual volume telemetryBlock egress path; rotate credentials; forensic trace review
Model provider compromiseExternal LLM inference pathModel-agnostic adapter; minimal-context delivery; no credentials in promptsProvider anomaly notices; output schema deviation monitoringFail over to alternate model/provider; invalidate affected context
Real-Time Policy Governance

The Dynamic Risk Scoring Engine

The specification defines a normalized quantitative score that is evaluated before execution. This is an illustrative scoring model — policies, tenant configuration, and scope checks can still deny low-scoring actions:

RiskScore = Impact × Irreversibility × Externality × Sensitivity × Uncertainty × 100
Adjust Risk Factor Variables
1. Impact (Blast Radius):0.95 / 1.00
0.10 (Single record read)1.00 (Irrevocable financial/system change)
2. Irreversibility (Rollback Barrier):0.90 / 1.00
0.10 (Trivial compensation/undo)1.00 (Completely irreversible side-effect)
3. Externality (Scope Boundary):0.92 / 1.00
0.10 (Local session memory only)1.00 (External world / Partner / Customer)
4. Sensitivity (Data Classification):0.92 / 1.00
0.10 (Public documentation)1.00 (Restricted PII / Financial credentials)
5. Uncertainty (Variance / Execution Ambiguity):0.94 / 1.00
0.10 (Deterministic contract)1.00 (High ambiguity / Open-ended prompt)
Real-Time Formula Evaluation:
0.95 × 0.90 × 0.92 × 0.92 × 0.94 × 100 = 68 / 100
Evaluated Action Tier:
68 / 100
Human Approval Required
Governance Policy Outcome:

Execution paused. Canonical JSON SHA-256 action hash locked until authorized user sign-off.

Action Status: APPROVAL_GATE_PENDING
Audit Stamp: audit_hash_0x7b2f
0 - 20: Auto ExecutionRead / Safe
21 - 50: ABAC / Policy CheckStandard Writes
51 - 80: Human Approval GateHigh-Impact
81 - 100: Deny / Elevated ApprovalCritical Risk