Skip to main content

Checks-as-code for AI agents: define invariants once, enforce them in replay, simulation, and at runtime.

Project description

spolm-checks

Checks-as-code for AI agents. Define an invariant once — enforce it in replay (CI regression), simulation (certification), and inline at runtime (action gate).

Deterministic first: predicate (CEL — sandboxed, guaranteed-terminating), schema (JSON Schema), and policy (trajectory patterns: never X, X only after Y, X at most N, tool allow/deny lists). No LLM-as-judge in the core engine, by design.

Example check

check:
  id: refund-within-order-total
  version: 1
  severity: block
  scope:
    workflow: refunds-agent
    target: tool_call
    tool: refund
  assert:
    type: predicate
    expr: "args.amount <= context.order.total && args.currency == context.order.currency"
  provenance:
    source: mined
    cluster_id: c_8842
  on_fail:
    runtime: block
    simulation: record_violation
    replay: fail_regression

CLI

spolm-check lint ./checks
spolm-check run ./checks --traces traces.jsonl

run exits non-zero if any block-severity check has violations — wire it straight into CI.

Python

from spolm_checks import load_suite, IRTrace, run_replay

checks = load_suite("./checks")
report = run_replay(checks, traces)   # traces: list[IRTrace]

Apache-2.0.

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

spolm_checks-0.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

spolm_checks-0.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file spolm_checks-0.1.1.tar.gz.

File metadata

  • Download URL: spolm_checks-0.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spolm_checks-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4a2e1ac85a9f1fb3f0f3c45123bd9537a5fc56069900168c4cdba88c0efb8a22
MD5 a812d7b2bd0f4e7517d2c28278639773
BLAKE2b-256 04f78c91accf265220daeb77a29746ecbf15a73f7e376f02c6e464337b00999b

See more details on using hashes here.

File details

Details for the file spolm_checks-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: spolm_checks-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for spolm_checks-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00668e0f78fb1173d7b08d33ad6c8571d0ecda68e5afbbff99529e43a562af55
MD5 43c18e4d9bf6340a3a5863161a69a1b5
BLAKE2b-256 0c9b95470f36f6b5745ed3e343ef5dd257022a1c94379602d8318ca076caac3d

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