docs: system_design.md (Mermaid architecture + flows)#31
Conversation
New comprehensive design doc: system context, component architecture, the sentinel-substitution core, the three secret paths (sequence diagrams), signup, attestation, trust boundaries + threat model, the tamper-evident ledger, secret lifecycle (state diagram), and a deployment/file map. 11 GitHub-native Mermaid diagrams, collapsible sections, and reference tables. Linked from the README nav. Co-authored-by: algsoch <algsoch@gmail.com>
PR Summary by Qododocs: add System Design doc with Mermaid architecture + key flows
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. RTMR3 pin not mandatory
|
| | Threat | Mitigation | Residual | | ||
| |---|---|---| | ||
| | Prompt injection exfiltrates a key | agent only ever holds `__BLINDFOLD__` | none for the proxy path | | ||
| | Proxy misused by a co-resident process | `proxy --auth` session token · `--socket` 0600 | agent as same OS user | | ||
| | Reflection-exfil — key echoed in a response | contract redacts the sealed secret from the returned body | — | | ||
| | Malicious or honest-but-curious T3 node | remote attestation + **mandatory RTMR3 pin** to seal | trust in Intel TDX + T3 | | ||
| | Tenant key stolen from disk | key in the **OS keychain**, not a plaintext file | agent as same user with unlocked keychain | |
There was a problem hiding this comment.
1. Rtmr3 pin not mandatory 🐞 Bug ⛨ Security
system_design.md claims RTMR3 pinning is mandatory for sealing, but the current attestation gate is opt-in unless a pin is already configured (or BLINDFOLD_REQUIRE_ATTEST=1). This overstates the default protection against a malicious Terminal 3 node and can lead readers to assume sealing is measurement-verified when it may not be.
Agent Prompt
### Issue description
`system_design.md` states RTMR3 pinning is **mandatory** to seal, but the CLI gate is only enforced when a pin exists (or `BLINDFOLD_REQUIRE_ATTEST=1`). This is a security-posture mismatch in the threat model table.
### Issue Context
- Current gate behavior is explicitly documented in code comments and logic: it is a no-op unless a measurement is pinned or the env var forces it.
- The `register` command calls `attestationGate({ requirePin: true })`, but `attestationGate` returns early when `required` is false.
### Fix Focus Areas
- system_design.md[355-362]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| | Component | File | Responsibility | Sees plaintext? | | ||
| |---|---|---|---| | ||
| | CLI dispatcher | `bin/blindfold.ts` | route commands to `cmd-*.ts` handlers | no | | ||
| | Register | `src/register.ts` | seal a secret with one `map-entry-set` | **once**, dropped immediately | | ||
| | Proxy | `src/proxy.ts` | swap any `Authorization` for `Bearer __BLINDFOLD__`, route by URL, forward to enclave | **no** | | ||
| | Providers | `src/providers.ts` | prefix → upstream host + secret name + auth scheme | no | |
There was a problem hiding this comment.
2. Proxy auth behavior misstated 🐞 Bug ≡ Correctness
system_design.md says the proxy “swap[s] any Authorization for Bearer __BLINDFOLD__”, but the proxy plants the sentinel into a provider-specific header for some providers (e.g., Gemini’s x-goog-api-key) and strips Authorization entirely for non-bearer schemes (basic/sigv4) because the enclave computes Authorization. This can mislead readers about what headers the proxy actually forwards and how non-OpenAI-shaped providers work.
Agent Prompt
### Issue description
`system_design.md` oversimplifies the proxy’s header behavior by claiming it always swaps `Authorization` to `Bearer __BLINDFOLD__`. In reality:
- bearer providers may use `Authorization: Bearer …` **or** a provider-specific header (Gemini)
- basic/sigv4/webhook paths strip `Authorization`, since auth is computed/applied in-enclave via the structured `auth` spec.
### Issue Context
The code explicitly selects a provider-specific sentinel header for Gemini and removes `authorization` for non-bearer schemes.
### Fix Focus Areas
- system_design.md[143-148]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
A comprehensive, interactive system-design doc:
<details>sections + a 3-column HTML TOC; reference tables for components, threats, and file layout.forward/release-to-tenant,blindfold-proxyv0.5.6, four auth schemes, egress ACL, keychain).()/{}/<>in messages/labels). Linked from the README nav.Co-authored-by: algsoch algsoch@gmail.com
Summary by cubic
Adds
system_design.md, an interactive system design doc with 11 GitHub-native Mermaid diagrams covering architecture, flows, and security. Updates the README nav to link the new doc.forward/release-to-tenant,blindfold-proxyv0.5.6).Written for commit 709ae85. Summary will update on new commits.