Esc

Scoped Keys

Agents can sometimes be unpredictable and giving them direct access to your wallet to do as they please has risks.

The MOSS wallet comes with a rich permissions model which your agents can utilise to perform only actions you authorise with enforced spending limits. Your agent can request permissions and spending on your wallet to be approved by you.

Learn more about permissions

Get Started#

The easiest way to give your agent a scoped key which can perform defined actions on your wallet is via the MOSS CLI.

Install the CLI.

bash
curl -fsSL https://account.megaeth.com/install | sh

Log in via account.megaeth.com.

bash
mega moss login

Create a key with specific permissions.

bash
mega moss create-key \
--spend-limit 0xfafddbb3fc7688494971a79cc65dca3ef82079e7:25:week \
--allow-call '0xfafddbb3fc7688494971a79cc65dca3ef82079e7:transfer(address,uint256)' \
--label usdm-transfer

Your agent can then use this key to perform actions such as transfers.

bash
mega moss transfer \
--token 0xfafddbb3fc7688494971a79cc65dca3ef82079e7 \
--to 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd \
--amount 1

Learn more about the CLI and how to create keys for agents