For deployments where the server public key is not shipped with the SDK,
a caller-supplied EC P-256 public key can be supplied via any of three
paths (precedence is programmatic > one-time token > pre-existing config):
from keeper_secrets_manager_core import SecretsManager
from keeper_secrets_manager_core.storage import FileKeyValueStorage
# Programmatic — wins over the other two if all are present
sm = SecretsManager(
token='REGION:ONE_TIME_TOKEN',
server_public_key='url-safe-base64-EC-P256-public-key',
server_public_key_id='your-key-id',
config=FileKeyValueStorage(),
)
The one-time-token form embeds the key material directly:
REGION:clientKey:keyId:serverPublicKeyBase64 (4 colon-separated
segments). The config-file form sets serverPublicKey and
serverPublicKeyId in the JSON config before the first call.
For deployment-specific details (region prefixes, key id assignments)
see the official docs link above.
Change Log
18.0.0
Breaking: The minimum Python version is now 3.10 (KSM-1214). The urllib3 fix for CVE-2026-44432 needs Python 3.10. Python 3.9 users stay on 17.3.0, and pip selects that version automatically.
KSM-1693 - Raised the dependency floors to cryptography>=50.0.0, requests>=2.33.0, and urllib3>=2.8.0. Added certifi>=2026.10.19 as an explicit floor. These versions include the fixes for CVE-2026-39892 and CVE-2026-69247 (cryptography); CVE-2026-25645 (requests); CVE-2026-44432, CVE-2026-97687, CVE-2026-97688, and CVE-2026-97689 (urllib3); and GHSA-6q48-6c7w-9gw2 (certifi). KSM-1213 raised the earlier cryptography floor.
KSM-1842 - Added idna>=3.15 as an explicit floor. pip upgrades an older idna when it installs this release.
KSM-1122 - KSMCache now writes the cache file with mode 0600 (owner read and write only). The SDK also sets mode 0600 on an existing cache file at the next write.
KSM-1823 - On Windows, now gives the cache file an owner-only ACL before it writes the data. Only the current user and Administrators have access, as for the config file. The SDK creates a new cache file with this ACL. At the next write, it also sets this ACL on an existing cache file and makes the current user its owner. Each Windows account must use its own cache file, for example its own . If the SDK cannot set the ACL, it removes the cache file and does not write the data. To skip the ACL, set to . Mode 0600 (KSM-1122) applies on Linux and macOS.
KSMCache
KSM_CACHE_DIR
KSM_CONFIG_SKIP_MODE
TRUE
KSM-1019 - KSMCache honors an explicit kms_cache_file_name assignment again. Version 17.3.0 ignored it. An explicit assignment now takes precedence over KSM_CACHE_DIR. If the SDK cannot write the cache file after a successful request, KSMCache.caching_post_function now returns the live response. It also logs a warning when SDK logging is enabled.
KSM-1043 - get_folders() decrypts nested folders of any depth. The SDK chooses AES-CBC or AES-GCM from the size of each folder key.
KSM-1057, KSM-1811 - create_folder() encrypts the folder key and the folder name with AES-CBC, as in 17.3.0.
KSM-1059 - update_folder() uses the same cipher as the folder. A folder with a GCM key now carries a use_gcm flag.
KSM-1877 - Fix update_folder() to keep the color and other JSON fields when it renames a classic subfolder. KeeperFolder.data holds the decrypted JSON. If complete data is missing, the SDK reads get_folders() once more. It sends no update if the data is still unavailable. NSF behavior stays the same.
KSM-1271 - get_folders() now works as the first call of a client that uses a new one-time token. Before, it raised "Required config key 'appKey' is missing". It also finishes the binding of the client, so the server accepts the next write. If this first call fails, the SDK removes the incomplete config file and raises the "Initialization failed" error, as get_secrets() does.
KSM-1051 - Added write support for NSF (Keeper Drive) folders that are shared directly to the application. When the target folder is an NSF folder, create_secret() and create_secret_with_options() send the NSF payload. These two methods get NSF folders from get_secrets(), and they request only the target folders. delete_secret() and delete_folder() log each result item that is not ok. When the response has no items, both methods now return an empty list. Before, they returned None or an empty dictionary. KeeperError has the new attributes result_code, status_code, and additional_info.
KSM-1051 - The SDK does not create, rename, or delete NSF (Keeper Drive) folders for now. create_folder() raises KeeperError when folders comes from get_folders(include_nsf=True) and shows that the parent folder or the shared folder is an NSF folder. get_folders() without include_nsf cannot identify an NSF folder, so the SDK cannot refuse the create for it. If the shared folder is not in folders, create_folder() raises KeeperError and sends nothing. Otherwise it sends the request, and the request always has a shared folder UID. update_folder() renames only a subfolder of a shared folder. For any other folder, it raises KeeperError and sends no update_folder request. For a shared folder, that KeeperError has the result_codeaccess_denied and no status_code. If you pass folders, pass the result of get_folders(). delete_folder() sends a get_folders request first, so each call sends one more request. Pass all UIDs in one call to send that request once. On a new client, this first request also finishes the binding, as get_folders() does. delete_folder() sends only subfolders of shared folders. For each other UID, it sends nothing and returns the item that the server gives for a shared folder or for an unknown folder. In 17.3.0, delete_folder() sent every UID to the server, also the UID of an NSF folder. Now it sends nothing for an NSF folder and returns the item for an unknown folder, with the responseCodedoesnt_exist. Do not treat that result as proof that the folder is gone. Pass one UID string or a list of UID strings. Any other value that is not an iterable of strings raises KeeperError. Test code that queues responses must also serve the get_folders request. prepare_create_folder_payload() raises KeeperError for is_drive=True or an empty or blank shared folder UID.
KSM-1051 - get_folders() has a new keyword argument include_nsf (default False). With include_nsf=True, it also sends one get_secret request with no filter. It adds each NSF (Keeper Drive) folder that the response lists: a folder that is shared directly to the application and holds at least one record. That request downloads every record that the application can access, and it fails above the server record limit. An NSF folder in the result has no parent and has is_drive=True. The default result does not change.
KSM-1683 - get_folders() now reads a top-level folder name that is encrypted with AES-GCM and sets use_gcm for that folder. Before, it skipped the folder. The SDK also reads an NSF folder name that the server sends zero-padded. In get_secrets(), a folder entry with folder data is an NSF folder. Folder.is_drive, the new Record.is_drive, and the new SecretsManagerResponse.drive_folder_uids show this.
KSM-1080 - get_folders() skips a folder that it cannot decrypt and logs an error. It returns the other folders.
KSM-1145 - get_secrets() returns each record once when the record is reachable through both a shared folder and a direct share.
KSM-1281 - get_folders() no longer hangs when folder data contains a parent cycle. The SDK raises a KeeperError for that folder, skips it, and returns the other folders.
KSM-1612 - A malformed proxy URL now raises a KeeperInvalidURLError that does not contain the URL. It is both a KeeperError and a requests.exceptions.InvalidURL, so existing handlers still match. Before, the requests error text could include the proxy password.
KSM-1582 - get_secrets() skips a record in a shared folder that it cannot decrypt, and returns the other records of that folder. The skipped record appears in bad_records of the full response. Before, one bad record hid the whole folder.
17.3.0
KSM-992 - Added a typed KeeperRecordLink linked-credential accessor layer and Record.get_links(). Provides Java-parity accessors (is_admin_user(), is_launch_credential(), permission booleans such as allows_rotation()/allows_connections(), get_link_data_version(), get_decoded_data(), encryption detection, AES-256-GCM get_decrypted_data(), get_link_data(), and get_ai_settings_data()/get_jit_settings_data()/get_settings_for_path()) plus accessors for the current link payload shape verified against the live backend: meta self-links (get_meta_data(), get_allowed_settings()), is_iam_user(), belongs_to(), no_update_services(), ai_enabled(), ai_session_terminate() and get_rotation_settings(). Permission booleans read both top-level keys and the nested allowedSettings. Purely additive — the raw record.links list is unchanged, and each typed link keeps the untouched original dict in .raw.
KSM-877 - Added automatic throttle retry with exponential backoff. On HTTP 403 {"error":"throttled"}, requests are retried up to 5 times with exponentially increasing delays (11s, 22s, 44s, 88s, 176s) plus ±25% jitter, honoring retry_after from the response when present; a typed KeeperThrottleError (subclass of KeeperError) is raised once retries are exhausted. Existing key-rotation retry behavior is unchanged.
KSM-807 - Fixed partial client-config.json left behind after a failed initialization (expired or consumed One-Time Token). The SDK now deletes the incomplete config file on failure so users are not silently trapped in a retry loop. The error message names the file and instructs the user to generate a fresh token.
KSM-932 - IL5 custom server public key support — supports three provisioning paths: config field (serverPublicKey), OTS token extension (4-segment IL5 format), and programmatic parameter (server_public_key on SecretsManager)
KSM-808 - Config-decoding utilities (base64_to_bytes, url_safe_str_to_bytes, base64_to_string, CryptoUtils.url_safe_str_to_bytes) now raise KeeperError with actionable messages instead of cryptic TypeError when passed None from an incomplete config or empty server response field. Per-call-site guards in core.py name the specific missing ConfigKey (appKey, clientKey) and direct users to reinitialize with a fresh One-Time Token.
KSM-813 - Fixed set_config_mode() Windows ACL sequence to remove all Everyone access (not just Full Control)
KSM-819 - Fixed RecordCreate.to_dict() silently dropping "custom": [] from the serialized payload (Python falsy check treated empty list as absent). Records created via the SDK now correctly include "custom": [], matching Commander and Vault behavior.
KSM-1004 - KSMCache now resolves the cache file path from KSM_CACHE_DIR at call time instead of once at import. The documented env var is honored whenever it is set, not only when set before keeper_secrets_manager_core.core is imported. Default behavior is unchanged (ksm_cache.bin in the current working directory when the var is unset).
17.2.1
KSM-900 - Added IL5 (DoD Impact Level 5) region support — token prefix IL5 resolves to il5.keepersecurity.us
17.2.0
Breaking: Minimum Python version raised from 3.6 to 3.9
Python 3.6-3.8 users: pip will automatically install v17.1.x (no action needed)
Security/bug fixes backported to v17.1.x until August 2026 via legacy/sdk/python/core/v17.1.x branch
Security: KSM-777 - Raised dependency floors to resolve multiple CVEs
KSM-371 - Fix Windows Config file permissions issue
KSM-370 - Upgrade to latest cryptography>=39.0.1 library
16.5.0
KSM-313 - Improved Keeper Notations. New parser, new escape characters, Notation URI, search records by title and other meta data values in the record
KSM-319 - KEY_CLIENT_KEY in configurations is missing in certain situations
KSM-356 - Ability to create of the new custom field
16.4.2
Fix to support dynamic client version
16.4.1
Upgrading and pinning cryptography dependency to 38.0.3
16.4.0
Record deletion
KSM-305 - Support for Canada and Japan data centers
KSM-308 - Improve password generation entropy
KSM-240 - Config file permission checking (Create new client-config.json with locked down permission/ACL mode. Print STDERR warning if client-config.json ACL mode is too
open. To disable ACL mode checking and setting, set environmental variable KSM_CONFIG_SKIP_MODE to TRUE. To prevent
warnings of the client-config.json being too open, set environmental variable KSM_CONFIG_SKIP_MODE_WARNING to TRUE.
For Unix, client-config.json is set to 0600 mode. For Windows, client-config.json has only the user that created
the client-config.json and the Administrator group.)
16.3.5
Removed non-ASCII characters from source code. Added Python comment flag to allow non-ASCII to source code, just in case.
Allow enforceGeneration, privacyScreen, and complexity in record fields when creating a record.
Record creation validation. Making sure that only legitimate record field types, notes section, and title of the record can be saved
16.3.4
Provide better exception messages when the config JSON file is not utf-8 encoded.
Alternatives
Use instead of keeper-secrets-manager-core: tools that do the same job, closest first.