Docyard v2 - Design Discussion
Last updated: March 20261. REVISED: Configurable Security Model Per Artifact Type
Core Decision
All security models are available and configured by the distributor per artifact type. When a distributor creates an artifact type template, they specify which access control model to use.Security Access Models
Distributors configure one of these models per artifact type template:| Model | Description | Use Case |
|---|---|---|
open | Any collector with matching keys can access | Public documents, standard insurance declarations |
declared | Only collectors who declared the lock types during KYC | Semi-private documents where legitimacy matters |
invited | Only collectors invited by the distributor | Partner relationships, B2B integrations |
restricted | Requires admin + distributor approval per collector | Highly sensitive documents (PHI, classified) |
Configuration Example
How Each Model Works
Model: open
Behavior:
- Any collector can sign up (KYC optional)
- Any collector can search and retrieve
- No lock type declarations required
- Standard rate limiting applies
- Public records
- Standard insurance declarations
- Documents intended for broad distribution
Model: declared
Behavior:
- Collector must complete KYC
- Collector must declare which lock types they have access to
- System validates: collector can ONLY use declared lock types
- Access denied if collector tries undeclared locks
- Most insurance documents
- Mortgage documents
- Any document where legitimacy matters
Model: invited
Behavior:
- Distributor generates invite codes/links
- Only collectors with valid invites can access
- Invites can be scoped (specific artifact types or all artifacts)
- Invites can expire
- Known business partners
- Contractual relationships
- When distributor wants control over who accesses
Model: restricted
Behavior:
- Combines
declared+invited+ admin approval - Collector must complete KYC with declarations
- Collector must have invite from distributor
- Admin must approve the collector-distributor relationship
- Highest security tier
- Healthcare documents (PHI)
- Classified documents
- Documents requiring regulatory compliance
Collector Onboarding Flow by Model
2. Design Gaps & Mitigations (Updated for Configurable Model)
2.1 The Brute Force Problem → SOLVED by declared model
Attack: Automated guessing of lock values
Solution:
- Use
declaredorrestrictedmodel - Collector must declare the lock type in KYC
- Even if they guess the value, they can’t use it without declaring it first
- KYC verification prevents false declarations
- Per-collector rate limits regardless of model
- Anomaly detection for unusual access patterns
- CAPTCHA after N failed attempts
2.2 The Social Engineering Problem → MITIGATED by KYC verification
Attack: False declarations during KYC Solutions by Model:| Model | Protection |
|---|---|
open | No declarations needed - accept risk |
declared | Require documentation proof for sensitive locks |
invited | Invite implies existing relationship |
restricted | Admin approval required |
declared model, we can require:
- Proof documentation (carrier agreements, contracts)
- Reference checks with known distributors
- Period re-verification
- Spot-checks by admins
2.3 The Data Leak Problem → ACCEPTED as distributor responsibility
Attack: Collector downloads and misuses data Mitigations:- Watermarking retrieved documents (tracked by model)
- Full audit logging (who, what, when)
- Rate limiting on retrieval volume
- Legal agreements in ToS
- Open model: Distributor assumes full risk
- Declared model: Distributor + Docyard shared (verification of declarations)
- Invited/Restricted: Higher confidence in collector legitimacy
2.4 The Insider Threat Problem → COLLECTOR RESPONSIBILITY
Attack: Employee abuse or credential theft Mitigations:- Audit logging for all retrievals (distributor can review)
- API key rotation recommendations
- Require collector to implement their own access controls
2.5 The Template Pollution Problem → ADMIN VETTING
Attack: Malicious or confusing templates Solution:- All templates require admin approval (already in design)
- Template name/description review
- Reject templates designed for phishing/social engineering
restrictedmodel requires extra vetting
2.6 The Lock Collision Problem → NAMESPACING
Attack: Same lock name, different meanings Solution:- Namespace locks in
declared/restrictedmodels:acme:policy_number - Format validation patterns per distributor
- Document type matching for retrieval
open model for universal search scenarios.
2.7 The Threshold Manipulation Problem → ENFORCE MINIMUMS
Attack: Distributor sets threshold too low Solution:- Minimum threshold enforced by access model:
open: Minimum threshold = 5declared: Minimum threshold = 10invited: Minimum threshold = 10restricted: Minimum threshold = 15
- Admin can override/reject suspicious configurations
- Recommended threshold ranges per lock type
2.8 The Orphan Artifact Problem → SUNSET CLAUSE
Attack: Distributor disappears, artifacts remain accessible Solution:- Auto-revocation after 180 days of distributor inactivity
- Artifacts flagged as “orphaned” after 90 days
- Distributor receives warnings at 60, 90, 180 days
- Admin can extend or transfer ownership
2.9 The Regulatory Compliance Problem → MODEL-BASED
Attack: Documents contain regulated data Solution:- Use
restrictedmodel for regulated content - Mandatory data classification
- Compliance mode for healthcare/finance
- Enhanced audit trails for restricted artifacts
| Content Type | Required Model | Who’s Responsible |
|---|---|---|
| Public records | open | Distributor |
| Standard insurance | declared | Distributor + Docyard (KYC) |
| Mortgage docs | declared | Distributor + Docyard (KYC) |
| Healthcare (PHI) | restricted | Distributor + Docyard + Admin |
| Classified | restricted | Distributor + Admin |
2.10 The Geographic Jurisdiction Problem → DATA RESIDENCY
Attack: Multi-jurisdiction compliance issues Solution:- Configure data residency per artifact type:
- Region-specific encryption keys
- Legal hold capabilities for restricted model
3. REVISED: Artifact Type Template Schema
4. REVISED: MVP Security Model
For initial release, support ALL models but with different KYC requirements:| Model | MVP Support | KYC Required | Admin Vetting |
|---|---|---|---|
open | ✅ Yes | Optional | Template only |
declared | ✅ Yes | Required | Template + KYC |
invited | ✅ Yes | Required | Template + KYC |
restricted | ✅ Yes | Required + Proof | Template + KYC + Admin |
MVP Implementation Priority:
Phase 1 (Launch):openmodel - immediate deploymentdeclaredmodel - with basic KYC
invitedmodel- Enhanced KYC with documentation
restrictedmodel- Admin approval workflow
5. REVISED: Discussion Points
Point 1: Configurability gives distributors control but adds complexity. Do we provide clear guidance on which model to choose? Point 2: Thedeclared model is likely to be most popular. Do we make it the default for new templates?
Point 3: Model mixing: Should a collector with declared access to Carrier A’s documents also access Carrier B’s declared documents? Or is it scoped by invite/relationship?
Point 4: Admin overhead: restricted model requires manual admin approval. What’s our SLA for approvals?
Point 5: Lock type verification in declared model: Do we require proof for ALL declarations or just sensitive ones (SSN, DOB)?
6. Implementation Checklist
- Add
access_controlobject to template schema - Implement collector lock declaration during KYC
- Build invite system infrastructure
- Create admin approval workflow for
restrictedmodel - Add data residency configuration
- Implement auto-revocation for inactive distributors
- Build audit logging for all models
- Create distributor guidance on model selection
- Add rate limiting per model tier
- Build anomaly detection for
openmodel
This document reflects the configurable security model per artifact type. Updated based on decision to allow all options.