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.AsyncAnthropicopenai.OpenAI/openai.AsyncOpenAI
How It Works
wrap()detects client type by class name- Intercepts
messages.create()/chat.completions.create() - Evaluates PreAction before forwarding
- Raises
ContractBreachErroron DENY - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentassert_typec_sdk-0.4.0.tar.gz.
File metadata
- Download URL: agentassert_typec_sdk-0.4.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cda18e3bd924502b716506e86782b2d076af17b17c66ce321a53d0584801761
|
|
| MD5 |
ebb9c6b34c0b2e07e2d43bc95e126452
|
|
| BLAKE2b-256 |
c0875f595be38acd43f5a45d04a8612171e23e5e07e263e31618eaa8893d5436
|
File details
Details for the file agentassert_typec_sdk-0.4.0-py3-none-any.whl.
File metadata
- Download URL: agentassert_typec_sdk-0.4.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4448611e038268c9df7c73bc06c80b5c89712d7b513536b7da29e2f35f0d7ad
|
|
| MD5 |
75f11ce68d67111b3f45f296af7c0693
|
|
| BLAKE2b-256 |
23185603d029a240c30a12dbbcd9c0791b949fa80e0cdf2bcc6298f7690d563c
|