Skip to main content

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 wrapping ADK's 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

2 direct runtime dependencies: google-adk, cryptography.

Quick Start

# Before (ADK default — unencrypted):
from google.adk.sessions import DatabaseSessionService

session_service = DatabaseSessionService(db_url="sqlite+aiosqlite:///sessions.db")

# After (encrypted — swap the import and constructor):
from adk_secure_sessions import EncryptedSessionService, FernetBackend

session_service = EncryptedSessionService(
    db_url="sqlite+aiosqlite:///sessions.db", backend=FernetBackend("your-secret-key")
)

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.

Migration note (v1.1.0): The constructor API changed from (db_path, backend, backend_id) to (db_url, backend). Existing databases from v1.0.x are incompatible — create a fresh database when upgrading.

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

Examples

See examples/ for runnable scripts. The basic usage example runs a multi-turn ADK agent conversation with Ollama and proves that state and conversation history are encrypted at rest.

uv run python examples/basic_usage.py

Requires OLLAMA_API_BASE in your environment or .env file.

Metadata

Release files for adk-secure-sessions 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adk-secure-sessions 1.3.1
File Size Uploaded Provenance Actions
adk_secure_sessions-1.3.1.tar.gz 30.0 kB Without provenance Details for adk_secure_sessions-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adk-secure-sessions 1.3.1
File Interpreter ABI Platform Actions
adk_secure_sessions-1.3.1-py3-none-any.whl Python 3 none any Details for adk_secure_sessions-1.3.1-py3-none-any.whl

Total release size: 66.0 kB

Release files / adk_secure_sessions-1.3.1.tar.gz

Download URL adk_secure_sessions-1.3.1.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3b7c70209338f2fbc72aef59bc30a03ff5e60811d8e9b9a9bfd1fc945c343381
BLAKE2b-256 checksum
How to use checksums
5fedb8a47e5f0c5ad96051bdea6bf161c1d0062be1545d8e36dbb4b05743f435
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","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}

Release files / adk_secure_sessions-1.3.1-py3-none-any.whl

Download URL adk_secure_sessions-1.3.1-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6188f575f8ee7964bac6666534cf50db02b2ca0e4c2891cd809c565111d3ee11
BLAKE2b-256 checksum
How to use checksums
79930af3da421b54d370dbf154257c71f24c9ac8be10017567f20134e9d47c23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","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}

Security for adk-secure-sessions 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page