Skip to main content

Encrypted session persistence for Google ADK agents

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 an encrypted session service implementing ADK's BaseSessionService 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.3.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.3-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adk_secure_sessions-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 f206983c7dc73b33710cd9b8f4ac88911dc435aba92e4f78bce77d7d35bc6359
MD5 0de4244e71d6fd00807cf7ba660ac661
BLAKE2b-256 d62897894fa16d8d2888396f4ce5f9b99994b6f9e25ee315096fed77cbf4a23c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: adk_secure_sessions-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8266e09e9beacf2de8cb92cf19dcd07885feb218f0e803fcd59711c25a57338e
MD5 db528f868dda095d02cf91b679d67abe
BLAKE2b-256 3d0698cac8d2a67d4345d862f248ae7d258a5a7f3cd94b137fdd95ead254b450

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