---
type: email
from: Kazuhiro Sera <notifications@github.com>
subject: Re: [openai/openai-agents-python] Encrypt sessions (PR #1674)
received: 2026-03-06 07:24:19
date_header: Sun, 07 Sep 2025 22:30:12 -0700
priority: normal
status: awaiting_approval
uid: 29730
---

## Email Content

**From:** Kazuhiro Sera <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] Encrypt sessions (PR #1674)
**Date:** Sun, 07 Sep 2025 22:30:12 -0700

### Body (preview)

@seratch requested changes on this pull request.







> +    This class wraps any SessionABC implementation to provide transparent

+    encryption/decryption of stored items using Fernet encryption with

+    per-session key derivation and automatic expiration of old data.

+

+    When items expire (exceed TTL), they are silently skipped during retrieval.

+

+    Note: Expired tokens are rejected based on the system clock of the application server.

+    To avoid valid tokens being rejected due to clock drift, ensure all servers in

+    your environment are synchronized using NTP.

+    """

+

+    def __init__(

+        self,

+        session_id: str,

+        underlying_session: SessionABC,

+        encryption_key: str | None = os.getenv("ENCRYPTION_KEY", None),



The env variable sounds too general, so we prefer letting users decide the env name (or using a different way to pass the secret key). Can you remove this default value, plus the adjust the L130 error message?



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1674#pullrequestreview-3195001839

You are receiving this because you are subscribed to this thread.



Message ID: <openai/openai-agents-python/pull/1674/review/3195001839@github.com>

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
