Skip to main content

ContextWall SDK - drop-in wrapper for Anthropic and OpenAI with context firewall enforcement

Project description

contextwall-sdk

Drop-in wrapper for Anthropic and OpenAI that routes calls through a local ContextWall daemon, enforcing your context firewall policy with no other code changes.

Install

pip install 'contextwall-sdk[anthropic]'
pip install 'contextwall-sdk[openai]'
pip install 'contextwall-sdk[all]'

Usage

from contextwall_sdk import SafeAnthropic

client = SafeAnthropic(api_key="sk-ant-...", ctxfw_url="http://localhost:8080")
# use exactly like the standard Anthropic client
from contextwall_sdk import SafeOpenAI

client = SafeOpenAI(api_key="sk-...", ctxfw_url="http://localhost:8080")

Blocked requests raise contextwall_sdk.ContextWallBlockedError with the policy violation detail.

Daemon setup

The SDK requires a running ContextWall daemon. See the quickstart or the GitHub repo.

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

contextwall_sdk-0.1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contextwall_sdk-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file contextwall_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: contextwall_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for contextwall_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f3fbdb125f871ef228fb77653845ac599d9ff689664ab1c2b77062f5b80f95df
MD5 e586aff63be746f3daefb2ac0226a3d7
BLAKE2b-256 c9b4c764bde5dafd39384362f15e9ff00716262493cfb7cadec011121979312c

See more details on using hashes here.

File details

Details for the file contextwall_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for contextwall_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9af6e2897afb4ba2f0fb611235dd437ad366f309dc774b3d1010df6d36c9e25
MD5 995ecbc61d9c70d2e5deaab66e90d767
BLAKE2b-256 d6b651e29e7eafa12508c0f4ae5a4ba69c99dd6e0b544efbe25c977989cdcf41

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