Skip to content

Commit 772ef1f

Browse files
committed
docs(auditor): Add Hardware-Backed Cryptographic Audit section
- Add new Section 2 with Prover/Verifier Policy Considerations - TEE Auditor Enclave (Hardware Trust) - ZKP Compliance Spot-Checks (Mathematical Trust) - SMPC Policy Generation (Collaborative Trust) - Renumber all subsequent sections (3→4, 4→5, etc.) - Fix cross-references (Sec. 5 → Sec. 8, Track C → Track E) - Align with README Enterprise Financial Services terminology
1 parent 8b0c7e2 commit 772ef1f

File tree

1 file changed

+126
-11
lines changed

1 file changed

+126
-11
lines changed

docs/auditor-privacy-preserving-deep-dive.md

Lines changed: 126 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Privacy-Preserving Techniques (e.g. **ZKP**) for the Full AI Lifecycle
1+
# Privacy-Preserving Techniques (e.g. **Zero-knowledge-proofs aka ZKPs**) for the Full AI Lifecycle
22

33
> **For Technical Auditors & Architects:** This document provides a deep technical walkthrough of the **privacy-preserving (e.g. **ZKP**-based)** prompt integrity verification system. For a high-level overview of the complete attestation model (hardware, location, identity, and prompts), see the **[Auditor Guide](./auditor.md)**.
44
@@ -19,7 +19,49 @@ Enterprises in regulated industries face a fundamental conflict when auditing AI
1919

2020
---
2121

22-
## 2. Why Privacy-Preserving Techniques (e.g. **ZKP**)? A Technical Comparison
22+
## 2. The Hardware-Backed Cryptographic Audit: Prover/Verifier Policy Considerations
23+
24+
To ensure sensitive information (like proprietary trade secrets or unannounced project names) is not leaked during the policy audit, the **AegisSovereignAI** architecture shifts away from a "human reading a list" model to a **Hardware-Backed Cryptographic Audit**.
25+
26+
In a sovereign environment, you don't actually show the raw policy list to a human auditor. Instead, you use one of the following three "blind" verification techniques:
27+
28+
### 2.1. The TEE Auditor Enclave (Hardware Trust)
29+
30+
Instead of a person, a **Trusted Execution Environment (TEE)** (e.g., Intel SGX, AMD SEV, or a Nitro Enclave) acts as the auditor.
31+
32+
* **The Setup:** You load the raw keyword list into an isolated hardware enclave.
33+
* **The Code:** You run a small, open-source "Auditor Agent" inside the enclave. This agent's code is publicly auditable and does only one thing: *Verify that the list contains mandatory regulatory terms (like GDPR/CCPA requirements) and nothing illegal.*
34+
* **The Attestation:** The TEE hardware produces a **Remote Attestation Quote**. This is a cryptographically signed statement proving that "This specific approved code ran on this specific private data and produced this Policy Root Hash."
35+
* **Result:** The auditor trusts the **Hardware Quote**, not the enterprise. They never see the list; they only see the proof that the list was "blessed" by the enclave.
36+
37+
### 2.2. ZKP "Compliance Spot-Checks" (Mathematical Trust)
38+
39+
If you prefer to avoid TEEs, you can use a **Meta-Proof**. The Auditor provides a list of "Mandatory Blocks" (e.g., social security number patterns, known malware signatures).
40+
41+
* **The Challenge:** The Auditor says: "I don't need to see your secret list, but prove to me that 'SSN_PATTERN' is included in your Policy Root."
42+
* **The Response:** The Enterprise provides a **ZKP of Membership** (using a Sparse Merkle Tree path).
43+
* **Result:** This proves the policy is *compliant* with the law without revealing the *rest* of the proprietary keywords that the enterprise wants to keep secret.
44+
45+
### 2.3. SMPC Policy Generation (Collaborative Trust)
46+
47+
Using **Secure Multi-Party Computation (SMPC)**, the Enterprise and the Auditor can collaboratively generate the Policy Root without either party ever seeing the other's "contribution."
48+
49+
* The Auditor provides the regulatory "must-block" list.
50+
* The Enterprise provides the proprietary "secret-block" list.
51+
* The SMPC protocol mathematically merges them into a single **Sovereign Root Hash**.
52+
* **Result:** Neither side sees the full list, but the resulting Root Hash is guaranteed to contain the requirements of both parties.
53+
54+
### Why This Matters for Enterprise Financial Services
55+
56+
For a Senior Lead AI Cybersecurity Architect, this solves the **"Auditor Liability"** problem. If a human auditor sees a list of sensitive project names, that auditor becomes a security risk. By using a **TEE-based Auditor Agent**, you achieve:
57+
58+
1. **Zero Disclosure:** No human ever sees the raw sensitive keywords.
59+
2. **Provable Compliance:** A cryptographic certificate replaces "trusting someone's word."
60+
3. **Auditability:** The *process* is audited, while the *data* remains sovereign.
61+
62+
---
63+
64+
## 3. Why Privacy-Preserving Techniques (e.g. **ZKP**)? A Technical Comparison
2365

2466
While multiple Privacy-Enhancing Technologies (PETs) exist, **ZKP** provides the unique combination of **mathematical certainty** and **data minimization** required for high-stakes AI governance.
2567

@@ -34,7 +76,7 @@ While multiple Privacy-Enhancing Technologies (PETs) exist, **ZKP** provides the
3476

3577
---
3678

37-
## 3. Foundational Primitive: Verifiable Geofencing (Reg-K)
79+
## 4. Foundational Primitive: Verifiable Geofencing (Reg-K)
3880

3981
Before auditing AI logic, auditors must often verify **where** the data is being processed to comply with residency laws like **Regulation K** or **GDPR**.
4082

@@ -49,7 +91,7 @@ Before auditing AI logic, auditors must often verify **where** the data is being
4991

5092
---
5193

52-
## 4. The Five-Track Sovereign AI Lifecycle Strategy
94+
## 5. The Five-Track Sovereign AI Lifecycle Strategy
5395

5496
AegisSovereignAI provides **end-to-end cryptographic verification** across every stage of the AI lifecycle: **Ingestion → Training → Inference → Output**.
5597

@@ -144,7 +186,7 @@ User prompts are dynamic and high-volume. To maintain performance, we use an **A
144186
│ ┌──────────────┐ ┌──────────────┐
145187
│ │ 🔥 PURGE │ │ ESCALATE TO │
146188
│ │ Raw Prompts │ │ HITL REVIEW │
147-
│ │ Deleted │ │ (Sec. 5) │
189+
│ │ Deleted │ │ (Sec. 8) │
148190
│ └──────────────┘ └──────────────┘
149191
│ │
150192
│ ▼
@@ -188,11 +230,11 @@ AI model outputs pose unique compliance risks that require verification even whe
188230
- **Compliant Output:** "I don't have access to individual client portfolios. Please contact your relationship manager."
189231
- **Non-Compliant Hallucination:** "John Smith (SSN: 123-45-6789) has $2.3M in equities and $800K in bonds."
190232

191-
Even if the system prompt prohibits disclosure and the user prompt was benign, **the AI model itself** can generate PII. Track C ensures this never reaches the user **and** provides cryptographic proof of the filter's effectiveness.
233+
Even if the system prompt prohibits disclosure and the user prompt was benign, **the AI model itself** can generate PII. Track E ensures this never reaches the user **and** provides cryptographic proof of the filter's effectiveness.
192234

193235
---
194236

195-
## 5. Concrete Example: Private Wealth Gen-AI Advisory (Unmanaged Devices)
237+
## 6. Concrete Example: Private Wealth Gen-AI Advisory (Unmanaged Devices)
196238

197239
### Scenario
198240

@@ -234,7 +276,7 @@ This ZKP addresses the **Excessive Agency Risk**—the danger that the AI model
234276

235277
---
236278

237-
## 6. The Noir Circuit (Technical Implementation)
279+
## 7. The Noir Circuit (Technical Implementation)
238280

239281
The core logic uses a ZK-friendly string search algorithm.
240282

@@ -266,7 +308,7 @@ fn main(
266308

267309
---
268310

269-
## 7. Incident Response & Escalation Workflow
311+
## 8. Incident Response & Escalation Workflow
270312

271313
In a cryptographic audit model, a **"Failure to Generate a Proof"** is the primary signal of a policy violation.
272314

@@ -282,7 +324,7 @@ If the ZKP circuit encounters a prompt that violates an **Exclusion Rule** (e.g.
282324

283325
---
284326

285-
## 8. The Evidence Bundle for Auditors
327+
## 9. The Evidence Bundle for Auditors
286328

287329
When an auditor requests compliance evidence, they receive an **Evidence Bundle**:
288330

@@ -328,7 +370,7 @@ When an auditor requests compliance evidence, they receive an **Evidence Bundle*
328370

329371
---
330372

331-
## 9. Regulatory Value Proposition
373+
## 10. Regulatory Value Proposition
332374

333375
| Regulatory Need | AegisSovereignAI Execution |
334376
| --- | --- |
@@ -340,4 +382,77 @@ When an auditor requests compliance evidence, they receive an **Evidence Bundle*
340382

341383
---
342384

385+
## 11. Practical Implementation: The LangGraph Sovereign Substrate
386+
387+
This section demonstrates how the **Batch & Purge** model is implemented in practice using the **AegisSovereignAI Sovereign Substrate** for **LangGraph** multi-agent workflows.
388+
389+
### The Sovereign Substrate Architecture
390+
391+
The core innovation is the **non-intrusive Node Wrapper**. Instead of modifying the agentic logic, AegisSovereignAI wraps the LangGraph execution nodes, trapping state transitions at the "edge" of each agent's decision loop. This allows the governance layer to be applied to **any** LangGraph workflow without changing the agent's source code.
392+
393+
```mermaid
394+
sequenceDiagram
395+
participant User as Human/External App
396+
participant Substrate as AegisSovereignAI Substrate
397+
participant Node as LangGraph Node (Agent)
398+
participant TEE as Ephemeral TEE Buffer
399+
participant Auditor as Ledger/Audit Log
400+
401+
Note over User, Auditor: SESSION START
402+
403+
User->>Substrate: 1. Initial Prompt (State)
404+
405+
Note right of Substrate: Layer 3: Policy Enforcement
406+
Substrate->>Substrate: Scan for PII/Jailbreak
407+
Substrate->>TEE: Buffer Compliant Input
408+
409+
Substrate->>Node: 2. Execute Original Agent Logic
410+
411+
Node-->>Substrate: 3. Return State Update (AI Response)
412+
413+
Note right of Substrate: Layer 3: Drift Detection
414+
Substrate->>Substrate: Scan for Agentic Drift/Hallucinated PII
415+
Substrate->>TEE: Buffer Agent Output & Tool Results
416+
417+
Note over Node: (Repeat for all nodes in Graph)
418+
419+
Note right of Substrate: BATCH & PURGE CYCLE
420+
Substrate->>TEE: Aggregate Session Interaction
421+
Substrate->>Substrate: Generate aggregated Proof (Mock ZKP)
422+
Substrate->>Auditor: 4. Anchor Evidence Bundle (Proof Only)
423+
Substrate->>TEE: 🔥 PERMANENT PURGE
424+
425+
Substrate-->>User: 5. Verified Sovereign Result
426+
427+
Note over User, Auditor: SESSION COMPLETE (Zero Data Residual)
428+
```
429+
430+
### Functional Breakdown
431+
432+
#### 1. The Gateway Check (Layer 3 Ingress)
433+
Every interaction starts with a **Proactive Policy Scan**. The Substrate intercepts the `HumanMessage` before the agent processes it. If a violation (like a jailbreak attempt) is detected, it is logged in the internal compliance buffer immediately.
434+
435+
#### 2. Node Wrapping (Transparent Governance)
436+
A `sovereign_factory` applies the `governance.wrap_node` decorator to the LangGraph `StateGraph`. This allows AegisSovereignAI to:
437+
- **Trap Inputs:** See exactly what prompt is hitting the LLM.
438+
- **Trap Outputs:** See exactly what the LLM responded before it updates the shared `State`.
439+
- **Verify Tools:** Intercept and scan external data returned from tools (e.g., Tavily, MCP).
440+
441+
#### 3. The "Batch & Purge" Mechanism (Session-Level)
442+
- **Buffering:** During the session, all raw text is stored in an ephemeral, in-memory buffer (simulating a TEE).
443+
- **ZKP Generation:** Upon session completion, the engine calculates a Merkle Root of the entire session history and generates a cryptographic proof of compliance.
444+
- **Anchoring:** The Evidence Bundle (Metadata + Proof) is written to a persistent audit log.
445+
- **The Purge:** The raw execution trace is permanently deleted from memory. **No PII is ever stored at rest.**
446+
447+
### Summary of Sovereign Benefits
448+
449+
| Feature | Traditional Audit | Sovereign Audit (Aegis) |
450+
| :--- | :--- | :--- |
451+
| **Data Retention** | Persistent raw logs (High liability) | **Zero Residual Data** (Batch & Purge) |
452+
| **Privacy** | Auditor sees everything | **Auditor sees cryptoproof only** |
453+
| **Detection** | Reactive (post-incident) | **Just-in-Time** (Intercept before state update) |
454+
| **Integration** | Intrusive code changes | **Non-Intrusive Substrate** (Node Wrappers) |
455+
456+
---
457+
343458
[Root README](../README.md) | [Auditor Guide](./auditor.md) | [IETF WIMSE Draft](https://datatracker.ietf.org/doc/draft-lkspa-wimse-verifiable-geo-fence/)

0 commit comments

Comments
 (0)