Skip to main content

AgentAssert Type-C kernel — formal behavioral contracts for AI agent harnesses. Provider-blind, transport-blind runtime enforcement.

Project description

agentassert-typec-core

Formal behavioral contract kernel. Provider-blind, transport-blind.

This is the core engine — zero LLM deps, zero HTTP deps. Every adapter (proxy, SDK, hook) imports this.

Features

  • 7 Process Contract Operators — tool_blocklist, tool_allowlist, must_state, must_precede, context_budget, process_drift, judge_predicate
  • ContractSpec DSL — YAML-based, dsl_version: "0.4" for full Type-C, dsl_version: "0.3" for ABC compatibility
  • JSD Drift Tracker — Welford-style incremental (O(1) per update), frozen baseline at window boundary
  • Θ Reliability Scorer — Θ = 0.35C̄ + 0.25(1-D̄) + 0.20/(1+E) + 0.20S
  • Thread-safe SessionMonitor — RLock-protected, evaluate() never blocks for >10ms
  • Pre-compiled AST — all regex patterns compiled once at SessionStart

Install

pip install agentassert-typec-core

Quickstart

from agentassert_typec_core import SessionMonitor, PreAction, DecisionResult

monitor = SessionMonitor.from_yaml("contract.yaml")
event = PreAction(session_id="s1", contract_id="c1", tool="Read", args={})
result = monitor.evaluate(event)
print(result.decision.name)  # ALLOW or DENY

Optional: OTel

pip install agentassert-typec-core[otel]

License

MIT

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

agentassert_typec_core-0.6.0.tar.gz (45.9 kB view details)

Uploaded Source

Built Distribution

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

agentassert_typec_core-0.6.0-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file agentassert_typec_core-0.6.0.tar.gz.

File metadata

  • Download URL: agentassert_typec_core-0.6.0.tar.gz
  • Upload date:
  • Size: 45.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentassert_typec_core-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f9cb3d9ef0a2e00a4f888e2657073af89b16aac3e0c2cb2ac4a82fb9548b9232
MD5 eb09bd34a49c7eb9609d4677c7a5f4bb
BLAKE2b-256 a0ce8b6a400ca6bc6355bfaa5db02ff2967965ebf4616ecec8ef801172de8341

See more details on using hashes here.

File details

Details for the file agentassert_typec_core-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: agentassert_typec_core-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentassert_typec_core-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c34470a6bedc02b1b80ed1ff502e4e32c8301323bdcb6a8200e9046ebbb708e9
MD5 5a1a10ea85e9a302ad73c7b519d1b4cc
BLAKE2b-256 6bdd2e925fe36cd9c9a8de9305d0ab0769492e0cf6f1c1165de26a3b4615fcf6

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