Session Keys
What Are Session Keys?
As the digital asset ecosystem moves toward automation, the requirement for a human to sign every individual transaction can create significant friction. Session keys solve this by acting as a form of delegated authority. Instead of giving an AI agent full access to your primary private keys, you use your signer (hardware wallet) to issue a temporary, restricted key that allows the agent to perform a specific set of actions on your behalf.
The session key is a separate cryptographic entity that is only valid under the conditions you set. This approach allows a user to define the boundaries of what an autonomous system can do. By using session keys, you can authorize an agent to manage high-frequency tasks, such as rebalancing a portfolio or claiming rewards, without needing to manually verify every sub-task.
How Do Session Keys Work?
The issuance of a session key is a structured process of cryptographic delegation. To ensure security and cross-platform interoperability, this workflow utilizes ERC-4337 (Account Abstraction), which enables programmable transactions known as “UserOperations,” and ERC-6900, which provides a modular framework for adding specific session logic to a smart account. Together, these standards ensure every action is verified through the following stages:
- Define Scope: The user establishes permissions, volume limits (a daily “budget”), and a Time-to-Live (TTL) expiration window. These rules are codified within the smart account’s policy engine (the specific set of rules, such as spending limits and allowed addresses, currently enforced by the owner).
- Human Approval: The user employs their signer to authorize the session. By verifying these parameters with their personal hardware, the human owner provides the root of trust for the agent’s temporary authority.
- Agent Uses Session Keypair: Once authorized, the AI agent uses its own session keypair to sign transactions. The agent never gains access to the user’s private keys.
- Smart Account Validates: When an agent submits a transaction, it is first processed by the EntryPoint (a high-security gatekeeper contract on the blockchain) or the smart account’s internal validator. These systems act as a digital judge, verifying the agent’s cryptographic signature and ensuring the action strictly follows the policy engine.
- Auto-Expiry and Revocation: The session key automatically becomes invalid once the Time-to-Live window expires. Additionally, the human owner can manually revoke the key at any time via a physical button press on their device (kill switch), instantly cutting off the agent’s access.
Without session keys, a user would be forced to choose between total delegation (highly risky) or constant manual intervention (inefficient). As such, session keys provide the necessary balance between the efficiency of Autonomous Agents and the security of human ownership.