Forseti: Programmable Policy Enforcement

Protocol specification for the Forseti programmable policy engine. Covers the Policy:1 flow, Doken authorization, the 3-stage contract validation lifecycle, sandbox isolation, and gas metering.

30 min read

Overview

This document specifies Forseti, the programmable policy engine of the Tide Cybersecurity Fabric. Forseti governs whether an authority action proceeds. Every threshold operation - decryption, signing, blind delegation, verifiable randomness - passes through Forseti before any ORK contributes its partial MPC computation.
In traditional IAM, authorization policy runs at the application layer: software guards evaluate a JWT before passing the request to a KMS or database. A sufficiently privileged attacker can bypass these guards and invoke the key directly. Forseti eliminates this vulnerability by moving authorization logic inside the cryptographic authority. Each ORK independently loads and executes a deterministic C# contract in a sandboxed environment. If the contract fails, the ORK cannot produce its partial computation. The policy is not a gate in front of the key - it is a precondition of the key's operation.
The protocol defines the Policy:1 authorization flow: policy commitment → Doken issuance → request construction → sandboxed 3-stage validation → threshold MPC output. The relationship to the sibling protocol is: Forseti decides; Hermetic E2EE (and other authority actions) executes. The three validations visible in the decryption flow - ValidateToken_A(V), ValidateSignature_k(T_{1..n}), CheckTags(T_{1..n}, T_{1..x}) - are Forseti operations. This protocol specifies the engine that runs those validations; the sibling protocol specifies what the ORK computes after the engine passes.
Loading diagram...

Preconditions

The Doken (Delegated Authority Token)

The Doken is the authorization instrument that bridges the user's authenticated session to the ORK swarm. Unlike a JWT (which authorizes the user to the application server), the Doken authorizes the SWE directly to the Fabric for cryptographic operations. The Doken and JWT are issued simultaneously during token exchange but travel different paths: the JWT targets to the application server via standard OIDC, while the Doken targets direct ORK communication.
ArtifactDescription
DokenVVK-signed delegated token, issued alongside the JWT during OIDC token exchange
Doken.sessionKey / BBEphemeral session public key (B=GbB = G \cdot b), binding the token to the current SWE session
Doken.rolesRoles and permissions from quorum-approved authorization proofs (Article 5)
Doken.expirySession-scoped time limit
Doken.signatureVVK threshold signature - each ORK can independently verify the Doken was signed by the vendor's ineffable key

The Forseti Contract

ArtifactDescription
Contract sourceC# source code implementing the IAccessPolicy interface
Contract IDSHA512(source code)\textsf{SHA512}(\text{source code}) - deterministic, tamper-evident. A single-character change produces a new ID.
Policy typePUBLIC (ValidateData only), EXPLICIT (+ ValidateApprovers), or PRIVATE (+ ValidateExecutor)
Policy parametersConfiguration values bound via [PolicyParam] attribute (e.g., required roles, resource IDs)

The BaseTideRequest

ArtifactDescription
BaseTideRequestGeneralized DTO: request ID, authorization flow ID ("Policy:1"), challenge data, and metadata
Authorized PayloadThe payload to be processed (e.g., ciphertext to decrypt, message to sign, SSH challenge)
Informational PayloadAdditional informational data in the request not signed by an Approver
PolicySection of the BaseTideRequest DTO reserved for adding a Policy to be executed against an uploaded Forseti Contract

Forseti Contract Lifecycle

Phase 1: Policy Definition and Commitment

Loading diagram...
Contract commitment follows the quorum-enforced governance workflow (Protocol: Authorization Proofing). No single admin can deploy a contract. The deterministic Contract ID (SHA512\textsf{SHA512} of the C# source) ensures all 20 ORKs execute identical logic - if any ORK has a different version, the ID mismatch prevents execution.

Phase 2: Authentication and Doken Issuance

Loading diagram...
This establishes the two-channel architecture: the JWT flows to the application server for standard API authorization; the Doken flows to the SWE for cryptographic agency against the Fabric. The application server never gains authority to command the ORK swarm. A compromised application server can read the JWT (standard OIDC) but cannot forge a Doken (VVK threshold signature required) and cannot intercept or replay a Doken (session key binding prevents use from a different connection).

Phases 3-5: Request, Validation, and MPC Output

Loading diagram...
The SWE dispatches the request directly to all 20 ORKs via POST /Key with the Doken as a bearer token, bypassing the application server entirely.
Phase 4 detail - Outer Gate: Before loading the Forseti contract, each ORK validates the Doken itself (see Algorithm 1). This is a systemic check: is the Doken authentic (VVK-signed), session-bound (connection encrypted with the Doken's session key BB), and hasn't expired? Only if the Outer Gate passes does the ORK instantiate the sandboxed execution environment.
Phase 4 detail - Inner Gate: The ORK loads the contract identified by the Contract ID, instantiates an isolated VmHost process, and executes the 3-stage validation lifecycle (see Algorithm 2). Each Forseti contract is configured along two independent settings that determine which validation stages execute:
SettingValuesEffect
Approval TypeIMPLICIT or EXPLICITEXPLICIT activates Stage 2 (ValidateApprovers): MM-of-NN multi-party authorization for the requested operation
Execution TypePUBLIC or PRIVATEPRIVATE activates Stage 3 (ValidateExecutor): the requester's Doken is evaluated against the specific resource being accessed
Stage 1 (ValidateData) always runs regardless of configuration. The two settings are independent: a policy requiring both multi-party approval and executor role verification sets EXPLICIT + PRIVATE, causing all three stages to execute in sequence. A policy requiring only data validation sets IMPLICIT + PUBLIC.
ConfigurationStages Executed
IMPLICIT / PUBLICValidateData
EXPLICIT / PUBLICValidateData, ValidateApprovers
IMPLICIT / PRIVATEValidateData, ValidateExecutor
EXPLICIT / PRIVATEValidateData, ValidateApprovers, ValidateExecutor
If any stage fails or the contract exhausts its gas budget, the ORK aborts without computing a partial result. See Algorithm 3 for the sandbox security model.
A critical design property: the contract runs before the ORK touches its key shard. The ORK loads aiai into ephemeral memory only after the contract returns a successful PolicyDecision. This means contract code, which is vendor-authored, never has access to the shard. The sandbox separation is both logical (IL vetting blocks dangerous namespaces) and temporal (the shard is not loaded until the contract completes).
Phase 5 detail: If the contract passes, the ORK proceeds to compute its partial MPC result. The specific computation depends on the authority action type - partial proxy-re-encrypted decryption (Protocol: Hermetic E2EE), partial EdDSA signature, partial VRF output, or partial blind signature. The SWE (or a Vendor intermediary for decryption flows) collects 14\geq 14 partial results and Lagrange-interpolates to produce the final output.
Threshold guarantee: If more than 6 ORKs reject (contract failure, Doken invalid, or node offline), the authority action is impossible - insufficient partial results exist for valid interpolation.

The 3-Stage Validation Lifecycle

Loading diagram...
Stage 1 - ValidateData always runs, regardless of policy type. It inspects request parameters, payload integrity, temporal windows, geographic constraints, and protocol-specific rules. Concrete capabilities include: deep-parsing binary payloads to verify protocol conformance, enforcing time-of-day restrictions (e.g., "only during business hours 9am-5pm UTC"), validating IP-based geofencing, and checking transaction volumes against contractual limits. Example (KeyleSSH): the contract uses SshPublicKeyChallenge.TryParse to verify the payload is a legitimate SSH_MSG_USERAUTH_REQUEST (message type 50), checks the service is ssh-connection, and requires the ssh-ed25519 algorithm.
Stage 2 - ValidateApprovers runs for EXPLICIT policies. It enforces M-of-N multi-party authorization: verifies distinct approver Dokens meet the quorum threshold, enforces ForbidSelfApproval (the executor cannot also be an approver), and can enforce RequireDistinctOrgs (approvers from different organizations). Use case: high-value financial transactions requiring "3 of 5 designated signers must approve this wire transfer before the Fabric signs the authorization."
Stage 3 - ValidateExecutor runs for PRIVATE policies. It evaluates the executor's Doken against the specific resource being accessed: role-to-resource matching via [PolicyParam] bindings, expiry checks, and custom business logic. Example (KeyleSSH): the contract maps the SSH username in the challenge payload (e.g., root) to the required Doken role (ssh:root) via [PolicyParam] - if the Doken lacks the matching role, execution aborts.
Each validation stage receives a typed context containing the policy definition, the current user, and stage-specific data. DataContext includes the raw challenge payload (Data), supplementary dynamic data (DynamicData), and a RequestId identifying the flow being validated. ApproversContext includes the list of approver Dokens. ExecutorContext includes the executor's Doken. All three contexts carry the User object, enabling contracts to inspect user attributes alongside policy parameters.
The DecisionBuilder fluent API provides a composition-over-inheritance model for validation logic:
csharp
public PolicyDecision ValidateExecutor(ExecutorContext ctx)
{
    var executor = new DokenDto(ctx.Doken);
    return Decision
        .RequireNotExpired(executor)
        .RequireRole(executor, Res, Role)
        .RequireWeekday()
        .RequireBusinessHours();
}

Case Study: KeyleSSH

KeyleSSH is the reference implementation demonstrating all phases of the Policy:1 flow for threshold signing. The target server's authorized_keys file contains a static public key whose private counterpart is an ineffable key across the ORK swarm. No .pem file exists on any developer laptop, bastion host, or CI/CD pipeline.
When a developer initiates an SSH session to root@production-db, the SSH agent generates a standard cryptographic challenge (SSH_MSG_USERAUTH_REQUEST). The SWE captures this challenge, constructs a BaseTideRequest with Policy:1, attaches the developer's Doken, and submits to the ORK swarm. Each ORK executes the KeyleSSH Forseti contract: ValidateData deep-parses the SSH challenge (message type 50, service ssh-connection, algorithm ssh-ed25519), and ValidateExecutor maps the SSH username (e.g., root) to a required Doken role (e.g., ssh:root) via [PolicyParam] binding. Only if both stages pass do the ORKs produce partial Ed25519 signatures. The SWE interpolates and submits the complete signature to the SSH server.
The architecture includes a blind bastion (tcp-bridge) for WS↔TCP tunneling - the bastion relays traffic without access to session content. The server holds "eternal public keys" corresponding to ineffable private keys; key rotation becomes unnecessary because the private key cannot be stolen. KeyleSSH eliminates an entire class of vulnerabilities - key theft, key sprawl, orphaned keys, stolen bastion credentials - by replacing key possession with policy-governed key action.

Algorithms

Algorithm 1

The Outer Gate is a systemic check that runs before any contract code is loaded. A stolen Doken used from a different device fails step 2 (session binding mismatch).

Algorithm 2

Algorithm 3

Notation Reference

SymbolDescription
BaseTideRequestGeneralized request DTO for all Forseti-governed actions
Policy:1Forseti contract authorization flow identifier
Contract IDSHA512(source code)\textsf{SHA512}(\text{source code}) - deterministic contract identifier
IAccessPolicyC# interface that all Forseti contracts implement
ValidateDataStage 1 - request parameter and payload validation (always runs)
ValidateApproversStage 2 - M-of-N quorum verification (EXPLICIT policies)
ValidateExecutorStage 3 - executor Doken role verification (PRIVATE policies)
DataContextContext object for Stage 1 (request parameters, timestamp, payload)
ApproversContextContext object for Stage 2 (approver Dokens, threshold)
ExecutorContextContext object for Stage 3 (executor Doken, roles)
PolicyDecisionReturn type from each validation stage (pass/fail with reason)
Decision / DecisionBuilderFluent API for composing validation checks
DokenDtoDeserialized Doken data transfer object
[PolicyParam]C# attribute for automatic binding of configuration values
VmHostSandboxed execution environment for contracts
GasComputational cost unit for metered execution
DokenVVK-signed delegated authority token
B=GbB = G \cdot bSession public key embedded in Doken

Actors and Trust Assumptions

ActorDescriptionTrust Assumption
User (Executor)The party requesting the authority action. Holds a valid Doken and session key in the SWE.Identity is Tide-protected (CMK/BYOiD). Bound by Doken role constraints.
Secure Web Enclave (SWE)Browser-side runtime. Constructs BaseTideRequest, attaches Doken, communicates directly with ORKs.Coordinates but cannot forge Dokens or bypass ORK validation.
Client / Relying PartyThe application server. Handles standard OIDC and routes users to the SWE."Dumb terminal" - holds no keys, cannot forge authority.
Admin (Policy Author)Authors Forseti C# contracts. Contracts committed through quorum governance (Article 5).Cannot unilaterally deploy contracts. Contract ID = SHA512(source)\textsf{SHA512}(\text{source}) prevents silent modification.
VVK ORK Swarm20 independent nodes holding key shards. Each independently executes Forseti contracts in sandboxed VmHost environments.Standard threshold trust (13\leq 13 may collude). Independent execution - no "master ORK."

Layer Traversal

LayerHow Forseti Engages It
LegitimacyDoken validation (VVK signature, session binding, role check). Gas metering prevents resource exhaustion. Contract ID verification ensures code integrity.
AuthorityForseti governs whether Authority Layer shards are exercised. The contract is the precondition for shard computation.
AgencyPrimary layer. Forseti IS the Agency Layer's decision mechanism. The 3-stage validation lifecycle determines whether the ORK participates in the threshold operation.
SettlementGas metering provides economic bounding. Contract execution outcomes feed audit trails.

Security Properties

PropertyMechanismAssumption
Policy inside authorityThe contract is a localized precondition of MPC execution. If the contract fails, the partial computation does not execute. There is no separate gate to bypass.-
Independent executionAll 20 ORKs execute the contract independently in isolated sandboxes. A compromised node cannot spoof a successful evaluation for other nodes.Independence of node operators.
Threshold resilience14 of 20 must independently pass. A compromised minority (6\leq 6) cannot override policy. A compromised majority (14\geq 14) is equivalent to compromising the key itself (the threshold assumption throughout the architecture).Honest-majority threshold assumption.
Deterministic Contract IDsSHA512(source code)\textsf{SHA512}(\text{source code}) ensures all ORKs execute identical logic. A modified contract produces a different ID → mismatch → rejected.Collision resistance of SHA-512.
Sandbox isolationVmHost: separate OS-level process, restricted assemblies, blocked namespaces (System.IO, System.Net, System.Reflection), strict CPU/memory limits.Kernel-level process isolation integrity.
IL vettingCompiled IL scanned for forbidden namespace references and non-deterministic calls before the contract enters the execution pool.-
Gas meteringBounded computation per request. Operations carry explicit costs (e.g., Claim() = 5, Log() = 25). Budget exhaustion terminates execution. Prevents infinite loops and resource exhaustion.-
Quorum-governed deploymentContracts deployed through quorum governance (Article 5). No single admin can deploy or modify policy.Threshold of honest administrators.
Session-bound authorizationDoken is session-scoped, device-bound (session key BB), and VVK-signed. A stolen Doken fails session binding verification on the ORK.ECDH security / SWE memory isolation.
Dumb terminal architectureThe application server executes no security policy. Full server compromise grants zero ability to bypass Forseti - policy runs on ORKs.-
Stateless contractsContracts hold no persistent state between invocations. No accumulated state for an attacker to corrupt or leverage.-

Call Summary

CallDirectionPurpose
CommitPolicyAdmin Quorum → VVK SwarmCommit quorum-signed C# contract to the Fabric, registering the deterministic Contract ID.
TokenExchangeTideCloak → VVK SwarmIdentify user with _tide_ roles, request threshold-signed JWT + Doken during OIDC exchange.
POST /KeySWE → all nn ORKsDispatch BaseTideRequest containing payload, Contract ID, and Doken to the swarm.
ValidateData / ValidateApprovers / ValidateExecutorORK local (VmHost)Internal 3-stage Forseti lifecycle evaluating the request against contract constraints.
partialComputett ORKs → SWE / TideCloakReturn partial MPC output (proxy-re-encrypted decryption shard, partial signature, etc.) after successful Forseti evaluation.

References

Related Protocol Articles: