SKI Framework v3.2.0
SKI (Sovereign Knowledge Intelligence) is a neuro-symbolic AI compliance monitoring framework. This page covers the technical reference for deployers and integration engineers. Business overview: skiframework.org. Animated walkthrough: how it works.
Quick start
Prerequisites: Python 3.11+, Docker 24+, Git. The demo mode exercises every framework guarantee, including cryptographic signing and the Symbolic Verifier, using a deterministic FakeLLM backend. No GPU required.
Install from PyPI
pip install ski-sdk ski-schemas ski-kg-extractor ski-kg-validator ski-audit-ledger ski-model-deploy
5-minute demo
# 1. Clone
git clone https://github.com/kpifinity/ski-framework.git && cd ski-framework
# 2. Generate secrets, TLS, and a signed demo KG
./scripts/setup.sh
# 3. Start the full stack (FakeLLM, no GPU needed)
cd reference-implementation
docker compose -f docker-compose.demo.yml up -d
# 4. Health check (self-signed demo TLS, hence -k)
curl -k https://localhost:8000/api/health
# → {"status":"ok","kg_loaded":true,"kg_signature_verified":true, ...}
# 5. Submit a measurement and get a verdict (SO2 above its 100 ppm cap → FLAG)
export $(grep ^SKI_API_KEY= .env)
curl -k -X POST https://localhost:8000/api/evaluate \
-H "X-API-Key: $SKI_API_KEY" -H "Content-Type: application/json" \
-d '{"measurement_id":"demo-1","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'",
"subject":"stack-1","measurement":{"so2_ppm":142}}'
SKI_SOVEREIGNTY=advisory. Every structural guarantee (signing, verifier, ledger, envelope schema) is exercised identically to a real model run. A production deployment starts in strict sovereignty mode: see Air-gapped environments.Six packages
SKI ships six PyPI packages, all versioned together with the framework — currently v3.2.0.
| Package | PyPI | Version | Purpose |
|---|---|---|---|
ski-schemas |
pypi ↗ | 3.2.0 | Shared Pydantic models (V3VerdictEnvelope, MeasurementRecord, the KG obligation) and the RFC 8785 canonicalizer. Single source of truth for the wire format, published as JSON Schema and OpenAPI. |
ski-sdk |
pypi ↗ | 3.2.0 | Client library for submitting evaluations, reading verdicts, and querying the audit ledger from downstream services. |
ski-kg-extractor |
pypi ↗ | 3.2.0 | CLI for extracting obligation nodes from regulatory source documents into Knowledge Graph format. |
ski-kg-validator |
pypi ↗ | 3.2.0 | Validates a graph KG against the spec §3 schema: node and edge types, missing citations and scopes, under-tiered obligations. |
ski-audit-ledger |
pypi ↗ | 3.2.0 | Verifies, exports and replays the append-only ledger: hash-chain and evidence checks (ledger v4), sequence gap detection, deterministic replay of each verdict. |
ski-model-deploy |
pypi ↗ | 3.2.0 | Deployment tooling: KG signing (sign) and trust-anchor verification (load-kg), deployment config, health gate. |
How SKI works
SKI is a passive sidecar observer. It receives a measurement record, evaluates it against a sealed Knowledge Graph, and produces a V3VerdictEnvelope. It has no write path to operational systems, by architectural design.
The evaluation path has two independent components that must agree before a verdict counts:
- The LLM examiner, reads the measurement, reasons against the KG, produces natural-language reasoning, and emits formalizable assertions.
- The Symbolic Verifier, a deterministic algorithm that re-checks every assertion mechanically against the measurement record and the cited obligation.
If they agree: CLEAR or FLAG. If they disagree: DISCRETIONARY (human review). See the animated walkthrough for the full visual explanation.
Verdict envelope
Every evaluation produces a V3VerdictEnvelope (spec v3.0 §4.2). Key fields:
verdict # One of five categorical outcomes (see below)
reasoning # LLM natural-language explanation (signed, not ground truth)
kg_citations[] # node_id, role, source_document, source_clause
formalizable_assertions[] # obligation_id, metric, operator, observed, expected, unit, satisfied
verifier_result # status (AGREED/LLM_CONTRADICTION), verifier_observed, verifier_expected
model_provenance # model_weight_hash, kg_version_hash, prompt_template_id, decoder_seed
transcript_ref # ledger sequence pointer for the signed LLM transcript
notes[] # taxonomy guard remapping messages, if any
The full schema lives in ski-schemas (envelope.py ↗). ski_model.v3.envelope re-exports from it for backwards compatibility.
Five verdict types
| Verdict | Meaning | When emitted |
|---|---|---|
FLAG | Confirmed breach | LLM and Verifier agree: assertion failed |
CLEAR | Confirmed compliance | LLM and Verifier agree: all assertions satisfied |
DISCRETIONARY | Ambiguous, human decides | LLM/Verifier disagree; or citations present but no provable assertions |
NULL_UNMAPPED | No applicable rule | No KG node matches the reading, not a compliance decision |
NULL_STALE | Stale rulebook | KG signature invalid or version too old for the request context |
The taxonomy guard (v3.1.0) ensures CLEAR can never be emitted with zero citations and zero assertions. An assertion-less CLEAR is deterministically remapped to NULL_UNMAPPED or DISCRETIONARY and recorded in envelope.notes.
Symbolic verifier
The Symbolic Verifier is a deterministic algorithm, not an LLM, that independently re-checks every formalizable_assertion the LLM produced. It verifies four obligation types (spec §3.3):
must_be_below/must_not_exceedmust_be_above/must_not_be_belowmust_be_one_ofmust_not_be_one_of
If the Verifier disagrees with the LLM on any assertion, or if the LLM's observed value doesn't match the measurement record, the result is LLM_CONTRADICTION and the verdict becomes DISCRETIONARY. A parity test pins both directions: a KG author cannot write a spec-valid obligation that silently verifies nothing.
Audit ledger
The ledger is append-only at the database trigger level, no UPDATE, no DELETE, and the runtime writes as a least-privilege role (INSERT and SELECT only). Every entry contains:
- The signed LLM transcript (ed25519 signature over the request and response hashes)
- The full
V3VerdictEnvelopeJSON - A monotonically increasing sequence number
- A SHA-256 entry hash chained to the previous entry
Since ledger v4 (v3.2.0) each entry's hash also covers the digests of the stored envelope and transcript, so audit-ledger verify detects an edit to a decision's evidence, not only to its verdict. Sequence gaps trigger a Prometheus alert (ski_ledger_sequence_gaps_total). audit-ledger replay re-runs each recorded decision from its signed transcript, checks it against the stored telemetry and the KG, and reports any divergence.
Knowledge graph
The Knowledge Graph is a versioned, signed graph of typed nodes and edges (spec §3): Rules, Obligations, Subjects, Jurisdictions, Definitions, Exemptions, Precedents and Citations. Each Obligation carries an obligation type, metric, threshold, unit and effective dates; edges scope it to jurisdictions and cite its source document and clause.
The KG lifecycle: extract via ski-kg-extractor → human expert review → validate via ski-kg-validator → sign with ski-model-deploy sign (ed25519 over the whole graph) → deploy. The runtime loads a KG only if its signature verifies against an operator-pinned trust anchor (SKI_KG_TRUST_ANCHORS), never the key the KG embeds. Every verdict envelope records the KG version hash. Older flat-format KGs still load; scripts/flat-kg-to-graph.py converts them.
Docker Compose
The reference implementation ships two Compose files:
| File | Purpose | LLM backend |
|---|---|---|
docker-compose.demo.yml | 5-minute demo, no GPU | FakeLLM (deterministic) |
docker-compose.yml | Full stack with Ollama | Ollama (real model) |
cd reference-implementation
docker compose up -d
# Pulls qwen2.5:7b (~4 GB) on first run
docker compose logs -f ski-model
Kubernetes / Helm
The deploy/helm/ski chart enforces the SKI deployment constraints at render time: it fails if you configure multiple replicas (single writer by design), or if the operator Secret, the signed-KG ConfigMap, the KG trust-anchor ConfigMap or the TLS Secret is missing.
# The signed KG, and (separately) the public keys allowed to sign it
kubectl create configmap ski-kg --from-file=kg.json=your-signed-kg.json
kubectl create configmap ski-kg-trust-anchors \
--from-file=kg-trust-anchors.pem=./kg-owner-public.pem
# Operator Secret: api-key, postgres-password, ledger-writer-password
kubectl create secret generic ski-secrets \
--from-literal=api-key="$(openssl rand -hex 32)" \
--from-literal=postgres-password="$(openssl rand -hex 24)" \
--from-literal=ledger-writer-password="$(openssl rand -hex 24)"
# Install (strict sovereignty: pin the model weights)
helm install ski ./deploy/helm/ski \
--set existingSecret=ski-secrets \
--set kg.configMapName=ski-kg \
--set kg.trustAnchors.configMapName=ski-kg-trust-anchors \
--set tls.secretName=ski-tls \
--set skiModel.modelFileSha256=<weights-sha256> \
--set image.tag=3.2.0
# Air-gapped: add this flag to the install above (also drops DNS in the pod network)
--set networkPolicy.airgap=true
Default image: ghcr.io/kpifinity/ski-model, no --set image.repository required for standard deployments. Review values.yaml and the NetworkPolicy before production use.
Air-gapped environments
SKI's sovereignty guarantee is architectural: the full runtime is tested inside --network=none on every CI run. The air-gapped boot rig (conformance/sovereignty/test_air_gapped.py) boots the audit ledger, joins the SKI Model to a loopback-only namespace, replays a signed-KG workload, and verifies hash-chained ledger entries from inside the gap.
Strict sovereignty mode (spec §6). SKI_SOVEREIGNTY=strict is the default. The runtime refuses to start unless five checks pass: a sovereign backend (Ollama or vLLM), a pinned model weight hash (SKI_MODEL_FILE_SHA256), operator KG trust anchors, a ledger inside the deployment, and no evaluation-path destination outside it. While a verdict is evaluated, any network call leaving the deployment is counted in ski_egress_attempts_total and, in strict mode, refused; the runtime then stops evaluating until restarted. GET /api/sovereignty returns a signed attestation of the mode, the check results, and the running model, KG and build. advisory mode only logs unmet checks, for demos and CI.
To run the Level 3 sovereignty suite locally:
SKI_L3_AIRGAP=1 pytest conformance/sovereignty/ -v
LLM backends
| Backend | Env var | Notes |
|---|---|---|
| Ollama | SKI_V3_LLM_BACKEND=ollama | Default. Runs qwen2.5:7b locally via the Ollama API. |
| vLLM | SKI_V3_LLM_BACKEND=vllm | OpenAI-compatible endpoint with guided_json grammar enforcement (token masking, stronger than post-hoc validation). Temperature 0, per-request seed. |
| FakeLLM | SKI_V3_LLM_BACKEND=fake | Deterministic test backend. No model download. Used in demo mode and CI. Not conformant. |
Conformance levels
SKI defines three conformance levels across 156 tests. The full conformance suite runs in CI:
pip install -r requirements-dev.txt
pytest conformance/ -v
# 156 tests: 69 Provenance + 30 Durability + 57 Sovereignty
| Level | Tests | What it gates |
|---|---|---|
| L1: Provenance | 69 | Verdict envelope completeness, KG citation presence, signed transcript, model provenance fields, taxonomy guard, the fail-closed verifier against an adversarial model. |
| L2: Durability | 30 | Ledger append-only enforcement, hash-chain integrity, sequence gap detection, transcript replay, retention policy. |
| L3: Sovereignty | 57 | Zero outbound connections (air-gapped boot rig), KG trust anchors, least-privilege ledger role, ledger-v4 tamper detection, live replay, signed sovereignty attestation, Helm NetworkPolicy enforcement. |
For full compliance details including the EU AI Act crosswalk, see the Compliance page.
SKI Evals
SKI ships its own adversarial evaluation suite and publishes every run. A 50-case human-graded golden dataset evaluates the real production path, not mocks. The suite reports accuracy, FLAG recall/precision, NULL_UNMAPPED recall, assertion correctness, and LLM↔verifier agreement rate.
python -m evals.run --backend ollama
# or with vLLM:
python -m evals.run --backend vllm --endpoint http://your-vllm:8000
Full methodology and published run history: docs/evals.md ↗.
Benchmarks
The benchmark suite isolates framework overhead (scoping, citation validation, symbolic verification, risk-tier policy, ed25519 transcript signing) from LLM inference. Reference numbers on 2 vCPUs:
| Percentile | Latency |
|---|---|
| p50 | 0.10 ms |
| p95 | 0.16 ms |
| p99 | 0.36 ms |
| Throughput | ~8,500 verdicts/s (single worker) |
CI gates every build on p99 ≤ 100 ms (~250× headroom). Full methodology: docs/benchmarks.md ↗.
Observability, /metrics
The runtime exports a Prometheus-compatible /metrics endpoint (intentionally unauthenticated for scrape compatibility). It exposes aggregates only, no payload data, no verdict bodies, no reasoning text, no tenant identifiers.
ski_agreement_rate # LLM ↔ Verifier agreement
ski_kg_signature_verified # KG signature validity (gauge)
ski_ledger_sequence_gaps_total # Ledger tampering alert
ski_verdicts_total{verdict=...} # Per-verdict-type counter
ski_evaluation_duration_seconds # Latency histogram
ski_model_last_telemetry_timestamp # Heartbeat
ski_runtime_info # Version / KG hash info label
ski_egress_attempts_total # Network calls leaving the deployment mid-evaluation (spec §6.3)
ski_unverifiable_total{tier=...} # UNVERIFIABLE verdicts by risk tier
ski_telemetry_clock_skew_total # Readings rejected or downgraded for clock skew
Grafana alert rules ship in monitoring/. A regression test parses the alert rules and asserts every referenced series is exported, the contract cannot silently drift.
Frequently asked questions
Which LLM does SKI use?
SKI is LLM-agnostic. The reference implementation ships with an Ollama backend (any local model via the Ollama API) and a vLLM backend (any OpenAI-compatible inference server). You supply the model — SKI orchestrates it, signs the transcript, and cross-checks the output with the Symbolic Verifier. Switching backends is a one-line config change. Custom backends can be added by implementing the LLMBackend protocol.
Is there a hosted or SaaS version?
No, and there will not be one. Data sovereignty is an architectural property of SKI, not a configurable feature. For that guarantee to be real, your operational data must never leave your infrastructure. SKI is on-premise only.
How large is the deployment footprint?
The reference implementation runs as a single Docker Compose stack. Minimum resource requirements for the SKI framework services (excluding the LLM): approximately 2 vCPUs and 4 GB RAM. The air-gapped boot rig has been validated on a single bare-metal node. LLM resource requirements depend entirely on which model you choose to run.
How long does it take to get a first verdict?
The 5-minute estimate in the quick start is accurate for demo mode, which does not require a model download and exercises every framework guarantee with a stub LLM. A production deployment including model download, KG configuration, and infrastructure setup is measured in hours, not days.
Can SKI connect to my existing SCADA or operational data systems?
SKI accepts readings as JSON payloads over an HTTP API. Any SCADA system, DCS, historian, or event stream that can make an HTTP POST can feed SKI. An OPC-UA read-only sidecar reference implementation is included in the repository under reference-implementation/integrations/opc-ua/.
Can I use SKI's Knowledge Graph for regulations outside the examples?
Yes. The KG schema is general-purpose — it is not locked to any specific regulatory domain. The reference KG covers an energy sector SO2 example; your domain experts translate your specific regulatory obligations into KG nodes, review and approve them, and the resulting graph is sealed and deployed. A full KG authoring and validation workflow is documented in Knowledge graph.
Changelog
Full changelog: CHANGELOG.md ↗. Latest release notes: v3.2.0 ↗.
Security
To report a security issue, see SECURITY.md ↗. Do not open a public issue for security vulnerabilities. Responsible disclosure is the right path, we will acknowledge within 48 hours.