Skip to main content

AgentAssert Type-C SDK wrapper — wrap(Anthropic(), 'contract.yaml') to enforce behavioral contracts on direct API clients.

Project description

agentassert-typec-sdk

One-line wrap. Your Anthropic/OpenAI clients, contract-enforced.

from anthropic import Anthropic
from agentassert_typec_sdk import wrap

client = wrap(Anthropic(), "contract.yaml")
# client.messages.create(...)  ← now contract-enforced
# Raises ContractBreachError on DENY
# Return type is UNCHANGED — same Anthropic response

Supported Clients

  • anthropic.Anthropic / anthropic.AsyncAnthropic
  • openai.OpenAI / openai.AsyncOpenAI

How It Works

  1. wrap() detects client type by class name
  2. Intercepts messages.create() / chat.completions.create()
  3. Evaluates PreAction before forwarding
  4. Raises ContractBreachError on DENY
  5. Sends PostAction after response for drift/Θ updates

For Unsupported Clients

Use the proxy instead — no code change, just env vars.

pip install agentassert-typec-proxy
export ANTHROPIC_BASE_URL=http://localhost:9000/anthropic

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_sdk-0.6.1.tar.gz (4.0 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_sdk-0.6.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file agentassert_typec_sdk-0.6.1.tar.gz.

File metadata

  • Download URL: agentassert_typec_sdk-0.6.1.tar.gz
  • Upload date:
  • Size: 4.0 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_sdk-0.6.1.tar.gz
Algorithm Hash digest
SHA256 358c0398bd42f70c570476556d37b502e45c26a405f7767f7835b9a1f90f9ad8
MD5 0d2432ba1863ec3519d0eb0414d297bf
BLAKE2b-256 983e28d6fff29a0fb5f3bb828edd966264689440615a3a8a83df12b12da2d1d2

See more details on using hashes here.

File details

Details for the file agentassert_typec_sdk-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: agentassert_typec_sdk-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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_sdk-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b41e71161efd36794e726167b284a36588fd696db0bd5ed76560ee84cb927829
MD5 edf1e335ee69c30cf81a723e71a5a285
BLAKE2b-256 f8a172601c87c7db49c63ae0fffc61408befd78768964b7d5094648f974c040c

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