sensitivity field. Every retrieval request carries a TrustContext that declares the maximum sensitivity the caller is allowed to access. Records above the threshold are filtered out or returned in redacted form.
Sensitivity levels
Sensitivity is an ordered scale from least to most restricted:| Level | Value | Numeric rank | Meaning |
|---|---|---|---|
| Public | public | 0 | Freely shareable content |
| Low | low | 1 | Minimal sensitivity |
| Medium | medium | 2 | Moderately sensitive content |
| High | high | 3 | Highly sensitive, elevated trust required |
| Hyper | hyper | 4 | Maximum protection |
MaxSensitivity:
TrustContext fields
The highest sensitivity level the caller may read in full. Records at this level and below are returned with their payload intact.
Whether the requester has been authenticated via API key or other mechanism. Currently recorded in the trust context but does not independently gate access —
MaxSensitivity is the primary control.Identifier for the requesting actor (user ID, agent name, service account). Recorded in audit entries for traceability.
Optional list of allowed scopes. If non-empty, only records whose
scope field matches one of these values are returned. Records with an empty scope are unscoped and bypass this check.Retrieval behavior by level
TheFilterByTrust function in pkg/retrieval/filter.go applies two rules per record:
- Full access — record sensitivity ≤
MaxSensitivity: returned with full payload. - Redacted access — record sensitivity is exactly one level above
MaxSensitivity: returned with metadata only (no payload, no provenance, no audit log). - Denied — record sensitivity is two or more levels above
MaxSensitivity: not returned at all.
Redacted records
A redacted record retains the following fields:ID,Type,Sensitivity,Confidence,SalienceScope,Tags,CreatedAt,UpdatedAt
Payload(set tonil)Provenance(empty)AuditLog(empty)Relations(empty)
Example: graduated access
If a caller setsMaxSensitivity: medium:
| Record sensitivity | Returned as |
|---|---|
public | Full record |
low | Full record |
medium | Full record |
high | Redacted (metadata only) |
hyper | Not returned |
Scope filtering
When aTrustContext includes a non-empty Scopes list, records with a non-empty scope must match at least one value in that list. Records with an empty scope are considered unscoped and are always included regardless of the Scopes filter.
Code examples
- Go
- TypeScript
- Python
Retrieval without a trust context
Passing anil trust context to Retrieve or RetrieveByID returns ErrNilTrust. All retrieval calls must include a trust context.
Layered retrieval order
When noMemoryTypes filter is specified, records are queried in this canonical order before trust filtering is applied: