Skip to main content

Encrypted session storage for Google ADK — drop-in replacement for DatabaseSessionService with at-rest encryption

Project description

CI License PyPI Python Coverage docs vetted

adk-secure-sessions

The compliance gateway for Google ADK — add encrypted sessions in 5 minutes.

ADK's built-in session services store all data unencrypted. If your agents handle PHI, PII, or financial data, that's a compliance gap. adk-secure-sessions is a drop-in replacement for DatabaseSessionService that encrypts state and conversation history at rest, so you can close the encryption-at-rest gap without changing your agent code.

Install

pip install adk-secure-sessions

Or with uv:

uv add adk-secure-sessions

3 direct runtime dependencies: google-adk, cryptography, aiosqlite.

Quick Start

# Before (ADK default — unencrypted):
from google.adk.sessions import DatabaseSessionService
session_service = DatabaseSessionService(db_url="sqlite:///sessions.db")

# After (encrypted — swap the import and constructor):
from adk_secure_sessions import EncryptedSessionService, FernetBackend, BACKEND_FERNET
session_service = EncryptedSessionService(
    db_path="sessions.db", backend=FernetBackend("your-secret-key"), backend_id=BACKEND_FERNET
)

Use session_service exactly like any ADK session service — create_session, get_session, list_sessions, delete_session, and append_event all work the same way. Wrap in async with for automatic cleanup — see Documentation for details.

What Gets Encrypted

Data Encrypted Rationale
state values (user_state, app_state, session_state) Yes Contains sensitive user/app data
events (conversation history) Yes Contains user messages, tool outputs, PII
session_id, app_name, user_id No Needed for lookups and filtering
create_time, update_time No Needed for expiration/cleanup

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adk_secure_sessions-1.0.1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adk_secure_sessions-1.0.1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file adk_secure_sessions-1.0.1.tar.gz.

File metadata

  • Download URL: adk_secure_sessions-1.0.1.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for adk_secure_sessions-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ba22583c46814fabb32b6eaa4f79486ee4044e5372aee1978cc515271c8e1180
MD5 c55c851c0ee954a8c05a34bced283e05
BLAKE2b-256 d8f76902068c1250d4c597073227f79d68b8fbe572886fea1eaa7609f80bd919

See more details on using hashes here.

File details

Details for the file adk_secure_sessions-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: adk_secure_sessions-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for adk_secure_sessions-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89ddf21145e87aaa250bece2de27c80ce98896043c9e6766ebb2854725ca5a16
MD5 a28c15f648fd05e0e66bc390933f7ae6
BLAKE2b-256 3dfde711accde44c07f842574f98452a4c2fbeaf720f038198bbf4673e22fd8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page