KVStash security: treat the KV cache like the prompts it came from.
KV cache is as sensitive as the prompts it was computed from. KVStash is self-hosted, authenticates every connection to a namespace and checksums every block. TLS is not yet available.
Last updated
Where the security boundary sits.
The store runs on your machines, next to your inference servers, and writes to a bucket you own. We run no hosted service, so your prompts, model weights and KV cache do not pass through us.
What KVStash covers, and what you provide.
Each control, what the store does about it today, and what stays your responsibility.
| Area | What KVStash does | What you provide |
|---|---|---|
| Network transport | Plaintext TCP. The bearer token crosses the wire once per connection, in HELLO. | A private network only your inference servers can reach, or your own tunnel or TLS terminator. |
| Authentication | Tokens stored as SHA-256 digests and compared in constant time. An empty registry refuses every connection. | Issuing, storing and rotating tokens. |
| Tenant isolation | Namespace stamped on every operation. Another tenant's key answers as a miss. DRAM quotas enforced. | Separate stores where timing side channels matter. NVMe and S3 quotas are reported, not enforced. |
| Integrity | xxh3 checksum per block, verified on NVMe and S3 reads. CRC32C on frame headers. Write-once blocks. | Nothing extra. |
| Encryption at rest | Not yet. Blocks are stored as written. | Disk and bucket encryption from your platform. |
| S3 credentials | Read from the standard AWS credential chain only. None in KVStash configuration. | A role scoped to one bucket. |
| Admin API | Binds to a loopback address and refuses any other. | Control of who gets a shell on the host. |
| Metrics | /metrics and /healthz, including per-tenant usage and authentication failures. | Keeping both on the private network. |
Is KV cache sensitive data?
Yes. The KV cache holds the attention state a model computed from every token of a prompt: system prompts, documents, code and earlier turns of a conversation. Give it the same access rules, retention rules and network boundary as the prompts themselves.
Shared prefix caches also carry a timing risk: a cache hit returns faster than a miss, which can tell one user something about another user's prompts. NVIDIA's guidance on securing the KV cache recommends isolating caches between tenants where that matters. KVStash namespaces give you that separation at the store.
How do clients authenticate?
The first frame on every connection must be HELLO, carrying a namespace and a bearer token. Anything else sent first closes the connection, and so does a failed HELLO.
- The server stamps the namespace. Every later operation on the connection (exists, get, put, lease, pin, delete) runs under the authenticated namespace. A client cannot name another tenant's namespace in a request.
- Tokens are compared as digests. The registry keeps SHA-256 digests, not tokens, and compares in constant time. An unknown namespace takes the same path as a wrong token, so a response does not reveal which namespaces exist.
- Failures are counted in
/metrics.
How are tenants kept apart?
Each tenant is a namespace, and every block is keyed by (namespace, block key). The same block key written by two tenants is two separate blocks.
- No cross-tenant view. A request for another tenant's key answers exactly like a miss.
- Quotas. Each namespace has a DRAM byte quota, enforced on write. Hard pins draw on a separate pinned-bytes quota.
- Pins and leases stay in their namespace, so one tenant cannot hold another's data in place or crowd it out beyond its quota.
- Over-quota tenants are evicted first when memory runs short.
NVMe and S3 quotas are reported but not yet enforced. Tenants on one store share its memory, disks and network, so one tenant's load can affect another's speed, and namespaces do not remove timing side channels on shared hardware.
How does KVStash protect data integrity?
Blocks are opaque and write-once. The store does not parse tensors; it keeps the bytes the engine wrote and returns them unchanged. A checksum mismatch on an NVMe or S3 read is counted and answered as a miss, and the engine recomputes that part of the prompt. A second write of the same key with different bytes is refused and reported as a corruption alarm.
| Test | Result |
|---|---|
| Bytes flipped in the NVMe tier | 47 checksum errors caught; no damaged block reached an output |
| Cost of checksum verification | about 20 ms on a 28k-token prompt |
| Daemon killed during a write storm | 100 loops: 0 corrupt and 0 phantom blocks over 18,160 acknowledged writes |
How does the S3 tier get its credentials?
Only from the standard AWS credential chain: environment variables, the shared AWS config or the instance role. KVStash's own configuration holds no AWS credentials. Grant the role access to one bucket and nothing more. Objects are written under a per-node prefix, one sealed NVMe segment per object, and every block read back is checksum-verified before it is served.
What we do not claim.
- A security certification or third-party audit.
- Encryption at rest. Use the disk and bucket encryption your platform provides.
- TLS on the data plane. Use a private network or your own encrypted tunnel.
- Isolation from timing side channels between tenants on shared hardware.
- A hosted service, so no data held by us and no service-level agreement.
Report a vulnerability.
Email rudray@kvstash.com with "Security report" in the subject. Please include:
- The component and version: the daemon, or which connector or adapter package.
- What the issue is and what an attacker could do with it.
- Steps to reproduce that you can share safely.
Leave out live credentials and personal data, and keep details private until we have agreed a disclosure date with you. We confirm receipt by email and keep you updated on the fix.
Email a security reportSecurity questions about your deployment?
Tell us how your inference servers and storage are laid out, and we will say where KVStash fits inside your network boundary and what it does not cover yet.
Or write to rudray@kvstash.com