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

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.7.0.tar.gz (2.7 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.7.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentassert_typec_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for agentassert_typec_sdk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 719d8e7a5ee40a93a3684decf7ec59caecfb9924aebb83d53bce10d1dd378cd2
MD5 b7e401db7ee27d5d60aa1aa0ac4a8b5c
BLAKE2b-256 903cd3c810ed4d42216f720bc5b6852a510a5368bfca5737070f3d5446b95b8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for agentassert_typec_sdk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcfb54e7f31ba6939ec8b89650dbe96b9955be34dcaab3003ea0569c5ec5af12
MD5 039ace673e4cb3ed8e27a55a9623edd9
BLAKE2b-256 17acc19d55c876f6fa61cbbcbab6605f42988721ace3a0d55f26253dc9868924

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.2

2 files

0.6.1

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 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