Skip to main content

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

Project description

CI Coverage PyPI Python License Ruff 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.2.tar.gz (14.1 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.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adk_secure_sessions-1.0.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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.2.tar.gz
Algorithm Hash digest
SHA256 65819e7597bb9917cba9c9a3be09af16ffcc4dd66dc0bb04804de666397f5773
MD5 c76c18cdf8fdfa12cd2870d0919218f9
BLAKE2b-256 10695f9aed6a08d286ab4e8578daead1f6c1631932b79e0123874d38e2b85648

See more details on using hashes here.

File details

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

File metadata

  • Download URL: adk_secure_sessions-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d8318e37741fbb95210a6e3b74d9aa654e1ef7ee7223ea58d36ff17db0a85e43
MD5 c3c9c70461487aac3207c54c0c923741
BLAKE2b-256 2da7097c995db68b782cd5dc41cde0bc14e69ad5a6423545157d2f720bbde84c

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