@baselineos/govern
v1.5.0
Published
Baseline Govern — Enterprise Governance Layer
Readme
@baselineos/govern
The compliance engine for Baseline Protocol. Enforces your organization's rules on every AI operation. The most mature layer package (v1.0.0, 104+ tests). Evaluates policies with rule-based enforcement, performs risk assessment, manages permissions and cost guards, and persists a tamper-evident audit trail. Ships with production compliance templates for Ghana (COCOBOD, FIC AML, AfCFTA).
Primary Exports
| Export | Kind | Description |
|---|---|---|
| BaselineGovernSystem | class | Top-level facade -- policy CRUD, approval workflow, enforcement, audit trail |
| GovernTelemetry | class | Metrics collection and telemetry hooks for subsystems |
| ComplianceCache | class | LRU cache for compliance check results |
| BaselineError / GovernError / ComplianceError | class | Typed error hierarchy with structured error codes |
Compliance Templates
| Template | Description |
|---|---|
| COCOBOD_TEMPLATE | Ghana Cocoa Board grading and quality compliance |
| FIC_AML_TEMPLATE | Financial Intelligence Centre AML/CFT checks |
| AFCFTA_TEMPLATE | African Continental Free Trade Area rules of origin |
Key Types
Policy, PolicyRule, PolicyEvaluation, RiskAssessment, Permission, CostEntry, ComplianceCheck, GovernanceAuditEvent, GovernEvidenceBundle
Usage
import { BaselineGovernSystem } from '@baselineos/govern';
const govern = new BaselineGovernSystem({ persistPath: '.baseline/govern/audit-trail.json' });
// Create, approve, and enforce a policy
const { policy } = await govern.policies.create('Data Residency', 'Block cross-border transfers');
await govern.policies.approve(policy.id, 'compliance-officer');
const result = await govern.policies.enforce(policy.id, { region: 'GH' });
// { success: true, evaluation: { enforcementAction: 'allow' } }Integration
- Depends on:
@baselineos/protocol-core - Consumed by:
@baselineos/cli,baselineos,@baselineos/enterprise
pnpm --filter @baselineos/govern build
pnpm --filter @baselineos/govern test