Delegation & machine output

Let your agent act from users' wallets with delegation, and read thirdfy-agent JSON output in scripts and CI.

Delegation lets a user give your agent limited permission to act from their wallet. The user signs once and can revoke it later. Use thirdfy-agent delegation to set it up and manage it.

Under the hood, delegation uses the ERC-7710 standard and is Gator-compatible. Thirdfy's server checks each delegation before a run that uses it. See Delegation and protection.

Set up delegation

1. Create

thirdfy-agent delegation create \
  --agent-api-key "$THIRDFY_AGENT_API_KEY" \
  --chain-id 8453 \
  --json

This returns a payload for the owner's wallet to sign (an EIP-712 typed message). You can also call it as delegation grant.

2. Activate

After the user signs in MetaMask or another supported wallet, activate the delegation:

thirdfy-agent delegation activate \
  --agent-api-key "$THIRDFY_AGENT_API_KEY" \
  --json

Thirdfy saves the delegation. Its status becomes active when its limits (caveats) and expiry are valid.

3. Check it

thirdfy-agent delegation status --json
thirdfy-agent delegation inspect --json
thirdfy-agent delegation balance --json

Run these before live writes. They confirm the expiry, who can execute, and how much allowance is left for the period.

4. Preflight and run

thirdfy-agent preflight --json ...
thirdfy-agent run --json ...
thirdfy-agent intent-status --intent-id <id> --json

Preflight shows anything that blocks the run, from delegation, policy or the catalog, before anything runs.

5. Revoke or redeem

thirdfy-agent delegation revoke --json
thirdfy-agent delegation redeem --user-did "did:privy:..." --json

Revoking stops all future authorizations. delegation redeem runs on agent_wallet for the delegating user, so it needs --user-did (or THIRDFY_USER_DID, or a saved login userDid). See Delegation and protection.

Run mode and delegation

Since CLI 0.6.7 there is one run mode, agent_wallet, and it is the default. Delegation is not a run mode:

How you runDelegation
Default (agent_wallet)The agent's own wallet. No user delegation.
agent run --signer-method fanout_intentFan-out to many users' wallets. Needs an active Gator delegation from each user
--signer userYour own wallet signs. Delegation is optional, depending on the action.

Old values still parse: --run-mode thirdfy and --run-mode hybrid run as agent_wallet with a warning, and --run-mode self means --signer user.

Machine output (--json)

In scripts and CI, always pass --json. Its output is the stable format to build on.

  • Expect new keys. The CLI may add fields over time, so ignore keys you do not know.
  • Base your automation on exit codes and the structured error and blockedReason fields.
  • For agents that do not run shell commands, use the REST Delegation API or MCP.

World ID

World ID proof of personhood has its own commands: delegation world-id-begin, delegation world-id-complete, and the deposit begin and complete pair. See World ID delegation.