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.2.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.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentassert_typec_sdk-0.6.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for agentassert_typec_sdk-0.6.2.tar.gz
Algorithm Hash digest
SHA256 4341cf8eeffef1b0340f0baefdafab2e3aab5f2f6b55099eeb2cbe0daf049aa7
MD5 b8848b2cbb925512f6070edc5d9b6edb
BLAKE2b-256 29c433c32ba13bd9cc61fac2d0bbc4cf33e814376f65f8a11385a23ad19a782e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for agentassert_typec_sdk-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b9c0ad16d3a407fc3f2288932bd3048db66f68f11993b4a7e32747457fa9ed47
MD5 3b84198ecfd97aa4922c65bd3f49ea9b
BLAKE2b-256 a41fe68b86f6c8d359330d5c55751827650b4e6005bea885bc2fe859f76248b1

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