feat: enhance security by adding security_tier parameter and improving secure memory handling

This commit introduces the security_tier parameter to all SecureChatCompletion calls, allowing users to specify security levels (standard, high, maximum). It also refactors secure memory management in SecureCompletionClient.py to use secure_bytearray instead of secure_bytes, improves memory protection by aligning addresses to page boundaries, and enhances the secure memory locking mechanism. The README.md has been updated to document the new security_tier parameter and include missing import statements.
This commit is contained in:
Alpha Nerd 2026-02-03 13:59:46 +01:00
parent 2fae7d1d24
commit 5641a746b7
4 changed files with 509 additions and 127 deletions

View file

@ -30,6 +30,7 @@ async def main():
messages=[
{"role": "user", "content": "Hello! How are you today?"}
],
security_tier="standard", #optional: standard, high or maximum
temperature=0.7
)
@ -156,6 +157,7 @@ async def main():
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
security_tier="standard", #optional: standard, high or maximum
temperature=0.7
)
@ -167,6 +169,7 @@ asyncio.run(main())
### With Tools
```python
import asyncio
from nomyo import SecureChatCompletion
@ -194,6 +197,7 @@ async def main():
}
}
],
security_tier="standard", #optional: standard, high or maximum
temperature=0.7
)