Architecture · All ADRs
ADR 0006 — GebSecure Policy Language (GSL) and the combining algorithm
Architecture decision record — status: Accepted.
Status: Accepted
Decision#
A purpose-built declarative language (grammar documented in packages/policy/src/parser.ts) with clauses for principal, action, resource, environment, when/unless conditions, schedules, spending/transaction limits, risk bands and inline approval requirements. Three effects: permit, forbid, require_approval (a gate). RBAC roles and ReBAC tuples compile into the same form, so one evaluator explains every decision.
Combining algorithm: explicit deny overrides everything at every scope → no applicable permit ⇒ default deny → any triggered gate (or every applicable permit requiring approval) ⇒ APPROVAL_REQUIRED → ALLOW. Risk thresholds can only tighten a decision.
Fail-closed semantics: missing attributes and type errors are evaluation errors, not false. An erroring forbid applies; an erroring permit does not; an erroring approval condition requires approval.
Policies are immutable versions. Only the deployed version is evaluated. Deployment is gated on the policy's tests and on conflict analysis (a new permit that an existing forbid always shadows is rejected; tightening changes never are).
Consequences#
- (+) Human-readable, diffable, testable policy; the AST ⇄ source round trip powers both the code editor and the visual builder.
- (−) A custom language needs its own tooling (validator, formatter, templates) — provided in
@gebsecure/policy.