Skip to content

Commit c7fc324

Browse files
committed
updated user manual
1 parent f504fd4 commit c7fc324

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

docs/predicate-authority-user-manual.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,97 @@ Operational notes:
481481

482482
---
483483

484+
## Sidecar enrollment and fleet sync (control-plane)
485+
486+
Use this flow when you run many sidecars (for example OpenClaw bot fleets) and
487+
want:
488+
489+
- short-lived sidecar identity tokens,
490+
- control-plane fleet visibility,
491+
- low-latency revocation push (SSE) for kill-switch scenarios.
492+
493+
### 1) Configure enrollment keys on control-plane
494+
495+
Set per-tenant enrollment keys and token TTL:
496+
497+
```bash
498+
export SIDECAR_ENROLLMENT_KEYS_JSON='{"tenant-a":"replace-with-strong-enroll-key"}'
499+
export SIDECAR_TOKEN_TTL_SECONDS=3600
500+
```
501+
502+
### 2) Enroll sidecar to get a short-lived token
503+
504+
```bash
505+
curl -s -X POST "http://127.0.0.1:8080/v1/sidecars/enroll" \
506+
-H "Content-Type: application/json" \
507+
-d '{
508+
"tenant_id":"tenant-a",
509+
"sidecar_id":"sidecar-openclaw-01",
510+
"version":"1.0.0",
511+
"api_key":"replace-with-strong-enroll-key"
512+
}' | jq
513+
```
514+
515+
Expected response fields:
516+
517+
- `sidecar_token`: bearer token for sidecar-authenticated sync endpoints,
518+
- `expires_at`: token expiry,
519+
- `sidecar`: sidecar metadata (id/version/last_seen/active).
520+
521+
### 3) Send periodic heartbeat
522+
523+
Heartbeat keeps liveness/version current for fleet operations:
524+
525+
```bash
526+
curl -s -X POST "http://127.0.0.1:8080/v1/sidecars/heartbeat" \
527+
-H "Authorization: Bearer $SIDECAR_TOKEN" \
528+
-H "Content-Type: application/json" \
529+
-d '{"version":"1.0.1"}' | jq
530+
```
531+
532+
Recommended cadence: every 15-30 seconds.
533+
534+
### 4) Sidecar sync pull (long-poll)
535+
536+
Use sidecar token with the sidecar sync endpoint:
537+
538+
```bash
539+
curl -s "http://127.0.0.1:8080/v1/sync/authority-updates/sidecar?tenant_id=tenant-a&wait_timeout_s=15" \
540+
-H "Authorization: Bearer $SIDECAR_TOKEN" | jq
541+
```
542+
543+
This returns policy + revocation snapshot and a `sync_token`.
544+
545+
### 5) Revocation push stream (SSE)
546+
547+
Subscribe for near-real-time revocation events:
548+
549+
```bash
550+
curl -N "http://127.0.0.1:8080/v1/sync/authority-updates/stream?tenant_id=tenant-a&last_event_id=0" \
551+
-H "Authorization: Bearer $SIDECAR_TOKEN"
552+
```
553+
554+
When operators call revocation endpoints (including global kill-switch style
555+
revocations), stream events are pushed with `event: revocation`.
556+
557+
### 6) Fleet visibility endpoint (operator/command center)
558+
559+
```bash
560+
curl -s "http://127.0.0.1:8080/v1/sidecars?tenant_id=tenant-a&active_only=true" \
561+
-H "Authorization: Bearer $TOKEN" | jq
562+
```
563+
564+
Use this to track active sidecar count, versions, and last-seen status.
565+
566+
### Failure handling guidance
567+
568+
- if SSE connection drops, reconnect and pass the last processed `event_id`,
569+
- if sidecar token expires, re-enroll and rotate token in sidecar runtime,
570+
- if control-plane is unreachable, continue local fail-closed guard behavior and
571+
retry sync/stream with backoff.
572+
573+
---
574+
484575
## `sdk-python` integration example (boundary adapter flow)
485576

486577
If your web agent uses `sdk-python`, build shared contract evidence before

0 commit comments

Comments
 (0)