Skip to main content

Lightweight Security Contract Layer lifecycle artifacts, validation, and cryptographic integrity chain fixtures

Project description

SCLite

CI: pytest Package: sclite-core 0.6.0a0 Python: 3.11+ Contracts: JSON Schema License: MIT

Lightweight Security Contract Layer for auditable AI/security contract lifecycles.

SCLite's canonical lifecycle separates what an agent wants, what policy allows, what was approved, what was executed, and what can be proven. The 0.6 alpha line keeps the 0.5 review-bundle contract stable while adding mechanically checked public truth and a second public-safe local-admin fixture for multi-runtime proof without adding runtime, adapter, PKI, or policy authority.

Status

  • Version: 0.6.0a0
  • Status: 0.6 alpha multi-runtime proof/review substrate
  • Runtime execution: not included
  • Protocol/carrier adapters: not included
  • Integrity: canonical SHA-256 artifact descriptors + ordered hash-linked lifecycle manifest
  • Identity/PKI: not included in core

SCLite's core is a contract/review lifecycle, not an execution engine. Runtimes such as Ravenclaw can consume SCLite artifacts and enforce tickets, but executors, sandboxes, policy engines, raw evidence storage, agent loops, and carrier adapters stay outside this package.

Project sentence

SCLite separates what an agent wants, what policy allows, what was approved, what was executed, and what can be proven.

Version surface map

Surface Role Current status
v0.1 proof trace Legacy public-safe proof fixtures and validation receipts Supported for compatibility
v0.2 lifecycle Canonical intent → policy → contract → ticket → receipt → evidence chain Canonical lifecycle model
v0.3 scoped tickets Runtime-consumable ticket semantics and receipt-bounded evidence checks Available via validate-ticket, explain-ticket, verify-ticket-use
v0.4 references/review records Digest-bound trust/carrier references and lifecycle review records Available via profile validators and review-lifecycle
v0.5 review bundles Packaged lifecycle artifacts plus reviewer Markdown and verification receipt Current stable review surface
v0.6 alpha substrate Public truth gate plus GovEngine and local-admin/Tecrax-style fixtures Current alpha portability surface

What problem does SCLite solve?

AI-assisted security workflows often blur separate authority boundaries:

  1. a model proposes intent;
  2. policy/scope decides whether the request may proceed;
  3. code prepares a concrete execution shape;
  4. an auditor/reviewer approves or rejects that shape;
  5. a runtime executes or dry-runs under bounds;
  6. evidence is summarized for review.

SCLite turns those steps into small schema-backed JSON artifacts and verifies their integrity locally. A reviewer can check the public-safe bundle without running live targets or reading private logs.

The canonical lifecycle keeps each authority boundary visible:

flowchart LR
    A[intent_contract] --> B[policy_decision]
    B --> C[execution_contract]
    C --> D[execution_ticket]
    D --> E[execution_receipt]
    E --> F[evidence_contract]
    F --> G[artifact_chain_manifest]

v0.2 canonical lifecycle

intent_contract -> policy_decision -> execution_contract -> execution_ticket -> execution_receipt -> evidence_contract -> artifact_chain_manifest

Current v0.2 artifacts:

Artifact Purpose
IntentContract Captures what an agent/caller wants before authority exists.
PolicyDecision v0.2 Captures allow/deny/review policy outcome bound to intent.
ExecutionContract Captures the exact bounded execution shape prepared for review.
ExecutionTicket Captures approval for one exact execution contract under explicit bounds and validity.
ExecutionReceipt v0.2 Captures what an external runtime reports as executed or dry-run.
EvidenceContract Captures public-safe claims, non-claims, replay, verification, and evidence links.
ArtifactChainManifest Ordered tamper-evident hash chain over lifecycle artifacts.

Verify the lifecycle fixture:

sclite validate-chain sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
sclite verify-lifecycle sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json

verify-lifecycle uses the same underlying verifier as validate-chain; the command name exists because it describes the v0.2 review action more clearly.

What the verifier checks

The v0.2 verifier checks more than raw hashes:

  • manifest paths cannot escape the artifact root;
  • artifact descriptors match canonical SHA-256 digests;
  • hash-chain links and root digest recompute correctly;
  • lifecycle artifacts appear in the canonical order;
  • policy binds the correct intent digest;
  • ticket binds the correct execution contract digest;
  • receipt binds the correct execution ticket and execution contract digests;
  • evidence contract binds the correct receipt and execution ticket digests.

JSON Schema validation modes

SCLite has two validation modes:

Mode Dependency Intended use Boundary
dependency-free subset validator none fast/offline local checks and minimal installs only supports the keyword subset SCLite implements directly
strict Draft 2020-12 validator optional jsonschema extra CI, release gates, and reviewer validation uses jsonschema.Draft202012Validator

The default CLI path preserves the zero-runtime-dependency package. Release and CI validation must also run strict mode through scripts/strict_schema_gate.sh. See SCLite Validation for the supported keyword table and strict-mode commands.

What SCLite is

SCLite core is limited to:

define / validate / hash / bind / redact / verify / review

The published 0.5.x review-bundle surface packages lifecycle artifacts, review records, and verification receipts for local public-safe review. The scoped-ticket surface still bounds what a runtime may consume, and verify-ticket-use checks that public-safe evidence stays inside the linked receipt. See ROADMAP.md.

It provides:

  • JSON schemas for lifecycle and compatibility artifacts;
  • deterministic artifact hashing helpers;
  • v0.2 lifecycle/chain verification;
  • scoped-ticket review helpers (validate-ticket, explain-ticket);
  • ticket-use / receipt-bounded-evidence checks (verify-ticket-use);
  • digest-bound trust/carrier profile reference checks (validate-trust-profile, validate-carrier-profile);
  • lifecycle review records and Scope Fidelity v0.2 checks (review-lifecycle);
  • canonical review-bundle validation and Markdown export (review, export-review-bundle);
  • redaction/public-snapshot helper artifacts;
  • a CLI for local validation and review fixtures;
  • legacy v0.1 compatibility fixtures and schemas.

The package stays centered on local validation, review, profile references, and integrity checks:

flowchart TB
    CLI[CLI] --> Validation[validation]
    CLI --> ReviewBundles[review bundles]
    CLI --> Profiles[profiles]
    Validation --> Schemas[schemas]
    Validation --> Artifacts[artifacts]
    Artifacts --> Integrity[integrity chain]
    Artifacts --> Tickets[tickets]
    ReviewBundles --> Integrity
    ReviewBundles --> ScopeFidelity[scope fidelity]
    ReviewBundles --> Profiles
    Profiles --> Integrity

What SCLite is not

SCLite is not:

  • a security scanner;
  • an executor;
  • a sandbox;
  • a full policy engine;
  • an approval authority by itself;
  • an agent loop;
  • a tool wrapper package for nmap, ffuf, etc.;
  • an MCP/OpenClaw/A2A protocol replacement;
  • a proof of legal authorization;
  • a proof of live vulnerability evidence;
  • a proof of signer identity or PKI trust;
  • a tamper-proof transparency log.

Execution, authorization, raw evidence storage, and trust decisions belong to the host runtime:

flowchart LR
    Runtime[GovEngine or Ravenclaw runtime] --> Artifacts[SCLite artifacts]
    Artifacts --> SCLite[SCLite validate hash bind review]
    SCLite --> Record[review record or receipt]
    Record --> Runtime

    Runtime --> Execute[execute tools]
    Runtime --> Authorize[decide authorization]
    Runtime --> Evidence[store raw evidence]
    Runtime --> Trust[verify PKI or signer trust]

    SCLite -. does not .-> Execute
    SCLite -. does not .-> Authorize
    SCLite -. does not .-> Evidence
    SCLite -. does not .-> Trust

Legacy v0.1 compatibility

The older public-safe v0.1 proof trace remains supported:

scope/input -> policy decision -> prepared execution spec -> approved execution spec -> dry-run execution receipt -> evidence summary

v0.1 compatibility artifacts remain available for existing integrations, including Ravenclaw public proof fixtures. New lifecycle work should use the v0.2 model.

See SPEC.md for the canonical model, artifact definitions, integrity chain, compatibility notes, and explicit security boundaries.

Project docs

Installation

Install the current public alpha package from PyPI with an exact version pin:

python -m pip install sclite-core==0.6.0a0

Install directly from GitHub:

pip install git+https://github.com/rozmiarD/SCLite.git

From a local checkout:

python -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[dev]'

Runtime dependencies are intentionally empty. The dev extra installs pytest for local tests. Python import package remains sclite.

CLI quickstart

Validate the v0.2 lifecycle chain:

sclite validate-chain sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
sclite verify-lifecycle sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json

Validate and explain the v0.3 scoped-ticket fixture:

sclite validate-ticket \
  sclite/examples/scoped-ticket-v0.3/execution_ticket.json \
  --contract sclite/examples/scoped-ticket-v0.3/execution_contract.json
sclite explain-ticket sclite/examples/scoped-ticket-v0.3/execution_ticket.json
sclite verify-ticket-use \
  sclite/examples/scoped-ticket-v0.3/execution_ticket.json \
  --contract sclite/examples/scoped-ticket-v0.3/execution_contract.json \
  --receipt sclite/examples/scoped-ticket-v0.3/execution_receipt.json \
  --evidence-contract sclite/examples/scoped-ticket-v0.3/evidence_contract.json

Validate the legacy public-safe proof fixture:

sclite validate examples/security-contract-proof

Validate one artifact against a schema:

sclite validate-artifact \
  --schema prepared_execution_spec.v0.1 \
  examples/prepared-execution-spec/prepared_execution_spec.json

Use strict Draft 2020-12 validation with the optional jsonschema extra:

pip install 'sclite-core[jsonschema]'
sclite validate-artifact \
  --strict-jsonschema \
  --schema prepared_execution_spec.v0.1 \
  examples/prepared-execution-spec/prepared_execution_spec.json

Hash one artifact with deterministic SCLite canonical JSON + SHA-256:

sclite hash-artifact \
  --schema approved_execution_spec.v0.1 \
  examples/security-contract-proof/approved_execution_spec.json

Generate a Scope Fidelity report from the approved spec fixture:

sclite scope-fidelity \
  --approved-spec examples/security-contract-proof/approved_execution_spec.json \
  --fail-on review

Review and export the v0.5 review-bundle fixture:

sclite review examples/review-bundle --format json
sclite export-review-bundle examples/review-bundle --format markdown

Review bundles package the lifecycle chain into a reviewer-facing record and optional Markdown export:

flowchart LR
    Bundle[review bundle directory] --> Shape[validate shape]
    Shape --> Chain[verify chain]
    Chain --> Lifecycle[lifecycle review]
    Lifecycle --> Record[review_record]
    Record --> Markdown[markdown export]

Review the GovEngine integration-readiness fixture and enforce conservative CI thresholds:

sclite review examples/govengine-integration --format json --fail-on review
sclite validate-trust-profile examples/govengine-integration/trust_profile_ref.json --subject examples/govengine-integration/04_execution_ticket.json
sclite validate-carrier-profile examples/govengine-integration/carrier_profile_ref.json --subject examples/govengine-integration/04_execution_ticket.json

Emit a validation receipt for the proof fixture:

sclite validation-receipt examples/security-contract-proof

Run tests:

python -m pytest -q

Python usage

Verify a v0.2 lifecycle manifest:

from sclite.integrity import verify_artifact_chain_manifest

# Load artifact_chain_manifest.json as a dict and verify it against a local root.
result = verify_artifact_chain_manifest(manifest, root=fixture_dir)
assert result["status"] == "passed"

Review scoped-ticket / receipt-bounded-evidence fixtures:

from sclite.tickets import validate_ticket_semantics, verify_ticket_use

checks = validate_ticket_semantics(ticket, execution_contract)
assert "ticket_scope_matches_execution_contract" in checks

result = verify_ticket_use(ticket, execution_contract, execution_receipt, evidence_contract)
assert "evidence_claims_bounded_by_receipt" in result["checks"]

Review a canonical v0.5 bundle:

from sclite.bundles import review_bundle

record = review_bundle("examples/govengine-integration")
assert record["verdict"] == "pass"

Repository layout

sclite/                         Python package
sclite/schemas/                 Packaged schemas
sclite/examples/contract-lifecycle-v0.2/
sclite/examples/review-bundle/  Packaged v0.5 review-bundle fixture
sclite/examples/govengine-integration/ Packaged downstream integration fixture
examples/review-bundle/         Public v0.5 review-bundle fixture
examples/govengine-integration/ Public GovEngine integration-readiness fixture
examples/security-contract-proof/ Legacy v0.1 public-safe proof fixture
schemas/                        Source schema copies
SPEC.md                         Current public specification
CHANGELOG.md                    Release notes

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sclite_core-0.6.0a0.tar.gz (94.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sclite_core-0.6.0a0-py3-none-any.whl (137.8 kB view details)

Uploaded Python 3

File details

Details for the file sclite_core-0.6.0a0.tar.gz.

File metadata

  • Download URL: sclite_core-0.6.0a0.tar.gz
  • Upload date:
  • Size: 94.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for sclite_core-0.6.0a0.tar.gz
Algorithm Hash digest
SHA256 d4a82b55c0122775543ca640961182a75f7124d48c92bec94e3adcea7d258ae4
MD5 654ae1bbc71f0f7f7a5c95b932581493
BLAKE2b-256 e8476bab8a593d0720baa14a2b6d6dedee221e7c436ca2276f16a8c7dac63eaf

See more details on using hashes here.

File details

Details for the file sclite_core-0.6.0a0-py3-none-any.whl.

File metadata

  • Download URL: sclite_core-0.6.0a0-py3-none-any.whl
  • Upload date:
  • Size: 137.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for sclite_core-0.6.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c47e1c78eb72e1f562f0f4d04db77ea1d668c28f3d01d1ccb948928fd93501a
MD5 3eb6822d5b92f6ecb58552a96253c1cc
BLAKE2b-256 1e02ba8d01d10acde9e434d4b234789a4e3b164e1114d31c9bfde94b5900a375

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page