Metadata-Version: 2.4
Name: agentassert-typec-proxy
Version: 0.4.3
Summary: AgentAssert Type-C HTTP forwarding proxy — formal behavioral contracts middleware for any AI agent, any provider.
Project-URL: Homepage, https://agentassert.com/typec
Project-URL: Paper, https://arxiv.org/abs/2602.22302
Project-URL: Repository, https://github.com/qualixar/agentassert-typec
Author: Varun Pratap Bhardwaj
License-Expression: MIT
Keywords: agentassert,ai-agents,behavioral-contracts,middleware,proxy,qualixar,runtime-enforcement,typec
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Requires-Dist: agentassert-typec-core<0.5,>=0.4.2
Requires-Dist: click>=8.1
Requires-Dist: fastapi>=0.115
Requires-Dist: httpx>=0.28
Requires-Dist: orjson>=3.10
Requires-Dist: uvicorn[standard]>=0.34
Provides-Extra: dev
Requires-Dist: httpx>=0.28; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.9; extra == 'dev'
Description-Content-Type: text/markdown

# agentassert-typec-proxy

**HTTP forwarding proxy — formal behavioral contracts middleware with zero code change.**

This is the flagship. Drop it between any agent harness and any LLM API. Set one env var. Done.

## Quickstart

```bash
pip install agentassert-typec-proxy
agentassert-proxy proxy start --contract contract.yaml
```

Then in your agent environment:
```bash
export ANTHROPIC_BASE_URL=http://localhost:9000/anthropic
export OPENAI_BASE_URL=http://localhost:9000/openai
```

## Supported Providers

| Provider | Route Prefix | Env Var |
|---|---|---|
| Anthropic | `/anthropic` | `ANTHROPIC_BASE_URL` |
| OpenAI | `/openai` | `OPENAI_BASE_URL` |
| Gemini | `/gemini` | `GEMINI_BASE_URL` |
| OpenRouter | `/openrouter` | `OPENROUTER_BASE_URL` |

## Endpoints

| Method | Path | Description |
|---|---|---|
| `GET` | `/health` | Health check, returns contract name and Θ |
| `GET` | `/status` | Full status: Θ, JSD, violation count |
| `POST` | `/admin/reload` | Trigger contract hot-reload |

## Performance

- p99 overhead < 30ms (excluding provider RTT)
- All regex patterns pre-compiled at startup
- Hot-reload via SHA256 file polling (500ms interval)
- Fail-safe: invalid contract → keeps old monitor

## License

MIT
