# ViBo Proxy — Privacy Layer for LLM

**© 2026 ViBo by Viacheslav Bochkarev** · https://wwwvibo.com · hello@wwwvibo.com

Use when the user wants to protect secrets (API keys, passwords, tokens) before sending prompts to an LLM provider. ViBo Proxy encrypts secrets (**AES-256-GCM**) and replaces them with `🔒[name]` placeholders, so the upstream LLM never sees them.

## How it works

1. The user registers a secret **once**: `POST /secrets {name, value}` → stored encrypted (ciphertext only, never plaintext).
2. The agent routes LLM calls through the proxy: set `base_url` to the proxy endpoint.
3. The proxy masks known secrets (`🔒[name]`) before forwarding, plus a regex fallback for unknown secrets (`sk-…`, `ghp_…`, `password=…`).
4. Encrypted audit: how many secrets were blocked, which names (names encrypted too).

## Commands (agent)

```bash
# Register a secret (encrypts AES-256-GCM, stores ciphertext only).
# NOTE: this is a LOCAL endpoint on your machine (self-hosted) — nothing leaves the server.
curl -X POST http://localhost:8017/secrets \
  -H "Content-Type: application/json" \
  -d '{"name":"api_key","value":"sk-..."}'

# List secret names (values are never returned)
curl http://localhost:8017/secrets

# Send a prompt through the proxy (base_url = http://localhost:8017/v1)
curl -X POST http://localhost:8017/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-chat","messages":[{"role":"user","content":"..."}]}'
```

The response carries `vibo.secrets_blocked` — show it to the user: **"🔒 ViBo: 1 secret blocked, 4 tokens not sent to the LLM."**

## Privacy & honest limits

- **What is protected:** secrets are encrypted at rest and never reach the LLM (only `🔒[name]` placeholders).
- **What is NOT protected:** the rest of the prompt is sent to the upstream LLM as-is (the LLM must read it to answer).
- **Where the key lives:** by default the encryption key is on the proxy server (self-hosted = under your control). For zero-knowledge (key on the client), use the client-side variant.
- **Deletion:** `DELETE /secrets/{name}` removes a secret; secrets persist until deleted.

## Self-hosting (one command)

```bash
UPSTREAM_API_KEY=sk-... bash setup.sh   # builds + runs on http://localhost:8017
```

Then point your agent's `base_url` to `http://localhost:8017/v1` (or the hosted endpoint `https://wwwvibo.com/v1`).
