Skip to main content

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

Metadata

Release files for agentassert-typec-sdk 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentassert-typec-sdk 0.7.0
File Size Uploaded
agentassert_typec_sdk-0.7.0.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentassert-typec-sdk 0.7.0
File Interpreter ABI Platform
agentassert_typec_sdk-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 kB

Release files / agentassert_typec_sdk-0.7.0.tar.gz

Download URL agentassert_typec_sdk-0.7.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
719d8e7a5ee40a93a3684decf7ec59caecfb9924aebb83d53bce10d1dd378cd2
BLAKE2b-256 checksum
How to use checksums
903cd3c810ed4d42216f720bc5b6852a510a5368bfca5737070f3d5446b95b8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / agentassert_typec_sdk-0.7.0-py3-none-any.whl

Download URL agentassert_typec_sdk-0.7.0-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcfb54e7f31ba6939ec8b89650dbe96b9955be34dcaab3003ea0569c5ec5af12
BLAKE2b-256 checksum
How to use checksums
17acc19d55c876f6fa61cbbcbab6605f42988721ace3a0d55f26253dc9868924
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page