You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Privy wallet policies: trade-only, never withdraw #11
Define and attach Privy policies that allow only HL exchange actions (order, cancel, modify, updateLeverage, etc.) and deny withdraw/usdSend/spotSend/transfers and approveAgent. Policy also enforces chain/domain restrictions. Limits from config mirrored where Privy supports them.
Acceptance criteria
Policy JSON versioned in repo (policies/agent-trade-only.json)
Policy applied on init; policy ID stored in config
Implementation merged in #50. The CLI now uses each user's own Privy app, keeps owner authorization locally, attaches the v2 domain/network/no-export policy with owner authorization, verifies policy content on repeated init, and recovers a lost wallet-create/link response. Initialized network/master mismatches are rejected. Tests cover init → attach/persist → status ID/version and local rejection of real withdrawal typed data.
Keeping this issue open for live evidence: run npm run test:sandbox with a dedicated test Privy app, prove a valid Agent signature succeeds, then prove a direct withdrawal-type signing request returns POLICY_REJECTED. Explicit invocation without credentials fails; it is not a live pass. The sandbox creates an empty wallet/policy for inspection and sends no Hyperliquid transaction.
Privy cannot inspect the action contents/notional hidden in Hyperliquid's L1 connectionId hash. Local controls and Hyperliquid API-agent permissions enforce those boundaries; neither the versioned policy nor the sandbox is represented as independent per-action/notional enforcement. See docs/custody.md and docs/ACCEPTANCE.md.
Activity
joeblau commentedon Oct 16, 2026
Implementation merged in #50. The CLI now uses each user's own Privy app, keeps owner authorization locally, attaches the v2 domain/network/no-export policy with owner authorization, verifies policy content on repeated init, and recovers a lost wallet-create/link response. Initialized network/master mismatches are rejected. Tests cover init → attach/persist → status ID/version and local rejection of real withdrawal typed data.
Keeping this issue open for live evidence: run
npm run test:sandboxwith a dedicated test Privy app, prove a valid Agent signature succeeds, then prove a direct withdrawal-type signing request returns POLICY_REJECTED. Explicit invocation without credentials fails; it is not a live pass. The sandbox creates an empty wallet/policy for inspection and sends no Hyperliquid transaction.Privy cannot inspect the action contents/notional hidden in Hyperliquid's L1 connectionId hash. Local controls and Hyperliquid API-agent permissions enforce those boundaries; neither the versioned policy nor the sandbox is represented as independent per-action/notional enforcement. See docs/custody.md and docs/ACCEPTANCE.md.