Node.js SDK
Use createRuleOak(), guardTools(), and guardFunction() for functions explicitly routed through RuleOak.
RuleOak
Public preview · v0.10.2
RuleOak places a deterministic authorization boundary immediately before a supported AI-agent or MCP tool action executes. It can allow, deny, require human approval, bind an allow decision to a one-time execution grant, and write redacted tamper-evident evidence.
Try it first
npx @ruleoak/cli@latest demo quickstart
The demo makes no destructive or external calls. It shows the three core outcomes and creates local evidence plus an offline HTML report.
Protect a real boundary
npx @ruleoak/cli@latest protect -- node agent.js
protect initializes a conservative local workspace when needed, recommends a policy pack, runs diagnostics, guards supported routed tool-call traffic, handles approvals and one-time grants, and records evidence. It does not inspect arbitrary internal behavior inside the child process.
Use createRuleOak(), guardTools(), and guardFunction() for functions explicitly routed through RuleOak.
Guard MCP JSON-RPC tools/call over stdio or use the Streamable HTTP gateway for supported requests and SSE responses.
Use terminal, prompt, queue, or approval-provider flows. Persistent choices become reviewable suggestions rather than silently widening policy.
Use hash-chained evidence, signed checkpoints, verifiable bundles, expiring decision receipts, and atomic one-time grant consumption.
Visual guide for developers
Click to enlargeNormalize the action, classify risk, evaluate Policy v2, resolve approval if required, consume the execution grant, then record evidence.
Click to enlargeWrap the supported tool-call boundary. Actions that bypass the SDK, CLI, gateway, or authorization API are outside RuleOak control.
Click to enlargePolicy, approval, receipt/grant handling, evidence, reports, protocol contracts, and guarded transports remain local-first and model-independent.
Public packages · 0.10.2
| Package | License | Purpose |
|---|---|---|
@ruleoak/protocol | MIT | Contracts, JSON Schemas, validators, fixtures, and TypeScript types. |
@ruleoak/core | Apache-2.0 | Authorization runtime, adapters, approvals, receipts/grants, and evidence. |
@ruleoak/cli | Apache-2.0 | Quickstart, process protection, MCP gateways, local API, policy, learning, approval, and audit workflows. |
RuleOak consumer apps
Worldwide radio: Free + restrained visual ads + Lifetime Pro.
Product, privacy and purchase detailsLocal music: Free Basic + restrained Android visual ads + Lifetime Pro + optional supporter purchases.
Product, privacy and purchase detailsSecurity boundary
RuleOak is not an OS sandbox, EDR, anti-malware product, kernel reference monitor, universal MCP compatibility layer, or complete prompt-injection detector. Local evidence is tamper-evident, not tamper-proof against a privileged local actor replacing the store.
From source
git clone https://github.com/ruleoak/ruleoak.git
cd ruleoak
npm ci --ignore-scripts
npm run check:publishRuleOak v0.10.2 is pre-1.0 public-preview software. Security-sensitive behavior and APIs may change between minor versions.