-
Notifications
You must be signed in to change notification settings - Fork 1
Security and Privacy
TinyJuice handles model-facing context. Treat every input as potentially sensitive.
Inputs may contain:
- prompts
- user messages
- tool output
- file contents
- source code
- credentials
- database rows
- logs with secrets
- private URLs
- conversation identifiers
TinyJuice should not log raw content. Prefer metadata: byte counts, token estimates, content kind, compressor kind, rule ID, profile, and status.
Lossy compaction must be explicit. A lossy compressor should return
CompressOutput::lossy, and the router should only emit it when the exact
original is retained or policy says a lossy view is safe.
Current router policy requires CCR for lossy output.
CCR stores exact originals. That means it is useful and sensitive.
Rules:
- configure memory caps
- configure TTL where appropriate
- place disk tier roots under host-controlled workspaces
- validate tokens before disk access
- never expose arbitrary filesystem reads through retrieval
- never write CCR tokens into public logs with associated raw content
tokenjuice_retrieve returns exact original content. It should follow the host
runtime's normal tool authorization and audit behavior. TinyJuice itself only
provides marker parsing and store retrieval helpers.
Analytics records should include metadata only:
- IDs
- timestamps
- algorithm labels
- content kind
- status
- bytes and token estimates
- latency
- lossy/CCR flags
- source and profile
Do not include raw prompt, context, tool output, file contents, or credentials.
Do not claim exact savings percentages, quality retention, or safety guarantees without benchmark fixtures. The current benchmark harness measures throughput for hot paths, not retained-fact quality.
Before changing privacy-sensitive code, inspect:
src/cache/store.rssrc/cache/marker.rssrc/tool_integration.rssrc/compress.rsSECURITY.md
When in doubt, pass through unchanged rather than producing a smaller but irrecoverable or misleading view.
Token compression for agent context.
Getting started
Concepts
Modules
Agent docs