https://github.com/edycutjong/lethe
π Autonomous right-to-erasure agent protecting PII via secure TEE enclaves and network egress blinding.
https://github.com/edycutjong/lethe
compliance cryptography gdpr intel-tdx nextjs privacy rust tee webassembly
Last synced: 3 days ago
JSON representation
π Autonomous right-to-erasure agent protecting PII via secure TEE enclaves and network egress blinding.
- Host: GitHub
- URL: https://github.com/edycutjong/lethe
- Owner: edycutjong
- License: mit
- Created: 2026-06-20T05:41:29.000Z (5 days ago)
- Default Branch: main
- Last Pushed: 2026-06-20T08:03:05.000Z (5 days ago)
- Last Synced: 2026-06-20T08:09:48.596Z (5 days ago)
- Topics: compliance, cryptography, gdpr, intel-tdx, nextjs, privacy, rust, tee, webassembly
- Language: TypeScript
- Homepage: https://lethe.edycu.dev
- Size: 1.84 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
Lethe π
Autonomous right-to-erasure agent protecting PII via secure TEE enclaves and network egress blinding.
[](https://lethe.edycu.dev)
[](https://agent.lethe.edycu.dev)
[](https://youtu.be/lethe-demo-video)
[](https://lethe.edycu.dev/pitch.html)
[](https://dorahacks.io/hackathon/t3adkdevchallenge)









[](https://github.com/edycutjong/lethe/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/@edycutjong/lethe-sdk)
[](https://www.npmjs.com/package/@edycutjong/lethe-cli)
---
> β‘ **Reviewers / judges:** fastest path is **[GOLDEN_PATH.md](docs/GOLDEN_PATH.md)** β the entire flow in ~2 minutes, **no credentials**. Bug-bounty track: **[SDK_AUDIT.md](docs/SDK_AUDIT.md)** (confirmed, code-cited findings from the real `@terminal3` SDK).
## πΈ See it in Action
> **Onboard Wallet** β **Authorize Agent Delegation** β **Batch Fund x402 Micropayments** β **Trigger Blinded Erasure Loop** β **Cryptographic Purge & Self-Destruct**.
---
## π‘ The Problem & Solution
Sophie Miller discovered her phone number, physical address, and SSN listed on dozens of public data-broker sites. When she attempted to exercise her legal right to be deleted (GDPR Art. 17 / CCPA), she was met with a paradox: opt-out portals demanded that she upload *more* sensitive credentialsβlike a full SSN scan and utility billsβto verify her identity. These opt-out systems are centralized data honeypots. If any broker or the crawler agent routing the request gets breached, Sophie's PII is leaked.
**Lethe** solves this paradox. Sophie encrypts her PII locally in her browser. The coordinator agent routes the request but remains blind. Decryption and validation happen exclusively inside the hardware-isolated TEE secure enclave, and the final webhook dispatches the data securely replacing placeholder markers at the secure edge.
Upon campaign completion, Lethe triggers a self-destruct sequence to zeroize its own volatile memory and de-authorize session DID tokens. **The last act of the agent is to forget you.**
### Key Features:
- π‘οΈ **Intel TDX Secure TEE Enclaves**: Decrypts user PII envelopes and processes erasures inside isolated hardware boundaries.
- π **Zero-Knowledge Proofs**: Groth16 proofs verify ownership of emails/SSNs offline before executing deletion request webhooks.
- β‘ **Egress Placeholder Blinding**: Uses `http-with-placeholders` API to blind unsecure network layers and route requests securely.
- π **x402 Micropayments**: Requires verified micropayment hashes for each request to protect broker APIs from spam.
- π **Zeroization & Purging**: The final act of the agent is to zeroize private keys in RAM and trigger `user-removal` to wipe delegation sessions.
---
## ποΈ Architecture & Tech Stack
| Layer | Technology |
|---|---|
| **Dashboard UI** | Next.js 16 (App Router), React 19, Tailwind CSS v4 |
| **Coordinator Agent** | Node.js, Express, TypeScript, Ethers.js |
| **Secure Enclave** | Intel TDX TEE |
| **TEE Contract** | Rust compiled to WebAssembly WASIP2 (`wasm32-wasip2`) |
| **Client SDK** | TypeScript, `secp256k1` (ECDH), `aes-256-gcm` |
| **CLI Tool** | Node.js, Commander.js |
| **E2E Testing** | Playwright |
| **Performance Audit** | Lighthouse CI |
### Enclave Egress Flow:
```mermaid
sequenceDiagram
participant Client as Client SDK (Browser)
participant Agent as Coordinator Agent (Blind)
participant TEE as TEE Contract (Intel TDX)
participant Broker as Data Broker API
Client->>Agent: ECIES Envelope + ZK Proof
Note over Agent: Agent sees only ciphertext β
zero plaintext exposure
Agent->>TEE: executeAndDecode(envelope, proof)
Note over TEE: Decrypts PII inside
hardware-isolated enclave
TEE->>Broker: DELETE /gdpr/delete
{{profile.email}} β sophie@β¦
(Placeholders resolved at edge)
Broker-->>TEE: 200 OK + Deletion Confirmation
TEE-->>Agent: Signed Verifiable Credential (VC)
Agent-->>Client: Evidence Receipt
```
---
## π‘οΈ Sponsor Host API Integration Defense
Lethe utilizes 6 host API namespaces from the **Terminal 3 Agent Dev Kit (ADK)**:
1. **`user-removal`:** Coordinates physical de-authorization of the delegation session DID, deleting credentials from the host ledger.
2. **`http-with-placeholders`:** Executes blind HTTP egress webhook calls by replacing placeholdered variables inside the secure TLS tunnel.
3. **`user-profile`:** Retrieves isolated encrypted customer profile data at rest.
4. **`signing`:** Enclave-side signing service used to generate signed W3C Verifiable Credentials proving erasure receipt validation.
5. **`kv-store`:** Namespace-isolated key-value maps (`lethe:broker`, `lethe:job`, `lethe:evidence`) storing broker templates and execution records.
6. **`authorisation`:** Verifies broker grid delegation signatures against tenant registries.
---
## π Getting Started
### Prerequisites
- Node.js >= 20.9.0
- Python >= 3.11
- Rust >= 1.75
- target wasm32-wasip2:
```bash
rustup target add wasm32-wasip2
```
### Installation & Local Setup
1. **Clone the repository:**
```bash
git clone https://github.com/edycutjong/lethe.git
cd lethe
```
2. **Install all dependencies:**
```bash
make bootstrap
```
3. **Compile and Build all components:**
```bash
make build
```
4. **Setup Environment:**
```bash
cp .env.example .env
```
5. **Run Dashboard UI:**
```bash
cd ui && npm run dev
```
---
## π§ͺ Testing & CI
We enforce a **6-stage pipeline**: Quality β Security β Build β E2E β Performance β Deploy.
```bash
# ββ Workspace Automation βββββββββββββββββββββ
make ci # Run full code quality pipeline (lint, typecheck, tests)
make e2e # Run Playwright E2E tests (demo mode)
make lighthouse # Run Lighthouse CI performance audit
make security-scan # Run high/critical security scan
make check-readiness # Run the official readiness suite check
make verify-offline # Run the enclave PII leak offline verification
```
| Layer | Tool | Status |
|---|---|---|
| Code Quality | ESLint + TypeScript | β
Passed |
| Unit Testing | Jest (Agent) + Cargo test (Contract) | β
Passed |
| E2E Testing | Playwright (3 suites) | β
Passed |
| Security (SAST) | CodeQL | β
Active |
| Security (SCA) | Dependabot + npm audit | β
Clean |
| Secret Scanning | TruffleHog | β
Configured |
| Performance | Lighthouse CI | β
Configured |
---
## π Project Structure
```
lethe/
βββ docs/ # README assets (hero, pitch deck, mockup)
β βββ readme-hero.png
β βββ readme.png
βββ sdk/ # TypeScript SDK (@edycutjong/lethe-sdk)
βββ contract/ # Rust WASM Component Contract source
βββ agent/ # Node.js Coordinator Agent
β βββ src/index.test.ts # Jest Integration tests
β βββ src/index.ts # Agent logic
βββ ui/ # Next.js Dashboard App
β βββ e2e/ # Playwright E2E tests
β βββ src/app/ # Dashboard pages
βββ cli/ # @edycutjong/lethe-cli executable
βββ scripts/ # Seeding, verification and leak checks
βββ Makefile # Local Automation targets
βββ package.json # Workspace script coordinator
βββ README.md # You are here
```
---
## π§ Terminal 3 ADK Dev Challenge: Audit & Discovered Bugs
This project is submitted to the **Terminal 3 ADK Dev Challenge 2026** as part of the **Vouch Suite** (a 5-enclave system including Epoch, Lethe, Silo, Synod, and Visor).
While building these enclaves we audited the T3 ADK host APIs and SDK and documented **10 concrete onboarding bugs and documentation gaps** β each with a repro, impact, and the workaround we shipped β for the **Track 2 bug bounty**.
β‘οΈ **See [BUGS.md](BUGS.md)** for the full audit. Highlights for Lethe:
- **Bug #2 β `kv-store` interface discrepancy:** WIT declares `get(map-name, key)` but the C ABI is flat `(key_ptr, key_len)` (Lethe `scan`s deletion campaigns through the flat shape).
- **Bug #4 β `signing` has no VC helper:** templates call `host_signing_issue_vc`, but WIT only exposes raw `sign` (Lethe issues a deletion-proof VC per broker).
- **Gap #8 / #9 β rollback boundary & `outbox` idempotency window** are unspecified β both affect the erasure campaign's all-or-nothing guarantee.
- **Gap #10 β `user-removal` ordering vs. in-flight egress** is undocumented β Lethe's self-destruct must run strictly after the last PII-blind broker request resolves.
---
## π License
[MIT](LICENSE) Β© 2026 Edy Cu
---
## π Acknowledgments
Built for the DoraHacks T3ADK Launch Edition 2026. Thank you to the Terminal 3 team for the enclaves environment and development tools.