Delegation and protection
The technical reference for builders. What Thirdfy checks before every write, which wallet signs on each lane, delegating from a user's wallet (ERC-7710), venue signers, revocation and custody.
Thirdfy decides who may act and whether each write is allowed before a wallet signs or a venue accepts an order. The same checks run on every surface: Command, MCP, the CLI and the API. The agent proposes; the Thirdfy API decides. The runtime never approves its own writes, and if a check fails, nothing is broadcast.
Owners set an agent's rules in the app: see Policy. This page is the reference behind it.
Agent policy limits
Every agent carries a policy, checked on every write whatever the model asks for:
| Limit | Field | What it does |
|---|---|---|
| Allowed actions | allowedActions | The agent runs only these. Discovery with the agent's key returns only these (GET /api/v1/agent/actions adds policyScoped: true). Allowing an entry also allows its exit, paying out to the agent's own wallet |
| Daily limit | maxDailyAmountUsd | A cap per UTC day on the capital the agent commits. A perps open counts its margin; closes, reduce-only orders, take-profit and stop-loss, leverage changes, cancels and setup don't count |
| Per-action limit | maxAmountPerActionUsd | A cap on the full size of one write |
| Kill switch | executionPaused | Stops every write |
A write over the daily limit is refused with blockedReason: POLICY_DAILY_LIMIT and dailyLimitUsd, dailyUsedUsd, remainingUsd. An action outside the allowlist returns 403. Policies are set by the owner in the app or by a hosting platform (such as EarnOrg) from its deploy settings, never by the agent.
What preflight checks
| Check | Examples |
|---|---|
| Identity and lane | The runMode, the agent or subscriber acting |
| Policy | Allowed action, daily and per-action limits, risk limits, pause |
| Delegation | For user-wallet lanes: the grant is active, not revoked or expired, and its caveats cover the action |
| Wallet and funding | Balances, allowances, venue funding |
| Venue readiness | Credentials, approvals, account setup |
| Catalog | The action exists for this provider, chain and lane |
| Credits | The account can pay |
Run it without executing: thirdfy-agent preflight --json, MCP previewOrder, or the directory preflight route.
| Refusal | Usually means | Do this |
|---|---|---|
| Policy | Not allowed, or over a limit | Change the policy, or pick an allowed action |
| Funding | Wrong wallet funded, or not enough | Fund the execution wallet |
| Venue setup | Credentials, approvals or account missing | getVenueReadiness, then the venue's setup guide |
| Delegation | Grant missing, expired or revoked | Create, activate or renew it |
| Capability | Action not on this chain or lane | Check the catalog and runMode |
Which wallet signs
Most builders need only the first row.
| Lane | Who signs | Use it for |
|---|---|---|
agent_wallet | The agent's own managed execution wallet | Your own agent: sign in with Thirdfy (or use an agent key), fund the wallet, run. No delegation to sign. Command, EarnOrg agents and most integrations use it |
| Delegation | An executor acting within a user's delegation | An agent acting for a user's own wallet under an ERC-7710 grant |
Signer user | The user's or agent's own key | A wallet you sign with yourself (getSelfReadiness, buildTx, walletSign, walletSubmit) |
| Fan-out | Each subscriber's executor | One intent run for many delegated wallets with executeIntent. See Act for many wallets |
agent_wallet is the one run mode and the default. The old run modes thirdfy and hybrid still parse and run as agent_wallet; self means signer user. Delegation and fan-out work as before, but they are not run modes.
On agent_wallet the API skips subscription and delegation binding checks; policy, Credits and funding still apply.
The delegation, signer user and fan-out tools (delegation*, getSelfReadiness, buildTx, walletSign, walletSubmit, executeIntent, consoleMandate*, managedWallet*) need an agent key. An app signed in with a Thirdfy account doesn't get them; it uses previewOrder and walletExecute.
Venue signers
Off-chain venues sign with their own credentials, set up through venue readiness, not with ERC-7710:
| Venue | Signer |
|---|---|
| EVM swaps, earn, approvals | The lane's wallet; on delegated lanes the grant's caveats must cover the generated calldata |
| Hyperliquid | An API wallet. Funding moves through the execution wallet |
| Polymarket | A managed signer and encrypted CLOB credentials |
| Lighter | API keys (agent key, CLI or API only) |
| Exchanges | Your own exchange API keys, never an agent wallet: stored as a credentialRef (Bitfinex), or used through Hummingbot's exchange connectors behind Thirdfy's checks |
Gator and ERC-7710 lifecycle
For an agent acting on a user's own wallet, Thirdfy uses a Gator-compatible ERC-7710 delegation (delegationModel=gator_erc7710). Keys never leave the user's wallet.
- Create: the API builds the delegation payload with its caveats (for example
erc20PeriodTransfer). - Sign: the wallet owner signs it (EIP-712) in MetaMask or another supported wallet. This step needs a person with the wallet; it can't be skipped.
- Activate: stores the signed delegation, executor, expiry and permissions.
- Inspect: status, expiry, revocation and the period allowance left.
- Execute: delegated lanes run only when the active grant and its on-chain caveats cover the action.
| Surface | Tools |
|---|---|
| CLI | thirdfy-agent delegation create, activate, status, inspect, balance, redeem, revoke (delegation grant runs create, sign and activate) |
| MCP (agent key) | delegationCreate, delegationActivate, delegationStatus, delegationInspect, delegationBalance, delegationRedeem, delegationRevoke |
| API | Delegation API, World ID delegation |
See Delegation and machine output.
Account mandate
A separate ERC-7710 grant from your own wallet, per chain, with a daily USD cap and an expiry (consoleMandate* tools with an agent key, CLI console-mandate). It belongs to the earlier Console; the app today checks every write against the agent's policy instead. Revoking it doesn't touch any agent delegation, and the reverse.
Before broadcast (on-chain writes)
For EVM spot and earn:
- Quote broadly, execute narrowly. Compare routes, then build only the best executable one for this chain, wallet and provider.
- Simulate where possible (
eth_callor gas estimation) before the wallet signs. - Unknown providers fail closed. An action must be registered for the target chain and lane.
Revocation
- An agent: pause it or revoke its key from the app. See Policy and Connect.
- A signed-in app: revoke it at auth.thirdfy.com/connections.
- A delegation:
delegation revoke(CLI) ordelegationRevoke(MCP). Future authorizations stop; anything not yet signed is cancelled; what's already broadcast completes. Every revocation is recorded.
Custody
Thirdfy never pools user funds. Each agent's execution wallet holds only that agent's funds. With delegation, funds stay in the user's wallet and the executor acts only within the grant.
Wallet glossary
| Term | What it is |
|---|---|
| Owner wallet | The wallet linked to your Thirdfy sign-in. It proves who you are. Don't fund it for agent trading |
Agent key (agentKey) | The agent's 0x identity in the registry, shown by whoami. Not the execution wallet, and not the agent-... API key |
Execution wallet (agent_wallet) | The agent's own managed wallet. Fund it; the agent trades from it |
| Custodial delegation wallet | A Thirdfy-managed session account for delegation (managedWalletInit, agent key only). Separate from the execution wallet |
| Delegated user wallet | A user's own wallet that gives the agent scoped authority with an ERC-7710 grant |
| Venue signer | What a venue needs: a Hyperliquid API wallet, Lighter API keys, Polymarket CLOB credentials or your own exchange API keys |
Security
- Wallets hold keys. Thirdfy checks intents and routes execution when policy allows.
- Grants are scoped and revocable; preflight fails closed.
- Never put API keys, agent keys or venue secrets in an agent's repository.
- Thirdfy targets 99.9% monthly uptime for the MCP and public APIs, excluding scheduled maintenance.
Report a security issue to security@thirdfy.com.