Skip to main content

Set policy and payments

policy.json is your app’s rule book. It tells Gora, wallets, and contracts what the app is allowed to request. A good first policy is strict:
  • one chain
  • one action
  • one or two recipients
  • low amount limits
  • manual mobile approval

Example policy

{
  "schema_version": 1,
  "policy_id": "policy:my-agent:v1",
  "allowed_actions": ["agent_mobile_signing"],
  "allowed_chains": ["base"],
  "chain_policies": {
    "base": {
      "execution_modes": ["manual_mobile_signature", "preapproved_agent_wallet"],
      "max_amount_per_tx": "1000000000000000",
      "max_amount_per_day": "5000000000000000",
      "amount_unit": "wei",
      "native_token": "ETH",
      "allowed_recipients": [
        "0x2222222222222222222222222222222222222222"
      ]
    }
  },
  "payment_principles": {
    "gora_node_holds_user_keys": false,
    "gora_node_pays_user_gas": false,
    "default_fee_payer": "user_or_user_preapproved_on_chain_account"
  }
}

Important fields

FieldMeaning
allowed_actionsApp result types that are allowed
allowed_chainsChains the app can target
execution_modesHow an intent becomes an approved action or transaction
max_amount_per_txPer-transaction limit in chain units
max_amount_per_dayDaily limit in chain units
allowed_recipientsRecipient allowlist
payment_principlesExplicit statement of who holds keys and who pays

Execution modes

ModeMeaning
offchain_resultApp returns a result with no chain execution
manual_mobile_signatureUser reviews and signs each action or transaction
preapproved_agent_walletAgent can act through a limited wallet policy
preapproved_smart_walletSmart wallet enforces limits approved ahead of time
preapproved_logicsigAlgorand-style delegated logic or escrow policy
preapproved_mobile_sessionMobile creates a limited session for repeated actions
app_contract_paidApp contract pays or reimburses execution
paymaster_sponsoredPaymaster or sponsor pays gas

Who pays?

Gora does not assume it pays gas or holds keys. Pick one of these designs:
PayerCommon use
User walletManual mobile signing, safest first test
Agent/smart walletUser has pre-approved tight limits
App contractApp sponsors or reimburses users
PaymasterAccount-abstraction style sponsorship
Operator scriptDevnet-only testing and fulfillment

Manual mobile signing flow

Gora app returns mobile_signing_request

Mobile shows chain, recipient, amount, and app metadata

User signs or rejects

Signed payload is submitted according to submission_plan
This is the recommended first flow for anything that moves value.

Pre-approved flow

User approves rules once

Wallet/contract stores limits

Gora result is checked against policy

Contract/wallet executes only if limits pass
Use this only after manual signing is working.

Units by chain

ChainNative tokenUnit
Base/EVMETHwei
SolanaSOLlamports
AlgorandALGOmicroalgos

Validate policy changes

After editing policy.json:
gora validate
gora package
Then redeploy:
gora deploy
Next: Devnet quickstart.