Skip to content

Commit 81ce830

Browse files
authored
docs: add Docker quick-start, demo2 section, fix stale env var names (#21)
docs: Docker quick-start, demo2 section, fix stale AACTL_ env var names. Closes #5, Refs devonartis/agentwrit#31, Refs devonartis/agentwrit#33
1 parent 89a7e8c commit 81ce830

3 files changed

Lines changed: 55 additions & 20 deletions

File tree

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,27 +173,54 @@ The [`demo/`](demo/) directory contains **MedAssist AI** — an interactive heal
173173
| **Token lifecycle** | Renewal and release shown at end of each encounter |
174174
| **Audit trail** | Dedicated audit tab showing hash-chained broker events |
175175

176-
### Running the demo
176+
### Running with Docker (recommended)
177177

178178
```bash
179-
# 1. Start the AgentWrit broker
180-
docker compose up -d
179+
AGENTWRIT_ADMIN_SECRET="your-secret" \
180+
LLM_API_KEY="your-llm-key" \
181+
docker compose up -d broker medassist
182+
```
183+
184+
Open [http://localhost:5000](http://localhost:5000). The demo auto-registers with the broker on startup — no manual setup needed. You only need an OpenAI-compatible LLM endpoint (set `LLM_BASE_URL` and `LLM_MODEL` if not using OpenAI).
181185

182-
# 2. Register the demo app with the broker (one-time setup)
186+
### Running from source
187+
188+
```bash
189+
# 1. Start the broker
190+
docker compose up -d broker
191+
192+
# 2. Register the demo app (one-time)
183193
export AGENTWRIT_ADMIN_SECRET="your-admin-secret"
184194
uv run python demo/setup.py
185-
# → Prints client_id and client_secret
186195

187196
# 3. Configure demo/.env (copy from demo/.env.example)
188197
cp demo/.env.example demo/.env
189-
# Fill in: broker URL, client_id, client_secret, LLM endpoint
190198

191199
# 4. Run it
192200
uv run uvicorn demo.app:app --reload --port 5000
193-
# Open http://127.0.0.1:5000
194201
```
195202

196-
For architecture diagrams, step-by-step traces, and a live presentation script, see [`demo/BEGINNERS_GUIDE.md`](demo/BEGINNERS_GUIDE.md) and [`demo/PRESENTERS_GUIDE.md`](demo/PRESENTERS_GUIDE.md).
203+
For architecture diagrams and a live presentation script, see [`demo/BEGINNERS_GUIDE.md`](demo/BEGINNERS_GUIDE.md) and [`demo/PRESENTERS_GUIDE.md`](demo/PRESENTERS_GUIDE.md).
204+
205+
## Support Ticket Demo
206+
207+
The [`demo2/`](demo2/) directory contains **AgentWrit Live** — a support ticket pipeline where three LLM-driven agents (triage, knowledge, response) process customer requests under zero-trust scoped credentials.
208+
209+
```bash
210+
AGENTWRIT_ADMIN_SECRET="your-secret" \
211+
LLM_API_KEY="your-llm-key" \
212+
docker compose up -d broker support-tickets
213+
```
214+
215+
Open [http://localhost:5001](http://localhost:5001).
216+
217+
| Capability | How the demo shows it |
218+
|------------|----------------------|
219+
| **Identity-gated pipeline** | Anonymous tickets halt at triage — no customer-scoped agents spawn |
220+
| **Per-customer scope isolation** | Each agent is scoped to the verified customer only |
221+
| **Cross-customer denial** | Asking about another customer's data → scope denied |
222+
| **Tool-level enforcement** | `delete_account` and `send_external_email` blocked by scope |
223+
| **Natural token expiry** | 5-second TTL credential expires on its own |
197224

198225
## Scope Format
199226

docs/sample-app-mini-max.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,21 +385,21 @@ run_pipeline("batch-102")
385385
**What you learn:** Admin auth is not part of the SDK — it uses raw HTTP or `aactl`. The SDK only handles app-level operations. This app does not use `AgentWritApp`.
386386

387387
**Broker ceiling required:** N/A — no agent scopes, no SDK
388-
**What it uses:** `AACTL_ADMIN_SECRET` for admin auth. `GET /v1/audit/events` with an admin Bearer token.
388+
**What it uses:** `AGENTWRIT_ADMIN_SECRET` for admin auth. `GET /v1/audit/events` with an admin Bearer token.
389389

390390
```python
391391
# app5_audit_reader.py
392392
"""
393393
Audit log reader — queries the broker's hash-chained audit trail.
394394
Shows who did what, when, and whether it succeeded.
395395
396-
Requires admin credentials (AACTL_ADMIN_SECRET). The SDK does not handle admin auth.
396+
Requires admin credentials (AGENTWRIT_ADMIN_SECRET). The SDK does not handle admin auth.
397397
"""
398398
import os
399399
import httpx
400400

401401
BROKER_URL = os.environ["AGENTWRIT_BROKER_URL"]
402-
ADMIN_SECRET = os.environ["AACTL_ADMIN_SECRET"]
402+
ADMIN_SECRET = os.environ["AGENTWRIT_ADMIN_SECRET"]
403403

404404
# Step 1: Authenticate as admin (raw HTTP — not part of the SDK)
405405
auth_resp = httpx.post(
@@ -449,7 +449,7 @@ else:
449449

450450
**The real-world pattern this teaches:**
451451
- Operators and compliance teams need to query the audit trail programmatically
452-
- Admin auth uses `AACTL_ADMIN_SECRET` — not part of the SDK, done via raw HTTP or `aactl`
452+
- Admin auth uses `AGENTWRIT_ADMIN_SECRET` — not part of the SDK, done via raw HTTP or `aactl`
453453
- Filtering by event type, agent, and time range lets you find specific incidents
454454
- This is how you build automated compliance reporting
455455

@@ -900,8 +900,8 @@ print(f"\nFinal outcome: {outcome}")
900900
In a second terminal, while the loop is running, revoke the agent:
901901

902902
```bash
903-
export AACTL_BROKER_URL="http://localhost:8080"
904-
export AACTL_ADMIN_SECRET="your-admin-secret"
903+
export AGENTWRIT_BROKER_URL="http://localhost:8080"
904+
export AGENTWRIT_ADMIN_SECRET="your-admin-secret"
905905
aactl revoke --level agent --target "spiffe://agentwrit.local/agent/monitoring-service/continuous-monitor-001/..."
906906
```
907907

docs/sample-apps-broker-setup.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Register the app once. Replace the scopes with what your operator approved.
2222
### Option A: Using aactl (recommended)
2323

2424
```bash
25-
export AACTL_BROKER_URL="http://localhost:8080"
26-
export AACTL_ADMIN_SECRET="your-admin-secret"
25+
export AGENTWRIT_BROKER_URL="http://localhost:8080"
26+
export AGENTWRIT_ADMIN_SECRET="your-admin-secret"
2727

2828
aactl app register \
2929
--name sample-apps \
@@ -112,7 +112,7 @@ The pipeline reads from source partitions and writes to destination partitions.
112112
```
113113
Scope ceiling: N/A — no agent scopes needed
114114
What it uses: Admin auth only (aactl or raw HTTP admin API)
115-
POST /v1/admin/auth with AACTL_ADMIN_SECRET
115+
POST /v1/admin/auth with AGENTWRIT_ADMIN_SECRET
116116
GET /v1/audit/events with admin Bearer token
117117
```
118118

@@ -196,6 +196,14 @@ curl -X POST "http://localhost:8080/v1/admin/apps/sample-apps" \
196196

197197
## Broker Start Command
198198

199+
The recommended way to run the broker is with Docker:
200+
201+
```bash
202+
AGENTWRIT_ADMIN_SECRET="your-admin-secret" docker compose up -d broker
203+
```
204+
205+
If running the broker binary directly, set these environment variables. Note: the broker binary currently uses the `AA_` prefix for its env vars ([rename tracked in devonartis/agentwrit#44](https://github.com/devonartis/agentwrit/issues/44)):
206+
199207
```bash
200208
AA_ADMIN_SECRET="your-admin-secret" \
201209
AA_DB_PATH="/tmp/agentwrit.db" \
@@ -204,8 +212,8 @@ AA_MAX_TTL="600" \
204212
./broker
205213
```
206214

207-
| Flag | Purpose |
208-
|------|---------|
215+
| Variable | Purpose |
216+
|----------|---------|
209217
| `AA_ADMIN_SECRET` | Admin password for operator tasks (app registration, revocation, audit) |
210218
| `AA_DB_PATH` | SQLite database path — audit log and revocation data |
211219
| `AA_DEFAULT_TTL` | Default agent token TTL in seconds (300 = 5 minutes) |
@@ -237,7 +245,7 @@ aactl app list
237245
|--------|-------|-----|
238246
| `401` on app auth | Wrong `client_id` or `client_secret` | Re-register the app and save the credentials |
239247
| `403` on agent creation | Requested scope outside app ceiling | Extend the app ceiling with `aactl app update`, or narrow the requested scope |
240-
| `403` on admin auth | Wrong `AACTL_ADMIN_SECRET` | Restart the broker with the correct secret |
248+
| `403` on admin auth | Wrong `AGENTWRIT_ADMIN_SECRET` | Restart the broker with the correct secret |
241249
| `Connection refused` | Broker not running | `./broker` or `docker compose up` |
242250
| App 5 returns empty events | Admin token expired | Re-run the aactl command or re-authenticate |
243251
| App 9 shows all `PASS` | Ceiling is too wide — all test scopes are allowed | Narrow the ceiling so `admin:revoke:*` and `read:logs:*` are outside it |

0 commit comments

Comments
 (0)