Metadata-Version: 2.4
Name: bollard-ai
Version: 0.4.0
Summary: See, then govern, your AI agents — watch which apps they use, and enforce what they're allowed to do.
Author: Bollard AI
License: Proprietary
Project-URL: Homepage, https://bollardai.com
Keywords: bollard,ai agents,governance,observability,security
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# bollard

The one line that lets Bollard **see, then govern** your AI agents.

Add it where your agents start up. By default it's **watch-only** — it notes which
apps your agents use (Notion, Slack, Gmail, Xero, Drive, paid AI models), never what
they read or write, and reports it to Bollard. When you protect an app in Bollard, the
same install starts routing *that app's* calls through Bollard so each agent can only
do what you allow — no code change. Every other app stays watch-only.

Three promises, enforced in code:

- **It can't break your agents.** Watch-only observes and, if anything goes wrong,
  falls straight through to the real call. Enforcement is opt-in, per app, reversible.
- **It can't slow them down.** It reports in the background on its own thread.
- **It never sees your data or code.** It reads only the *envelope* of each call — the
  destination and operation name. There is no code path that reads a request or
  response body (see `bollard/_apps.py`).

## Install

```bash
pip install bollard-ai
```

## Use it — two steps, no code change

Install the package where your agents run, and set one environment variable there.
Bollard starts itself the next time an agent runs — **no code change**, and it works the
same on a laptop, in a Modal container, on AWS Lambda, or anywhere else:

```bash
pip install bollard-ai            # or add "bollard-ai" to your image / requirements.txt
export BOLLARD_KEY=BWATCH-XXXX-XXXX-XXXX   # locally; or set it as a secret in your deployment
```

That's it — the environment variable is the one thing every runtime supports identically.

### Prefer a line of code?

Instead of the env var, call `start()` where your agent starts up:

```python
import bollard
bollard.start(key="BWATCH-XXXX-XXXX-XXXX")
```

### Older: wrap a local command

For a process you launch yourself, you can also wrap it (does not apply to cloud/serverless
deployments, where the package must be installed *inside* the deployed agent):

```bash
bollard watch --key BWATCH-XXXX-XXXX-XXXX -- python your_agents.py
```

## Enforcement (opt-in)

Watching needs only your workspace key. To let Bollard *enforce* an agent (once you've
protected an app in the dashboard), give that agent its own identity:

```python
bollard.start(key="BWATCH-...", agent="sales-follow-up", agent_token="boll_agt_...")
```

With an `agent_token`, calls to any **protected** app are routed through Bollard, which
allows or blocks them against that agent's permissions. Apps you haven't protected stay
watch-only. No `agent_token` → always watch-only. If Bollard can't be reached to confirm
the policy, the agent stays watch-only — it never starts blocking off an unconfirmed rule.

## Configuration

`start()` reads these when the arguments are omitted:

| Variable | Meaning |
|---|---|
| `BOLLARD_KEY` | your workspace key (`BWATCH-...`) |
| `BOLLARD_AGENT` | optional name for this agent |
| `BOLLARD_AGENT_TOKEN` | this agent's identity (`boll_agt_...`), for enforcement |
| `BOLLARD_ENDPOINT` | override Bollard's base address (self-hosting / testing) |
