data-residency-and-secrets
Determine where user data physically lives once indexed, embedded, or sent to third parties, whether it can be deleted, and how credentials are stored and survive packaging and auto-update across macOS and Windows in local-first applications.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-27
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- data-residency-and-secrets
- description
- Determine where user data physically lives once indexed, embedded, or sent to third parties, whether it can be deleted, and how credentials are stored and survive packaging and auto-update across macOS and Windows in local-first applications.
03 SKILL.md 正文
Data Residency and Secrets
Purpose
Answer two questions precisely: where do the bytes actually live, and where do the credentials actually live. Both are routinely assumed rather than determined, and both are expensive to change after the architecture is set.
When to use
Use when private corpora are indexed or embedded, when third-party inference or storage providers enter the topology, when an application stores credentials locally, or when the product makes any local-first or privacy claim to users. Run after trust-boundary-modeling has produced the egress ledger.
Part A — Data residency
Step 1 — Trace the corpus
For each corpus the system ingests, follow it through every stage and record where the data or its derivatives come to rest:
| Stage | Where the bytes land | Who can read them |
|---|---|---|
| Source | ||
| Chunking / preprocessing | ||
| Embedding generation | ||
| Vector store | ||
| Cache / logs | ||
| Reranking or inference |
Caches and logs are the most commonly missed rows. Request and response logging at a provider is a residency fact regardless of the storage design.
Step 2 — Treat derivatives as the original
Embeddings, summaries, extracted entities, and indexes derived from private content are private content. Embedding is not anonymization — inversion and membership inference are practical enough that treating a vector store as non-sensitive is not defensible at architecture level. Apply the same residency rules to derivatives as to sources.
Step 3 — Establish deletability
For each resting place, answer whether deletion on request is actually achievable:
- Can a specific user's or document's contribution be identified and removed?
- Does removal require reindexing the whole corpus, and is that operationally feasible?
- Do provider-side logs and caches expire on a schedule you can state?
- Are there backups or replicas outside the deletion path?
An architecture that cannot delete is making a permanent commitment on the user's behalf. Say so explicitly.
Step 4 — Separate verified from assumed
Mark every residency and retention claim as verified (documented in provider terms, with the relevant term named) or assumed. Do not let assumed claims enter the decision record as facts. State what would verify each assumed claim.
Step 5 — Check the claim gap
Compare what the product tells users about where their data lives against what the architecture actually does. A local-first or private product that sends corpus content to a third-party embedding API has a claim gap, and that gap is an architecture finding, not a marketing detail.
Step 6 — Multi-tenant index check
Where a vector or search index is shared across tenants, determine whether isolation is enforced by the store or by query-time filtering in application code. Query-time filtering is code-enforced isolation and will eventually leak; flag it as such and let the board decide knowingly.
Part B — Secrets in local applications
Step 7 — Locate each secret
For every credential the application holds, record where it lives and what protects it:
| Secret | Storage location | Protected by | Survives reinstall? |
|---|
Preferred locations, in order: OS credential store (macOS Keychain, Windows Credential Manager / DPAPI), then an OS-protected application data directory, then encrypted-at-rest with a key that is itself in the OS store. Plaintext config files, environment files shipped with the app, and anything inside the application bundle are not acceptable resting places.
Step 8 — Reject bundled secrets
Any secret shipped inside the distributed artifact is public. Code signing establishes authenticity, not confidentiality — a signed bundle is still readable. If the architecture requires a shared secret to reach a backend, the correct answer is a per-user credential or a broker service, not obfuscation.
Step 9 — Cross-OS divergence
macOS and Windows diverge enough to force branching. Determine and record for each platform: which store is used, what the access-control semantics are, what happens when the signing identity changes, and what the user-facing prompt looks like on first access. On macOS, keychain item access is tied to the signing identity, so a certificate change can orphan stored items — this is a packaging concern with a security consequence.
Step 10 — Survive packaging and auto-update
Walk the full lifecycle and state what happens to secrets at each transition: first install, normal update, downgrade or rollback, signing identity change, and uninstall. An auto-update path that silently loses or, worse, re-prompts and re-stores credentials into a weaker location is a real and common failure.
Step 11 — Sync-path check
If the application syncs local data, determine whether the secrets store is inside the sync scope. Credentials landing in a synced or backed-up directory extend their residency to wherever that sync goes, which is usually a third-party cloud the residency analysis has not accounted for.
Output format
### Corpus residency
| Stage | Resting place | Readable by | Deletable | Verified? |
|---|---|---|---|---|
### Claim gap
- Product claims: ...
- Architecture does: ...
- Gap: ...
### Secrets
| Secret | macOS location | Windows location | Survives update? |
|---|---|---|---|
### Residency and secrets constraints for the decision record
- ...
Failure modes to avoid
- Treating embeddings as anonymized derivatives.
- Recording provider retention promises as verified without naming the term that states them.
- Omitting caches, logs, and backups from the residency table.
- Designing secret storage for the happy install path and not for update, rollback, and identity change.
- Assuming a single secrets approach spans macOS and Windows without divergence.
- Escalating residency concerns for a genuinely single-user local tool operating only on the user's own files — state proportionality and move on.
04 同仓库更多 Skills
twenty-year-land-plan
Apply the Bren discipline of evaluating every land and development decision on a twenty-year horizon, with a comprehensive plan for how the land, the community, and the surrounding public infrastructure evolve together. Deals optimized for a five-year exit are structurally different from deals that compound across generations; insist on knowing which kind you are making. Use when evaluating land, entitlements, master-planned development, or phasing decisions, and when separating five-year exit deals from generational holds.
thematic-gut-check
Apply the Gray discipline of identifying the structural theme behind every real estate deal, testing where that theme sits in its capital-flow lifecycle, and insisting that deals without a named theme — or deals late in a crowded theme — clear a higher bar. A mediocre deal in a strong theme usually beats a clever deal in a weak one. Use when naming the structural thesis behind a deal, judging whether that theme is early or crowded, and setting the bar the deal must clear.
supply-pipeline-gut-check
Apply the Zell discipline of grounding every real estate thesis in the local supply pipeline. Demand counts over adjectives — units under construction, units permitted, units proposed — and convert them into a forward absorption schedule. A deal that ignores the pipeline is a bet on a market you have not actually studied. Use when validating a market thesis, forecasting absorption and rent growth, or counting units under construction, permitted, and proposed.
ruin-scenario-mapping
Apply the Taleb discipline of identifying, for every real estate deal, the specific chain of events that produces ruin — permanent, unrecoverable capital loss — and verifying that no single such chain has non-trivial probability. Deals with any plausible ruin path must be restructured or abandoned. Use when sizing leverage, testing refinancing, covenant, and liquidity risk, or checking whether any single failure chain can permanently wipe out the position.
revenue-cost-architecture
Design a venture's revenue streams, pricing logic, cost structure, and unit economics so the business model has a coherent theory of value capture, not just value creation. Use after the value proposition and customer segment are set and before financial projections, when choosing a pricing model, calculating contribution margin or CAC payback, or checking whether the unit economics hold at scale.
replacement-cost-stress-test
Apply the Buffett discipline of pricing every real estate asset against the cost to rebuild it from scratch. The ratio of purchase price to replacement cost sets a ceiling on long-run downside: below replacement cost, new supply cannot profitably undercut you; at or above it, you are buying a liability disguised as an asset. Use when setting a purchase price, judging downside protection, or testing how exposed an asset is to newly built competing supply.