Security Core

Environment Security Shield (XESS / libXESS)

XyPriss features a military-grade Environment Security Shield (XESS) powered by a Go-native libXESS engine designed to eliminate secret leakage, honeypot unauthorized filesystem reads, and enforce Zero-Trust process confinement.

Version Compatibility: XyPriss v9.13.6+
•
Status: Hardened Zero-Trust Sandbox (libXESS Active)
Zero-Leak Protection

Security Shield & Honeypot Interception

Access Attemptprocess.env or fs.read
libXESS Core
Honeypot / MaskingDecoys or Undefined
Process SandboxSecrets Secured
Prevention

Blocks third-party packages from harvesting database credentials or private keys.

Canary Decoys

Injects deceptive fake values into unauthorized filesystem reads.

The libXESS Engine Core

Built as a low-level Go core embedded directly into the XHSC network engine, libXESS operates ahead of runtime bootstrap:

Go-Native libXESS Core

Operates directly inside the native XHSC engine prior to runtime initialization, placing process memory and environment state inside a cryptographically verified boundary.

Active Honeypot Canaries

If rogue dependencies or automated scanners attempt direct filesystem reads on configuration files (fs.readFileSync('.env')), libXESS intercepts reads and serves dynamically generated decoys instead of actual secrets.

Deterministic Subproject Scoping

In monorepos or multi-service setups, libXESS enforces strict boundaries between plugins and parent projects, preventing cross-tenant secret leakage.

Native Dual-Interlock Enforcement

Both the xfpm supervisor and native XHSC network core actively verify active libXESS confinement; unshielded processes are blocked before binding ports.

Comparison: Traditional Backends vs. XyPriss (libXESS)

Consider a scenario where an untrusted third-party npm package executes unauthorized file reading or variable inspection:

Traditional Node.js / Bun Backends

typescript
import fs from "fs";

// 1. Secret harvesting via process.env
console.log(process.env.DATABASE_URL);
// Output: "postgresql://admin:super_secret@db.prod:5432/db"
// Status: CRITICAL LEAK (All secrets globally exposed)

// 2. Direct filesystem read of .env file
console.log(fs.readFileSync(".env", "utf-8"));
// Output: Real plaintext secrets from disk
// Status: CRITICAL LEAK (Disk contents stolen)

XyPriss (Powered by libXESS)

typescript
import fs from "fs";

// 1. Secret harvesting attempt via process.env
console.log(process.env.DATABASE_URL);
// Output: undefined (ACCESS BLOCKED)

// 2. Direct filesystem read attempt on .env
console.log(fs.readFileSync(".env", "utf-8"));
// Output: DATABASE_URL="xy_decoy_database_url_5c940b28"
// Status: HONEYPOT ENGAGED (Deceptive decoy values)

// 3. Authorized application code via official API
console.log(__sys__.__env__.get("DATABASE_URL"));
// Output: "postgresql://admin:super_secret@db.prod:5432/db"
// Status: SECURE (Authentic credentials in memory)

Architectural Principles

1. Mandatory Supervised Execution via XFPM

All XyPriss applications must be launched through the official XFPM CLI (xfpm dev, xfpm run, xfpm start), which initializes libXESS. Direct unconfined execution (node index.js or bun index.js) is blocked by design.

2. Variable Masking & Access Control

By default, global process.env is shielded. System variables essential for OS stability pass through, while business secrets return undefined and unauthorized file reads receive honeypot decoys.

3. Unified Developer API

All application configurations must be retrieved through the native system accessor:

typescript
// Discouraged: returns undefined for shielded variables
const apiKey = process.env.DATABASE_URL;

// Recommended: secure, authenticated access via libXESS
const dbUrl = __sys__.__env__.get("DATABASE_URL");

// Enforces existence (throws if missing or empty)
const secretKey = __sys__.__env__.getStrict("JWT_SECRET");

Standard Whitelisted Variables

The following system variables remain directly accessible via process.env to ensure operating system and runtime interoperability:

VariablePurpose
NODE_ENVActive execution environment mode
PORTConfigured listening port
PATHOperating system binary search path
USERActive operating system user
HOMECurrent user home directory
LANGSystem localization and charset
COLORTERMTerminal color capabilities
XYPRISS_*Official framework runtime parameters

Declarative Configuration ($env)

For third-party dependencies that strictly require access to specific environment variables via process.env, configure explicit exceptions using the declarative $env block in xypriss.config.jsonc.

Extending the Default Whitelist

jsonc
{
  "$env": {
    "whitelist": ["STRIPE_PUBLIC_KEY", "LEGACY_CLIENT_ID"]
  }
}

Strict Whitelist Replacement

For zero-tolerance production deployments requiring complete exclusion of default system variables, set replaceDefaultWhitelist: true:

jsonc
{
  "$env": {
    "whitelist": ["PORT", "CUSTOM_ALLOWED_VAR"],
    "replaceDefaultWhitelist": true
  }
}

Configuration Reference

OptionTypeDefaultDescription
$envObjectundefinedRoot environment security configuration block in xypriss.config.jsonc.
$env.whiteliststring[][]Explicit list of variable keys permitted for direct process.env access.
$env.replaceDefaultWhitelistbooleanfalseWhen true, discards all default system keys and enforces only the custom whitelist.

Best Practices

Adopt __sys__.__env__

Treat process.env as obsolete for application business logic.

Use getStrict() for Critical Secrets

Fail fast during startup if database connection strings, encryption keys, or external tokens are missing.

Avoid Broad Whitelists

Keep $env.whitelist minimal. Only expose keys strictly required by third-party packages.

Always Launch via XFPM

Use xfpm dev locally and xfpm start in production to engage libXESS confinement automatically.

Explore Core Concepts

Return to the core architectural concepts of the XyPriss ecosystem.