OpenAgentID documentation
Start here

Key management

Generation, persistence, recovery boundaries, and implementation-specific derivation.

Key material, identity documents, and authorization are separate objects. A seed can restore keys only according to the algorithm and binding used by that SDK. It does not restore a broker grant, an issued session, a revocation decision, or an authority anchor.

Current SDK behavior

ImplementationEncryption-key derivation and boundary
TypeScriptInjected KeyCryptoBinding. Uses BLAKE3 context arsenal.agent.encryption_key. Deterministic X25519 restoration requires x25519_public_from_secret; without it the current fallback generates a new encryption keypair.
PythonUses BLAKE3 when available; otherwise HKDF-SHA256. Preserve dependency configuration as part of restoration.
GoUses BLAKE2b in the current key implementation.
SwiftUses HMAC-SHA256 in the current key implementation.
KotlinUses SHA-256 in the current key implementation.
Rust facadeNo public openagent_sdk::keys module exists in this snapshot. Use the concrete OAS/Arsenal key and identity APIs required by your integration.

Do not assume the same seed produces the same encryption identity across languages. Canonical ACT interoperability is a separate contract. Preserve the implementation, algorithm, dependency versions, and derivation parameters with your recovery procedure.

Seed files are not encrypted vaults

TypeScript and Python expose seed-file helpers. The file carries raw seed bytes. A requested owner-only file mode does not add encryption, secure deletion, an HSM, or protection against another process with the same account. Rewriting an existing file may retain its existing permissions; provision the file securely and check effective access.

Use a managed secret store or an encrypted key store for your deployment's custody requirements. Do not print the seed, place it in a URL, ship it to the browser bundle, or commit it with source. Keep recovery material separate from application logs and documentation exports.

Python restoration within one implementation

from pathlib import Path
from openagent_sdk import generate, save_seed, from_seed_file

seed_path = Path("agent.seed")
if seed_path.exists():
    raise FileExistsError("Choose a new owner-only seed file")
original = generate()
save_seed(original, str(seed_path))
restored = from_seed_file(str(seed_path))
assert original.verifying_key == restored.verifying_key

The assertion checks the signing public key, not all cross-runtime encryption behavior. Confirm the exact AgentKeys fields and helper behavior in the Python source reference.

TypeScript binding prerequisites

setKeyCryptoBinding accepts Ed25519, X25519, and BLAKE3 functions. The current WASM source exports x25519_generate_keypair and x25519_diffie_hellman, but not x25519_public_from_secret. Therefore that direct binding alone does not provide deterministic encryption-key restoration through the TypeScript facade's fallback. Preserve existing encryption keys using your application's custody system until an appropriate complete binding is supplied and tested.

The TypeScript ACT example only installs the ACT verification binding; it deliberately does not claim complete key-custody initialization.

Rotation and recovery

Rotation, recovery, and authority changes require the relevant OAS/AEGIS protocol and storage integration. Changing a local seed does not itself rotate a published DID, update a lineage proof, revoke old capabilities, or migrate encrypted material. Plan those operations explicitly and verify old and new trust states before retiring a key.

Source: openagent-sdk/sdks/typescript/src/keys.ts, Python keys.py, Go openagent/keys.go, Swift Keys.swift, Kotlin Keys.kt, and Rust src/lib.rs. Memory-zeroization guarantees are implementation-specific; these docs do not promise that managed-runtime values never enter swap or remain inaccessible after use.

On this page