Delegation & protection
Delegation, mandates, preflight verification, Gator/ERC-7710, venue boundaries, audit trails, and fail-closed policy for CLI, MCP, and REST.
Thirdfy governs who may act and whether each action is allowed before wallets sign or venues accept orders. Delegation scopes, custody modes, venue readiness, and policy checks apply whether you integrate via CLI, MCP, or REST.
Start here (most builders)
If you are building your own agent (solo automation, not fan-out to thousands of user wallets), use agent_wallet + email login. This is the simplest production path.
| Step | What happens |
|---|---|
| 1 | Email OTP — CLI thirdfy-agent login email (two steps) or MCP startEmailOnboarding / completeEmailOnboarding |
| 2 | Thirdfy bootstraps agent API key, owner session, and managed execution wallets (executionWallets / agentWalletBootstrap) |
| 3 | Fund the execution wallet for your venue (Base USDC, Arbitrum for Hyperliquid Bridge2, etc.) |
| 4 | preflight → execute with runMode=agent_wallet |
No MetaMask EIP-712 delegation grant on this lane. Email proves agent ownership; Thirdfy still runs preflight, credits, and policy before every write.
Hosted agents on EarnOrg use this same lane.
| Path | MetaMask EIP-712? | Typical first-time setup |
|---|---|---|
agent_wallet + email | No | ~30–60 minutes (register, login, fund, first preflight) |
| Gator / ERC-7710 | Yes (delegation grant) | ~1–2 hours (grant sign + activate + venue setup) |
| execute-intent fanout | Per subscriber | Publisher setup + subscriber mandates |
Walkthrough: Quick start — simplest dev path. CLI: Authentication. MCP: Onboarding.
Agent policy limits
Every agent key carries a policy. Thirdfy checks it on every write, on every surface (MCP, CLI, REST, Console), whatever the model asks for. It applies to agent_wallet agents too, which need no delegation grant.
| Limit | What it does |
|---|---|
Action allowlist (allowedActions) | The agent may run only the listed actions. Discovery with the agent's key returns only those actions (CLI actions --agent-api-key; GET /api/v1/agent/actions also adds policyScoped: true). |
| Exits follow entries | Allowing an entry action also allows its exit (buy and sell, open and close, deposit and withdraw), so an agent can always unwind what it opened. The exit must pay out to the agent's own wallet. Allowing an exit never allows its entry. |
Daily limit (maxDailyAmountUsd) | A cap per UTC day on the owner's capital the agent commits. A perps open counts its margin, not its leveraged size. Closes, reduce-only orders, take-profit and stop-loss, leverage changes, cancels and setup steps don't count. |
Per-action limit (maxAmountPerActionUsd) | A cap on the full size of one write. |
Kill switch (executionPaused) | Stops all writes for the agent. |
A write over the daily limit is refused with blockedReason: POLICY_DAILY_LIMIT, plus dailyLimitUsd, dailyUsedUsd and remainingUsd. An action outside the allowlist returns 403.
Policies are set through Thirdfy's control plane, not by the agent. Hosted platforms such as EarnOrg set them from their deploy settings.
Which model should I use?
Pick the lane that matches your use case. For solo agent_wallet + email (no MetaMask grant), use Start here (most builders). Use the chart below when you need user wallet delegation, fan-out, or a venue-specific signer.
flowchart TD
A["What are you building?"] --> U{"Primary use case"}
U -->|"Solo agent you run"| AW["agent_wallet + email login"]
U -->|"User external wallet"| B{"Venue or chain"}
U -->|"Many delegated subscribers"| G["execute-intent + mandates"]
B -->|"EVM swap, earn, bridge"| C["Gator / ERC-7710"]
B -->|"Hyperliquid perps"| D["HL API wallet + fund execution wallet"]
B -->|"Polymarket orders"| E["Privy signer + CLOB credentials"]
B -->|"CEX e.g. Bitfinex"| F["credentialRef API keys"]
AW --> H["preflight, then walletExecute or run"]
C --> H
D --> H
E --> H
F --> H
G --> H| If your lane is… | Delegation / signer model | Read first |
|---|---|---|
| Solo agent (start here) | agent_wallet + email login. Managed execution wallet | Start here (most builders) |
| EVM on Base (user wallet) | Gator-compatible ERC-7710 caveats on generated calldata | Gator lifecycle |
| Hyperliquid perps | Off-chain API wallet. Fund execution wallet for Bridge2. Not ERC-7710 for orders | Venue boundaries |
| Polymarket | Privy signer + encrypted CLOB credentials. Not ERC-7710 for orders | Integrations: Polymarket |
| Many subscribers | Mandate + execute-intent fanout | Execute intents |
Why delegation for autonomous agents
Autonomous agents need bounded authority to act on user capital. Users retain custody. Thirdfy validates every intent before execution. The same model applies when a human delegates to an agent and when a publisher agent fans out actions to many delegated subscribers through execute-intent.
Without delegation and policy:
- Agents could not scale to thousands of delegated wallets safely.
- Users could not revoke or time-limit authority.
- Venues with different signer models (EVM, perps API wallet, CLOB) would not have a single governance layer.
Delegation establishes permission. Preflight and the policy engine enforce it on every write.
Two layers of protection
| Layer | What it controls | Thirdfy surface |
|---|---|---|
| Permission | Who may act, for how long, on which venues | Delegation grants, mandates, revocation |
| Per-action verification | Whether this specific action is allowed right now | preflight, directory preflight, execute gates |
Hosted platforms such as EarnOrg, a separate hosted agent platform that integrates with Thirdfy for execution, may add a third layer before production launch: template evals and launch validation on the EarnOrg side. A production-ready agent can still fail Thirdfy preflight on a bad trade. Verification at launch and verification per action are complementary.
From intent to execution
Every write follows the same governance lifecycle:
| Phase | What happens | CLI / MCP / REST |
|---|---|---|
| Proposal | Agent submits action name and params | run, executeIntent, walletExecute, agentRun |
| Verification | Thirdfy checks delegation, mandate, credits, venue readiness, catalog | preflight, directory preflight |
| Authorization | Active binding and policy must cover the action | Gator caveats, runMode lane, mandate match |
| Execution | Broadcast, sponsor gas, bill credits, record outcome | run, execute paths after gates pass |
Agents reason in natural language but broadcast structured transactions. The risk is mismatch: wrong token, wrong amount, unintended route, or missing venue setup. Thirdfy blocks before sign or broadcast when policy or readiness fails.
Independent governance gate
The agent's model proposes. Thirdfy API validates. The runtime does not approve its own writes.
- Hosted runtimes on EarnOrg (and similar partner platforms) run their own schedule and decision loop. EarnOrg hosts the agent; adapters call Thirdfy preflight and execute for each write. The runtime does not self-check policy.
- CLI and MCP are connectors. Policy, delegation, and credits live in the Thirdfy API, not in your agent repository.
- Fail-closed by default. If verification fails, nothing broadcasts.
Where Thirdfy fits
Intent-based security
We verify what actions are allowed, not just who holds keys. Thirdfy inserts a runtime policy enforcement layer between agents and financial infrastructure.
- Every intent validated before execution. The policy engine evaluates against mandate and policy. Compliant means authorized. Not compliant means rejected.
- Verifiable enforcement records. Every authorization decision produces a traceable event.
- Mandates. Programmable policies for capital allocation, counterparties, timing, and execution parameters.
Thirdfy validates action params, policy, and mandate. It does not replace your own strategy review of what the agent was asked to do in natural language.
Signing moments
What does the user sign? Depends on execution mode:
| Mode | User signs | Format |
|---|---|---|
| Non-custodial (ERC-7710 / Gator) | Delegation grant (scope, expiry) | EIP-712 typed message |
| Execution (per intent) | On-chain transaction | Signed tx (user wallet or custody platform) |
For non-custodial flows: users sign an EIP-712 delegation message to authorize an agent within scope and time limits. At execution time, the wallet signs the actual on-chain transaction. Thirdfy never holds signing keys.
Delegation modes
| Mode | Description |
|---|---|
| x402 custodial | Thirdfy-managed. Credits and execution flow through Thirdfy infrastructure. |
| Non-custodial (ERC-7710 / Gator) | User holds keys. Delegation is scoped and time-limited via supported wallets. Status: active, expired, revoked. |
Gator and ERC-7710 lifecycle
Thirdfy uses a Gator-compatible ERC-7710 delegation model (delegationModel=gator_erc7710) for external wallet authority:
delegation create— API builds a Gator-style payload witherc20PeriodTransfercaveats for the owner wallet to sign.- Wallet sign — Owner signs with MetaMask or another supported wallet. Private keys never leave the wallet.
delegation activate— Persists the signed delegation, manager, executor/session account, expiry, and permission metadata.delegation inspect/balance— Shows status, expiry, revocation, executor, and remaining period allowance.- Execute —
hybrid,thirdfy, or compatible paths run only when the active binding and on-chain caveats cover the requested action.
Wallet sign step (EIP-712). Steps 1–2 produce a delegation payload; the wallet owner must sign in MetaMask (or another supported wallet) before delegation activate. There is no way to skip this for non-custodial Gator flows. Plan for a human or operator with wallet access. If your team has never used a wallet, budget extra time for this step.
CLI vs MCP: thirdfy-agent delegation create → wallet sign → delegation activate is one shell flow. MCP uses separate tools (delegationCreate, delegationActivate, etc.). See MCP execution tools.
CLI alias: delegation grant maps to the create/sign/activate flow.
| Surface | Tools |
|---|---|
| CLI | thirdfy-agent delegation create, activate, status, inspect, balance, redeem, revoke |
| MCP | delegationCreate, delegationActivate, delegationStatus, delegationInspect, delegationBalance, delegationRedeem, delegationRevoke |
| REST | See Delegation API and World ID delegation |
Full command reference: Agent CLI reference.
Console mandate
The Console mandate is a separate grant from agent delegation. It lets Thirdfy Console, its Command chat and its Automations act from your wallet. It is an ERC-7710 grant per chain, with a daily USD cap and an expiry.
| Surface | Commands |
|---|---|
| Console | Delegation |
| CLI | thirdfy-agent console-mandate status, draft, activate, revoke |
| MCP | consoleMandateStatus, consoleMandateDraft, consoleMandateActivate, consoleMandateRevoke |
Revoking the Console mandate does not touch any agent delegation, and the reverse.
MetaMask integration
Thirdfy supports MetaMask Smart Accounts and scoped wallet permissions for production delegation flows. The Jeff Agent with MetaMask pilot validated end-to-end authorize flows: users grant scoped delegation, agents execute under policy, and users can revoke.
Wallet apps vs API: Consumer wallets may request permissions through ERC-7715-style smart account kits. The Thirdfy API exposes Gator/ERC-7710 delegation payloads for create, activate, and verify. Both aim at scoped, time-limited authority without Thirdfy holding user keys.
Operators: Operate with Console. Builders: CLI walkthrough below and Delegation and JSON.
Execution lanes (runMode)
| Mode | When to use | Typical gate |
|---|---|---|
self | User or agent signs with their own keys | getSelfReadiness; delegation optional depending on action |
hybrid / thirdfy | Thirdfy-mediated or hybrid custody flows | delegationStatus and mandate checks |
agent_wallet | Agent-owned execution wallet at the API | agentWalletBootstrap + funding checks before writes |
agent_wallet is not a delegated user flow. When runMode is agent_wallet and the identity is agent-owned, the API executes from the agent wallet and bypasses subscription/delegation binding checks. Policy, credits, and funding gates still apply.
Approval patterns
| Pattern | Typical runMode | Who signs after preflight passes |
|---|---|---|
| User reviews each execution | self | User wallet signs the transaction |
| Agent executes under policy | agent_wallet, delegated hybrid / thirdfy | Managed agent wallet or delegated executor |
| User grants scope once, agent acts within mandate | Gator + hybrid / thirdfy | Executor within caveats; preflight on every action |
Fanout and directory checks
Publisher fanout. One registered agent can act for many delegated subscribers under mandate. See Execute intents for the execute-intent model.
Directory readiness. Apps and operators should call authenticated directory routes (readiness, delegation-status, preflight) before showing execute controls. The API resolves agentApiKey server-side in validation-only lanes so browsers never need agent secrets.
Venue-specific delegation boundaries
| Domain | Delegation model |
|---|---|
| EVM swaps, earn, approvals | Gator/ERC-7710 caveats must cover generated calldata |
| Hyperliquid perps | Off-chain API wallet signer. Not ERC-7710. Bridge/funding may use Gator on EVM. |
| Polymarket CLOB | Privy signer + encrypted CLOB credentials. Not ERC-7710 for orders. |
| CEX (Bitfinex) | API keys stored in Thirdfy API (credentialRef). Separate from Gator. |
Details per venue: Integrations.
Before broadcast (on-chain writes)
For EVM spot and earn paths, Thirdfy applies additional safety before sponsored broadcast:
- Quote broadly, execute narrowly. Compare routes, then build only the best executable path for the current chain, wallet mode, and provider.
- Simulation where possible. Read-only
eth_callor gas estimation before handing calldata to the wallet when the provider supports it. - Unknown providers fail closed. Actions must be registered in the capability matrix for the target chain and execution mode.
Off-chain venues (Hyperliquid, Polymarket, CEX) use credential resolution, readiness, policy profiles, and venue-specific setup checks instead of Gator calldata redemption.
Mandates and policy engine
Mandates are user-defined policies that govern what actions an agent can perform. When you delegate, you set a mandate. Every intent is validated against it.
- Agent submits intent.
- Policy engine evaluates against mandate and protocol constraints.
- Compliant = authorized. Intent fans out or executes.
- Not compliant = rejected. No execution.
You can control capital allocation, counterparties, timing, and execution parameters.
Revocation
Users can revoke delegation at any time. Revocation stops future authorizations. Pending executions (tx not yet signed) are cancelled. Transactions already broadcast complete. Every revocation is recorded for audit.
CLI walkthrough
Typical delegated execution sequence:
See Delegation and JSON for automation details.
Custody boundary
Does Thirdfy custody assets? No. Thirdfy never holds user funds in a pooled account.
Funds sit in user-owned wallets. For x402 custodial flows, funds sit in a per-user provider wallet the user owns. Thirdfy validates intents; the key holder executes.
Venue readiness
Do this before your first live write, not after a runtime failure.
- Pick the provider from Integrations (Hyperliquid, Polymarket, Morpho, etc.).
- List prerequisites with MCP
getProviderActionsor CLIthirdfy-agent actions --jsonfor that provider and chain. - Run preflight validation-only with the action you plan to execute.
- Complete setup (allowances, Bridge2 funding, CLOB credentials, CEX keys) per the venue page.
| Surface | Command / tool |
|---|---|
| CLI | thirdfy-agent actions --json then thirdfy-agent preflight --json |
| MCP | getProviderActions, then preflight or readiness tools |
| REST | GET /api/v1/agent/actions/catalog and directory preflight routes |
Trading, yield, prediction, and CEX actions each have different setup. The catalog and provider tools are the source of truth for prerequisites.
Fail-closed policy
If identity, delegation, policy, or catalog validation fails, writes block with explicit reasons. Reads that are allowlisted for anonymous or bootstrap modes remain constrained by tool authProfile.
What preflight checks
| Category | Examples |
|---|---|
| Identity and lane | runMode, agent vs subscriber context |
| Delegation | Binding active, not revoked or expired, caveats cover the action |
| Mandate and policy | Amounts, allowlists, counterparties, timing |
| Wallet and funding | Balances, allowances, venue funding (Bridge2, CLOB setup, etc.) |
| Catalog and capability | Action allowed for provider, chain, and execution mode |
| Credits and quotas | Billing identity, sponsorship eligibility |
Use thirdfy-agent preflight --json, MCP preflight tools, or directory preflight for validation-only runs before live writes.
Common blocker families
| Family | What it usually means | What to do |
|---|---|---|
| Delegation | Missing, expired, or revoked grant | Create, activate, or renew delegation |
| Funding | Wrong wallet funded or insufficient balance | Fund the execution wallet; check venue-specific paths |
| Venue setup | Credentials, geoblock, or allowances incomplete | Follow Integrations hub setup for that venue |
| Policy | Mandate or allowlist violation | Adjust mandate or choose a permitted action |
| Capability | Action not supported on this chain or lane | Check catalog and runMode for the provider |
Audit and traceability
Thirdfy records authorization decisions across the stack:
- Delegation lifecycle. Create, activate, inspect, revoke events and binding status.
- Preflight outcomes. Validation-only runs before writes (CLI, MCP, directory).
- Execution and credits. Completed actions with provider attribution on credit debits.
- Fanout context. Subscriber scope on
execute-intentwhen a publisher acts for many wallets.
Use these records for operator review, support, and compliance workflows.
Security
Thirdfy does not custody or control user funds. Our security model focuses on protecting delegation permissions, policy enforcement, API integrity, and system availability.
- User and agent wallets hold keys. Thirdfy validates intents and routes execution when policy allows.
- Delegation grants are scoped and revocable. Preflight fails closed when binding or mandate checks fail.
- API keys, agent credentials, and venue secrets are handled per product auth docs. Do not embed secrets in agent repos.
Report issues: security@thirdfy.com or Discord.
Service uptime
Thirdfy targets 99.9% monthly uptime for MCP services and public APIs, excluding scheduled maintenance. Uptime is measured as successful API request availability from independent monitoring endpoints. Service credits or other remedies for SLA breaches are defined in enterprise agreements for affected customers.
Best practices
- Scope delegation. Use time-limited, action-scoped mandates.
- Preflight before writes. Run validation-only checks in CI and before production cron cycles.
- Review allowlists. Ensure agent actions match your risk tolerance.
- Monitor activity. Check execution history, credit usage, and delegation status.
Wallet glossary
| Term | What it is |
|---|---|
| Owner wallet | The wallet linked to your email sign-in. It proves who you are. Don't fund it for agent trading. |
Agent key (agentKey) | The agent's 0x identity address in the registry, shown by thirdfy-agent whoami. Tools such as getVenueReadiness take it. After email onboarding it is your owner wallet address. It is not the execution wallet, and not the agent-... API key. |
Execution wallet (agent_wallet) | The agent's own managed wallet, created at email onboarding. Fund it; the agent trades from it. Listed as executionWallets in the CLI. |
| Custodial delegation wallet | A Thirdfy-managed session account for delegation (managedWalletInit, CLI managed wallet init). Separate from the execution wallet. |
| Delegated user wallet | A user's own wallet that grants the agent scoped authority with a Gator (MetaMask ERC-7710) delegation. Keys stay in the user's wallet. |
| Venue signer | Credentials a venue needs: a Hyperliquid API wallet, Lighter API keys, Polymarket CLOB credentials, or a CEX key stored as a credentialRef. |
| Console mandate | A Gator grant from your wallet to Thirdfy Console, with a daily cap and expiry. See Console mandate. |