Skip to content

Commit 266aa99

Browse files
committed
Add security docs for data exfiltration, thread safety, ReDoS, API costs
1 parent 4d32372 commit 266aa99

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,16 @@ Enclave blocks the LLM from accessing your system. It does **not** protect again
251251

252252
**Tool functions run in your Ruby process.** When the LLM calls an exposed function, that function runs in CRuby with full access to your app. The enclave boundary only exists between the LLM's code and your code. Inside your tool methods, you're back in the real world. A tool method that calls `system()` gives the LLM `system()`.
253253

254+
**Data exfiltration through your own tools.** If you expose both read and write tools, the LLM can move data between them. It reads a customer's credit card from one tool, then stuffs it into `create_ticket(subject, body)` where the body contains the card number. Both calls are legitimate. The enclave can't stop this because the LLM is using your tools exactly as designed. Be careful about what data you return from read methods when write methods are also exposed.
255+
256+
**Thread safety.** MRuby is not thread-safe. If you're running Puma with multiple threads and share an enclave instance across requests, you'll get memory corruption. Use one enclave per request, or protect it with a mutex.
257+
258+
**Don't reuse enclave instances across users.** State persists between evals. If you reuse an enclave across different users to save on init cost, user A's variables and method definitions are visible to user B's eval.
259+
260+
**ReDoS.** MRuby supports regex. The LLM can write a catastrophic backtracking pattern like `/^(a+)+$/` against a long string and burn CPU. Same effect as `loop {}` but harder to spot.
261+
262+
**Your API bill.** Nothing stops the LLM from deciding it needs 15 evals to answer one question. Each one is a round-trip through your LLM provider. Cap the number of tool call rounds in your chat loop.
263+
254264
## License
255265

256266
MIT

0 commit comments

Comments
 (0)