Skip to main content

Enterprise API Gateway & Sandbox Proxy to protect LLM context windows. Drop-in LangChain tool included.

Project description

context-clutch

The intelligent, self-hosted proxy that sits between your LLM agent and your raw execution environments.

Install

pip install context-clutch

With LangChain support:

pip install context-clutch[langchain]

Quick Start

from context_clutch import ContextClutch

clutch = ContextClutch(endpoint="http://localhost:8000")

# Execute a command safely
result = clutch.execute("cat /var/log/syslog")
# Returns truncated, PII-scrubbed output — full data saved to a drop-file

LangChain Integration

from context_clutch import ContextClutch
from langchain.agents import initialize_agent, AgentType
from langchain.chat_models import ChatAnthropic

clutch = ContextClutch()
tool = clutch.as_langchain_tool()

agent = initialize_agent(
    tools=[tool],
    llm=ChatAnthropic(model="claude-sonnet-4-20250514"),
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
)

agent.run("List all Python files in the project")

How It Works

When your agent executes a massive command, Context Clutch:

  1. Intercepts the stdout/API response
  2. Scrubs PII/PHI using configurable compliance templates (HIPAA, etc.)
  3. Truncates oversized output using smart head/tail heuristics
  4. Saves full data to a drop-file so nothing is lost
  5. Returns a safe, token-efficient summary to the agent

Links

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

context_clutch-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

context_clutch-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file context_clutch-0.1.0.tar.gz.

File metadata

  • Download URL: context_clutch-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for context_clutch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5f0304e81c70cb33483d0892ee2866bb4d3c16d0b461059e1d77b13f828b71cb
MD5 9a6a54cab01aab5f0fdff5e991364eab
BLAKE2b-256 ee7e59413b6dfdfd1c912478177ac328b9dd31486adcab87831e4e93bff8d299

See more details on using hashes here.

File details

Details for the file context_clutch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: context_clutch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for context_clutch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b199b12481e0c573c3f4bdbdb9c3b21f87735d2be030a990609f310c48013e7
MD5 af0586f5724ef46433b71588b18e1530
BLAKE2b-256 cac0db4c6b7c18aa31e3c79787b810da55c9c07f72cb678ec225d0da78d1783c

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