Metadata-Version: 2.5
Name: agentgov-gateway
Version: 0.1.0
Summary: AgentGov FastAPI gateway (vaults ANTHROPIC_API_KEY; enforces from signed policy cache; §12.1)
Author: AgentGov Contributors
License: Apache-2.0
Requires-Python: >=3.12
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: cryptography>=43.0.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: httpx[http2]>=0.27.2
Requires-Dist: prometheus-client>=0.21.0
Requires-Dist: pydantic-settings>=2.5.0
Requires-Dist: pydantic>=2.9.0
Requires-Dist: pynacl>=1.5.0
Requires-Dist: python-json-logger>=2.0.7
Requires-Dist: structlog>=24.4.0
Requires-Dist: supabase>=2.9.0
Requires-Dist: uuid7>=0.1.0
Requires-Dist: uvicorn[standard]>=0.32.0
Provides-Extra: dev
Requires-Dist: httpx[http2]>=0.27.2; extra == 'dev'
Requires-Dist: mypy>=1.11.2; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest>=8.3.0; extra == 'dev'
Requires-Dist: respx>=0.21.1; extra == 'dev'
Requires-Dist: ruff>=0.6.9; extra == 'dev'
Requires-Dist: types-python-dateutil; extra == 'dev'
Description-Content-Type: text/markdown

# agentgov-gateway

The local FastAPI gateway that Claude Code (via `ANTHROPIC_BASE_URL=http://localhost:8000`) talks to.

Runs on each developer's machine. Vaults the upstream credential (X25519 sealed-box decrypted from the signed policy snapshot). Enforces repo-lock + work-item binding + budget middleware chain. Streams SSE verbatim to Claude Code while tee-parsing usage frames for attribution.

Part of the AgentGov project — see [github.com/deepakahu/agentGov](https://github.com/deepakahu/agentGov) for the full monorepo (control tower, CLI, client assets, Supabase migrations, docs).

## Install

```bash
pip install agentgov-gateway
```

## Configure

Requires these env vars — see the project `.env.example` for the full list:

- `CONTROL_TOWER_URL` — where your AgentGov control tower is deployed
- `GATEWAY_SERVICE_TOKEN` — a `gtw_...` token from `agentgov register-device`
- `POLICY_SIGNING_PUBLIC_KEY_B64` — Ed25519 public key (control tower gives you this)
- `DEVICE_KEY_PATH` — path to your X25519 device private key (default: `./.runtime/device_key.priv`)
- `UPSTREAM_MODE` — `oauth_passthrough` (default, personal) or `apikey_vault`

## Run

```bash
uvicorn agentgov_gateway.main:app --host 127.0.0.1 --port 8000
```

Under systemd / launchd for persistent operation.

## License

Apache-2.0
