braintrustdata / braintrust-proxy

https://www.braintrustdata.com/docs/guides/proxy
MIT License
266 stars 24 forks source link

Ensure cache encryption is not reversible #46

Closed morgante closed 2 months ago

morgante commented 2 months ago

Fixes https://github.com/braintrustdata/braintrust-proxy/issues/44

As demonstrated in the test script, the previous encryption strategy was reversible as long as you had the OpenAI key used. At least for my use case, this violates the guarantees we try to give customers of not retaining copies of their data.

This switches it to use the request data itself as the encryption key, such that you can't decrypt the cache unless you actually have the original user request in hand.

Note: I don't have a Vercel or Node server handy, so this has only been tested with Wrangler/Cloudflare.

vercel[bot] commented 2 months ago

@morgante is attempting to deploy a commit to the BrainTrustData Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai-proxy ❌ Failed (Inspect) Apr 8, 2024 3:31pm
morgante commented 2 months ago

Let me know if you are blocked on this, and if so, we'll make sure to move things along faster.

Not blocked, I've already deployed a version of this for our usage.

ankrgyl commented 2 months ago

Ok we are ready to land this! Thanks again for the contribution