@zanii/walls
v0.1.0
Published
UAE vertical 'wall' presets as enforceable, auditable artifacts - scopes never granted + a policy config + a manifest_hash + a receipted eval. SCA trading ('education only, never buy this'), RERA, TDRA, Legal, Consumer, DIFC/ADGM.
Downloads
15
Readme
@zanii/walls
UAE vertical "wall" presets as enforceable, auditable artifacts. A wall = a scope the
delegation never grants + a policy that denies the risky action + a manifest_hash you
receipt per deploy (so the enforced rulebook is provably unaltered, not just the prose).
Flagship: SCA trading — "education only, NEVER 'buy this'", the most sensitive vertical (investment advice/execution is a licensed activity). Plus RERA (realty), TDRA (messaging), Legal, Consumer/collections, and DIFC/ADGM free-zone data-protection variants (which differ from federal PDPL).
npm install @zanii/walls @zanii/policy @zanii/coreUsage
import { WALLS, wallPolicy, wallManifestHash, checkOutput, buildEvalReceipt } from '@zanii/walls';
import { createPolicyEngine } from '@zanii/policy';
const wall = WALLS['sca-trading'];
// 1. enforce the wall (deny what it forbids):
const engine = createPolicyEngine(wallPolicy(wall));
engine.evaluate({ target: 'trading.execute.order' }).decision; // 'deny'
// 2. anchor the enforced rulebook — receipt this per deploy:
const manifestHash = wallManifestHash(wall);
// 3. catch a crossing at output time + receipt the eval suite:
checkOutput(wall, 'You should buy this now').ok; // false — flagged
await agent.record(buildEvalReceipt(wall, { passed: 23, failed: 0 }));checkOutput is a heuristic (phrase match) — a published, auditable first line; swap in a
classifier for higher assurance. wallManifestHash is order-independent (stable across deploys).
Changelog
- 0.1.0 — initial release:
WALLS(sca-trading, rera, tdra, legal, consumer, difc, adgm),wallPolicy,wallManifestHash,checkOutput,buildEvalReceipt.
License
Apache-2.0.
