Integrate delegated session keys
- Generate a dedicated session public/private keypair for automation.
- Choose the narrowest
acl_scopethat still matches the request family you need to automate. - Build a delegated payload with explicit expiry and the session public key.
- Sign the delegated payload with the wallet EIP-712 signer.
- Attach the delegated payload bytes to each session-key-signed request.
- Verify server-side acceptance through receipts and event outcomes.
- Rotate or revoke the session key on expiry, ACL change, or automation-host compromise.
Map request families to ACL scope before signing
Use the ACL that corresponds to the exact request family. The operator accepts either the required action orUnrestricted; mismatched scopes reject with a session ACL violation.
| Request family | Required session action |
|---|---|
Order | Order |
ModifyOrder | ModifyOrder |
CancelOrder | CancelOrder |
CancelAll | CancelAll |
Unrestricted unless the automation host genuinely needs that breadth.
Required payload fields
session_signatureexpiryacl_scopesession_public_key
Validate the delegated payload before live use
- Confirm
expiryis comfortably inside the intended automation window. - Confirm
session_public_keymatches the key that will sign requests. - Confirm
acl_scopecovers the exact request family and no broader set than necessary. - Sign a low-risk request in a non-production environment and verify that the server accepts it.
- Intentionally send one out-of-scope request and confirm it rejects as a session authorization failure before relying on the policy in production.
Common failure patterns
| Symptom | Likely cause | What to check |
|---|---|---|
SessionUnauthorized | expired or malformed delegated payload | expiry, payload bytes, and wallet signature |
| session ACL violation | request family not present in acl_scope | action mapping above |
| signer mismatch | session key does not match delegated public key | session_public_key and the actual request signer |
| intermittent accepts/rejects | mixed wallet-signed and session-signed flows | whether every automated request consistently carries the delegated payload |