Skip to content

Commit bde1f72

Browse files
authored
Merge pull request #33 from PredicateSystems/doc_improve
improve docs
2 parents d19ff73 + 7481c77 commit bde1f72

2 files changed

Lines changed: 92 additions & 36 deletions

File tree

README.md

Lines changed: 69 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,28 @@
44

55
---
66

7+
## Two Primitives: Identity vs Mandate
8+
9+
| Primitive | What it proves | Lifetime | Analogy |
10+
|-----------|---------------|----------|---------|
11+
| **Identity** | Who the agent is | Session-scoped (minutes–hours) | Passport |
12+
| **Mandate** | What this exact action may do, under whose authority | Action-scoped (seconds–minutes) | Work visa |
13+
14+
An IdP token (Okta, Entra) proves identity. A mandate proves per-action authorization.
15+
16+
---
17+
718
## The Problem: Authorization ≠ Intent
819

9-
When you connect an AI agent to an Identity Provider like Okta or Entra, it receives an access token—a **passport** that proves identity and carries static scopes like `database:write`.
20+
When you connect an AI agent to an Identity Provider, it receives an access token—a **passport** that proves identity and carries static scopes like `database:write`.
1021

1122
But IdP scopes are coarse-grained. If a prompt injection tricks your agent into calling `drop_database` instead of `update_record`, your API executes the attack because the agent's token legitimately holds the `database:write` scope.
1223

13-
**The IdP cannot evaluate context. It authorized the agent, not the action.**
24+
**The IdP authorized the agent, not the action.**
1425

15-
## The Solution: Per-Action Work Visas
26+
## The Solution: Per-Action Mandates
1627

17-
Predicate Authority adds a **deterministic policy layer** between your agent and your tools. Every action is evaluated in <1ms against explicit ALLOW/DENY rules before execution.
28+
Predicate Authority adds a **deterministic policy layer** between your agent and your tools. Every action is evaluated in <1ms against explicit ALLOW/DENY rules before execution. Approved actions receive a short-lived **mandate**—a cryptographic proof of authorization for that specific (action, resource, principal) tuple.
1829

1930
```
2031
┌─────────────┐ ┌─────────────────────┐ ┌─────────────┐
@@ -29,9 +40,12 @@ Predicate Authority adds a **deterministic policy layer** between your agent and
2940
- **Fast**: p99 < 1ms authorization latency
3041
- **Auditable**: Cryptographic proof ledger for every decision
3142

43+
The sidecar runs as a separate process, not as a framework hook. Framework integrations can disappear when orchestration changes; execution boundaries should survive runtime changes.
44+
3245
---
3346

34-
## Terminal Dashboard
47+
<details>
48+
<summary><h2>Terminal Dashboard</h2></summary>
3549

3650
Watch authorization decisions in real-time with the built-in TUI:
3751

@@ -41,36 +55,12 @@ Watch authorization decisions in real-time with the built-in TUI:
4155
./predicate-authorityd --policy-file policy.json dashboard
4256
```
4357

44-
```
45-
┌────────────────────────────────────────────────────────────────────────────┐
46-
│ PREDICATE AUTHORITY v0.5.1 MODE: strict [LIVE] UPTIME: 2h 34m [?] │
47-
│ Policy: loaded Rules: 12 active [Q:quit P:pause] │
48-
├─────────────────────────────────────────┬──────────────────────────────────┤
49-
│ LIVE AUTHORITY GATE │ METRICS │
50-
│ │ │
51-
│ [ ✓ ALLOW ] agent:web │ Total Requests: 1,870 │
52-
│ browser.navigate → github.com │ ├─ Allowed: 1,847 (98.8%)│
53-
│ m_7f3a2b1c | 0.4ms │ └─ Blocked: 23 (1.2%)│
54-
│ │ │
55-
│ [ ✗ DENY ] agent:scraper │ Throughput: 12.3 req/s │
56-
│ fs.write → ~/.ssh/config │ Avg Latency: 0.8ms │
57-
│ EXPLICIT_DENY | 0.2ms │ │
58-
│ │ TOKEN CONTEXT SAVED │
59-
│ [ ✓ ALLOW ] agent:worker │ Blocked early: 23 actions │
60-
│ browser.click → button#checkout │ Est. tokens saved: ~4,140 │
61-
│ m_9c2d4e5f | 0.6ms │ │
62-
├─────────────────────────────────────────┴──────────────────────────────────┤
63-
│ Generated 47 proofs this session. Run `predicate login` to sync to vault.│
64-
└────────────────────────────────────────────────────────────────────────────┘
65-
```
58+
**Keyboard:** `j/k` scroll, `f` filter, `c` clear, `P` pause, `?` help, `Q` quit | **Audit mode:** `--audit-mode` shows `[ ⚠ WOULD DENY ]` in yellow instead of blocking.
6659

67-
**Keyboard:** `j/k` scroll, `f` filter (DENY/agent), `c` clear filter, `P` pause, `?` help, `Q` quit
68-
69-
**Audit mode:** Use `--audit-mode` or `audit-only.json` policy to show `[ ⚠ WOULD DENY ]` in yellow instead of blocking.
70-
71-
---
60+
</details>
7261

73-
## Web UI
62+
<details>
63+
<summary><h2>Web UI</h2></summary>
7464

7565
Browser-based monitoring dashboard with real-time authorization event streaming:
7666

@@ -102,6 +92,8 @@ On startup, a secure URL is printed to the terminal:
10292

10393
The `--web-ui` flag works with both `run` and `dashboard` commands. When used with `dashboard`, both the TUI and Web UI run simultaneously.
10494

95+
</details>
96+
10597
---
10698

10799
## Quick Start
@@ -143,7 +135,8 @@ curl -X POST http://127.0.0.1:8787/v1/authorize \
143135
# {"allowed":false,"reason":"explicit_deny"}
144136
```
145137

146-
### Multi-Scope Authorization
138+
<details>
139+
<summary><h3>Multi-Scope Authorization</h3></summary>
147140

148141
Request authorization for multiple action/resource pairs in a single call. This is useful for orchestrators that need broad permissions across different domains (e.g., browser access AND filesystem access):
149142

@@ -177,6 +170,29 @@ curl -X POST http://127.0.0.1:8787/v1/authorize \
177170

178171
**Backward compatibility:** Single action/resource requests continue to work as before.
179172

173+
</details>
174+
175+
## Demos
176+
177+
*See the sidecar in action—securing AI agents across popular frameworks.*
178+
179+
### 1. Secure Your OpenClaw Agents
180+
* [Zero-Trust File Processor Agent Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/file-processor-demo)
181+
* [SecureClaw Integration Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/integration-demo)
182+
* [Amazon Kiro Reenactment Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/kiro-reenactment-demo)
183+
* [Zero-Trust AI Agent Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/real-openclaw-demo)
184+
185+
### 2. CrewAI Multi-Agents
186+
* [Zero-Trust Multi-Agent E-commerce Price Monitoring](https://github.com/PredicateSystems/predicate-secure-crewai-demo)
187+
188+
### 3. LangChain / LangGraph
189+
* [Poisoned Escalation Demo with Multiple Agents](https://github.com/PredicateSystems/langgraph-poisoned-escalation-demo)
190+
191+
### 4. Temporal.io
192+
* [Protect your temporal.io agents with zero-trust runtime authorization.](https://github.com/PredicateSystems/temporal-predicate-py)
193+
194+
**[More Demos...](https://predicatesystems.ai/demos)**
195+
180196
---
181197

182198
## Why This Exists
@@ -323,9 +339,11 @@ Integrate with your existing IdP for token validation:
323339
| `/metrics` | GET | Prometheus metrics |
324340
| `/policy/reload` | POST | Hot-reload policy |
325341

326-
### Multi-Scope Delegation Chain
342+
### Delegation Semantics
327343

328-
When a parent mandate has multiple scopes, child delegations are validated using **OR semantics**—the child's scope must be a subset of at least one parent scope:
344+
**Strict subset rule:** A child mandate's (action, resource) must be equal to or narrower than the parent's. `browser.*` can delegate to `browser.click`; `browser.click` cannot delegate to `browser.*`.
345+
346+
**Multi-scope parents:** When a parent mandate has multiple scopes, child delegations are validated using **OR semantics**—the child's scope must be a subset of at least one parent scope:
329347

330348
```
331349
┌─────────────────────────────────────────────────────────────────┐
@@ -347,6 +365,21 @@ When a parent mandate has multiple scopes, child delegations are validated using
347365
└───────────────────────┘ └───────────────────────┘
348366
```
349367

368+
### Cascade Revocation
369+
370+
When a mandate is revoked, **all derived child mandates are immediately invalidated**:
371+
372+
```
373+
A (root)
374+
└── B (depth 1)
375+
└── C (depth 2)
376+
└── D (depth 3)
377+
378+
Revoke B → C and D die instantly. A survives.
379+
```
380+
381+
Child authority does not survive parent revocation. To restore access, the child must obtain a fresh mandate from an active parent—there is no automatic re-minting.
382+
350383
**Delegation request:**
351384

352385
```bash

docs/sidecar-user-manual.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,29 @@ WARN: Environment variable 'API_TOKEN' not set, using empty string
14791479

14801480
---
14811481

1482+
## Demos
1483+
1484+
*See the sidecar in action—securing AI agents across popular frameworks.*
1485+
1486+
### 1. Secure Your OpenClaw Agents
1487+
* [Zero-Trust File Processor Agent Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/file-processor-demo)
1488+
* [SecureClaw Integration Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/integration-demo)
1489+
* [Amazon Kiro Reenactment Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/kiro-reenactment-demo)
1490+
* [Zero-Trust AI Agent Demo](https://github.com/PredicateSystems/predicate-claw/tree/main/examples/real-openclaw-demo)
1491+
1492+
### 2. CrewAI Multi-Agents
1493+
* [Zero-Trust Multi-Agent E-commerce Price Monitoring](https://github.com/PredicateSystems/predicate-secure-crewai-demo)
1494+
1495+
### 3. LangChain / LangGraph
1496+
* [Poisoned Escalation Demo with Multiple Agents](https://github.com/PredicateSystems/langgraph-poisoned-escalation-demo)
1497+
1498+
### 4. Temporal.io
1499+
* [Protect your temporal.io agents with zero-trust runtime authorization.](https://github.com/PredicateSystems/temporal-predicate-py)
1500+
1501+
**[More Demos...](https://predicatesystems.ai/demos)**
1502+
1503+
---
1504+
14821505
## Support
14831506

14841507
- GitHub Issues: https://github.com/PredicateSystems/predicate-authority-sidecar/issues

0 commit comments

Comments
 (0)