Environment variables
Every variable Rule Cascade reads: the rcas command, its installers and npm package, the rule server, and the examples.
Every variable Rule Cascade reads: the rcas command, its installers and npm package, the rule
server, and the examples. The libraries (TypeScript, Python, Java, Go) and the evaluation engines read
only the cache sizes below, which change speed and memory, never a result: what a rule sees comes
only from the request.
| Variable | Used by | Meaning |
|---|---|---|
RCAS_CONFIG | rcas | the project file to use instead of looking for rcas.yaml upwards from the working directory (the same as --config) |
RCAS_RULES_DIR, RCAS_OUT_DIR | rcas | override rules.dir and output.dir of rcas.yaml (defaults rules, build/rules) |
RCAS_NO_NETWORK | rcas doctor | any value: skip the check for a newer release at rulescascade.com/download/latest/VERSION |
RCAS_MCP_TOKEN | rcas mcp --http | when set, every HTTP request must send Authorization: Bearer <token>; never put it on the command line |
RCAS_MCP_MAX_BODY_BYTES | rcas mcp --http | the largest request body, in bytes (default 4194304); larger requests get 413 |
RCAS_MCP_MAX_SSE_SESSIONS | rcas mcp --http | the most open streams of the deprecated HTTP+SSE transport (default 256); more get 503 |
RCAS_MCP_READ_TIMEOUT_SECONDS | rcas mcp --http | the longest a client may take to send a request body (default 30); a slower one gets 408. Streams are not affected |
RCAS_MCP_IDLE_TIMEOUT_SECONDS | rcas mcp --http | close an idle keep-alive connection after this long (default 620, after the 600 s idle timeout of Google Cloud load balancers and the 60 s of AWS); keep it above the idle timeout of whatever is in front |
RCAS_MCP_MAX_FILES | rcas mcp --hosted | the most files one tool call may send (default 256) |
PORT | rcas mcp --http | the port when --http names only a host (set by Cloud Run and similar platforms; default 8765) |
RCAS_PROGRAM_NAME | rcas, Windows installer | rcas or rule-cascade: the name the command calls itself; the Windows rule-cascade.cmd shim sets it |
CODEX_HOME | rcas mcp install, rcas doctor | where Codex keeps config.toml (default ~/.codex) |
HTTPS_PROXY, HTTP_PROXY, NO_PROXY | installers, rcas doctor | proxy for downloads and the version check |
RCAS_VERSION | installers | version to install (default: the latest release) |
RCAS_INSTALL_DIR | installers | where to put rcas (default ~/.local/bin; %LOCALAPPDATA%\Programs\rcas on Windows) |
RCAS_VERIFY | installers | cosign: also verify the Sigstore signatures |
RCAS_DOWNLOAD_BASE | installers | a mirror of the download directory (default https://rulescascade.com/download) |
RCAS_BINARY_PATH | npm package @rules-cascade/cli | run this binary instead of the one from the platform package (development, air-gapped machines) |
RULES_DIR | rule server | directory of the rulesets to serve (default ./rules) |
PORT | rule server, backend examples | listen port (default 8080); the rule server accepts 0 to 65535 |
RULE_SERVER_TOKEN | rule server | bearer token for evaluations, the server manifest and bundles; required |
RULE_SERVER_ALLOW_OPEN | rule server | 1 or true: start without a token and serve every endpoint openly (private networks, development) |
DRAIN_SECONDS | rule server | time between "not ready" and shutdown on SIGTERM, in whole seconds (default 5) |
RULE_SERVER_MAX_BODY_BYTES | rule server | largest accepted request body; a larger one is answered 413 (default 1048576, 1 MiB) |
RULE_SERVER_KEEP_ALIVE_TIMEOUT_MS | rule server | close an idle keep-alive connection after this long (default 65000); keep it above the idle timeout of the load balancer in front, or it answers an occasional 502; at least 1 |
RULE_SERVER_HEADERS_TIMEOUT_MS | rule server | longest time to receive the request headers (default 66000); longer than the keep-alive timeout and no longer than the request timeout |
RULE_SERVER_REQUEST_TIMEOUT_MS | rule server | longest time to receive a whole request, body included (default 120000); 0 for no limit |
RULES_REFRESH, RULES_REFRESH_INTERVAL, RULES_REFRESH_CRON, RULES_REFRESH_TZ | rule server | reload rules manually (SIGHUP), every interval (30s, 5m), or on a cron schedule in a time zone (default UTC); see caching |
RULE_SERVER_WORKERS | rule server | evaluate on this many worker threads; 0 (default) on the event loop |
RULE_EVALUATION_TIMEOUT_MS | rule server | with workers: answer 503 and replace the worker after this long (default 5000) |
RULE_SERVER_CORS_ORIGINS | rule server | comma-separated browser origins (https://app.example.com), or *, allowed to read the ruleset list, client manifests and rule details from another site (default none); see caching |
RULE_SERVER_CORS_MAX_AGE | rule server | seconds a browser may keep a CORS preflight answer (default 600) |
RULE_SERVER_REQUEST_LOG | rule server | on (default) or off: one JSON log line per request; turn it off when the platform in front already logs requests (about 13 % more requests per second in the load test) |
RULE_SERVER_MAX_QUEUE | rule server | with workers: evaluations waiting for a worker beyond this many are answered 503 with Retry-After: 1 (default 256 per worker). The rule server checks every number it reads at start-up: a value that is not a whole number in range, an empty one included, or timeouts that contradict each other, make it exit 1 with a fatal line that names the variable |
RULE_CASCADE_ENGINE | engine-client examples | the command the examples start for the engine protocol (default rule-cascade on PATH, which rcas installs) |
RULE_CASCADE_WASM | engine-client examples | the WebAssembly module (default rcas.wasm) |
RULES_BUNDLE | backend examples | the compiled bundle to load |
RULE_CASCADE_SELECTION_CACHE_SIZE | TypeScript runtime, rule server | how many rule selections (the rules of an entity and an operation) a ruleset keeps per channel (default 256); a whole number, 0 or more, and 0 turns the cache off. Entities and operations no rule names share one entry, so requests cannot fill it. The selectionCacheSize load option wins over it. Any other value, an empty one included, makes loading a ruleset fail, and the rule server exits at start-up, with an error that names the variable but not its value; an engine answers LOAD_FAILED as below |
RULE_CASCADE_PATTERN_CACHE_SIZE | Go, Java, Python and TypeScript runtimes, rule server | how many compiled matches patterns the process keeps (default 2048); a whole number, 0 or more, and 0 turns the cache off. Read once, on first use; the runtime's setter wins over it (Go SetPatternCacheSize; Java Expressions.setPatternCacheSize, then the system property rulecascade.patternCacheSize; Python set_pattern_cache_size; TypeScript setPatternCacheSize). Any other value, or one longer than 19 digits, makes loading refuse every ruleset with an error that names the variable but not its value; an engine answers LOAD_FAILED as below |
RULE_CASCADE_PATH_CACHE_SIZE | Java and TypeScript runtimes, rule server | how many variable paths the process keeps split (default 4096); a whole number, 0 or more, and 0 turns the cache off. Read once; the runtime's setter wins over it (Java Expressions.setPathCacheSize, then the system property rulecascade.pathCacheSize; TypeScript setPathCacheSize). Any other value makes loading a ruleset fail (the rule server exits at start-up; an engine answers LOAD_FAILED as below) with an error that names the variable but not its value |
RULE_CASCADE_MAX_CACHED_PATH_LENGTH | Java and TypeScript runtimes, rule server | the longest variable path, in UTF-16 code units, kept in the path cache (default 256); longer paths are evaluated but never kept, and 0 keeps none. Read once; the runtime's setter wins over it (Java Expressions.setMaxCachedPathLength, then the system property rulecascade.maxCachedPathLength; TypeScript setMaxCachedPathLength). Invalid values are refused as above |
An engine (rcas engine, rule-cascade-node engine, python -m rule_cascade engine, the Java
Main engine and the WebAssembly module) whose cache setting is not valid keeps running. It answers
version, answers a malformed request with BAD_REQUEST as usual, and answers every other request
with LOAD_FAILED and an empty problems list, naming the setting but never its value
(specification section 13). The WebAssembly host run.mjs passes the RULE_CASCADE_* variables on
to the module and no others.