The Trust Primitive for Autonomous Agents EdgePass gives agents your rules, not your keys.
Live Demo โ ยท npm โ ยท Contract โ ยท Docs โ
The best infrastructure is invisible.
edge_pass_v2is deployed to Sui testnet only. Mainnet cannot mint v2 passes yet โsdk.create()on mainnet throws rather than silently targeting a package that doesn't have the module. Usenetwork: 'testnet'until v2 ships to mainnet.New passes are always v2. There is no v1 creation path in the 2.x SDK โ
sdk.create()only ever mints v2.v1 passes are read-only in the 2.x SDK. If you already hold a v1 pass (minted on mainnet before this release), you can still
fetch(), inspect, andrevoke()it โ you cannot create a new one or spend against one.
edge_pass.move(v1) stays in this repo permanently. It's not dead code left over from before v2 โ real v1 passes exist on Sui mainnet today, and the SDK'sfetch()/revoke()need that module's functions to keep working for them, indefinitely.
Every developer building an autonomous agent hits the same wall:
| Option | Approach | Problem |
|---|---|---|
| A | Give the agent full wallet access | Catastrophic risk โ unlimited exposure |
| B | Human approves every transaction | Defeats the purpose of automation |
| C | Build custom policy logic per app | 6โ8 weeks of infrastructure before any business logic |
There is no Option D. No standard primitive for saying:
"This agent can spend up to $300, at these merchants, auto-approve under $50, ask me before anything over $100, and shut down in 48 hours โ without ever touching my keys."
Edge is Option D.
Edge is programmable trust infrastructure. Users define boundaries once. Agents execute freely within them. Unsafe actions escalate automatically.
The atomic unit is the EdgePass โ a Sui Move object encoding a complete trust policy:
budget: $300 ยท auto-approve: < $50 ยท escalate: > $100 ยท merchants: [...] ยท expiry: 48h
Without Edge, every developer builds the same infrastructure from scratch:
โ Policy engine who can the agent pay? how much?
โ Escalation system when does the human get notified?
โ Audit trail what did the agent do? prove it.
โ Budget tracker how much is left?
โ Expiry system when does authority end?
โ Revocation how do I stop it immediately?
โ On-chain state where does the policy live?
With Edge:
pnpm add @edge-protocol/sdkconst pass = await sdk.create(EdgePass.fromTemplate('festival', { agent }), signer);
const outcome = await sdk.execute(pass, { merchant, amount }, signer);
// โ
policy enforced ยท ๐ audit logged ยท โ done10 lines of code. 8 weeks of infrastructure. Gone.
The real proof: an AI agent autonomously manages festival purchases within an EdgePass. Claude and Gemini both supported โ model agnostic by design.
๐ง Agent: "Shuttle from parking โ $18.50 at Shuttle Express"
โ๏ธ PolicyEngine: โ
auto-approved ยท under $75 threshold ยท trusted merchant
โ Sui: execute_transaction ยท Success ยท digest verifiable on Suiscan
๐ง Agent: "Drinks for the group โ $45 at Hydra Bar"
โ๏ธ PolicyEngine: โ
auto-approved ยท within policy limits
โ Sui: execute_transaction ยท Success
๐ง Agent: "VIP stage access โ $220"
โ๏ธ PolicyEngine: โ ๏ธ escalated ยท exceeds $150 threshold ยท agent paused
๐ค User: reviews and approves via modal
โ Sui: execute_transaction ยท Success
๐ง Agent: "ShadyTokens.xyz โ quick flip"
โ๏ธ PolicyEngine: ๐ซ blocked ยท merchant not in approved list ยท <1ms ยท never submitted
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
4 transactions executed autonomously
$188.50 spent ยท $311.50 remaining
0 wallet interruptions ยท every action verified on Suiscan
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
npm install @edge-protocol/sdk
pnpm add @edge-protocol/sdk
yarn add @edge-protocol/sdkNote: BigInt literal syntax (
32n) requires TypeScript targeting ES2020+. For ES2019 apps useBigInt(32) * MIST_PER_SUI.
import { EdgePass, MIST_PER_SUI } from '@edge-protocol/sdk';
const sdk = new EdgePass({ network: 'mainnet', enokiApiKey: 'YOUR_KEY' });
const pass = await sdk.create(
EdgePass.fromTemplate('festival', {
approvedMerchants: ['0xshuttle...', '0xhydrabar...', '0xstageaccess...'],
agent: agentAddress, // spends against the pass โ this key signs execute()
issuer: userAddress, // grants/revokes โ bookkeeping only, never sent on-chain
}),
signer
);const outcome = await sdk.execute(pass, {
merchant: '0xshuttle...', // address โ must be in approvedMerchants
merchantLabel: 'Shuttle Express', // display only, not enforced
amount: BigInt(18_500_000_000), // 18.5 SUI in MIST
}, signer);
switch (outcome.status) {
case 'approved': console.log('executed:', outcome.digest); break;
case 'escalated': await notifyUser(outcome.reason); break;
case 'blocked': console.log('policy rejected:', outcome.reason); break;
}// Zero network calls โ predict the full session instantly
const plan = sdk.simulate(pass, decisions);
console.log(plan.summary);
// { approvedCount: 4, blockedCount: 1, escalatedCount: 1 }
// Show plan, then execute approved decisions
for (const decision of plan.approved) {
await sdk.execute(pass, decision.request, signer);
}const status = sdk.budgetStatus(pass);
// { spent, remaining, utilizationPct, isNearLimit, isExhausted }
sdk.isNearLimit(pass) // true if > 80% spent
sdk.timeRemaining(pass) // ms until expiry
sdk.isExpiringSoon(pass) // true if < 1 hour remainingconst safePurchase = EdgePass.withPolicy(pass, signer, sdk, async (request) => {
return await processPayment(request);
});
// blocked/escalated never reach your tool logic
const { outcome, result } = await safePurchase({ merchant, amount });import { useEdgePass } from '@edge-protocol/sdk/react';
const { pass, execute, simulate, budgetStatus, loading } = useEdgePass({
passId, network: 'mainnet', enokiApiKey: KEY, signer,
autoRefresh: true, // re-fetch after every approved execute
});const preview = sdk.validate(pass, { merchant, amount });
// { allowed: boolean, requiresEscalation: boolean, reason: string }| Template | Budget | Escalate โฅ | Max/tx | Expiry |
|---|---|---|---|---|
festival |
300 SUI | 50 SUI | 200 SUI | 48h |
gaming |
50 SUI | 2 SUI | 10 SUI | 4h |
subscription |
200 SUI | 20 SUI | 50 SUI | 30d |
defi |
10,000 SUI | 500 SUI | 2,000 SUI | 7d |
enterprise |
50,000 SUI | 1,000 SUI | 10,000 SUI | 30d |
User creates EdgePass (once)
โ
โผ
Agent calls sdk.execute() โ many times, autonomously
โ
โโโถ ๐ Layer 1 โ TypeScript PolicyEngine
โ Pure TypeScript ยท no network ยท <1ms
โ โโ active? expired? merchant in allowlist?
โ โโ amount within budget? below maxPerTx? within velocity cap?
โ โโ amount > escalateAbove? โ โ ๏ธ escalate (agent pauses)
โ โโ amount โค escalateAbove? โ โ
auto-approve
โ blocked/escalated NEVER touch the chain
โ
โโโถ โก Layer 2 โ Sui Move Contract (PTB, atomic)
โ validate โ execute โ update spent โ emit event
โ if any assertion fails โ everything reverts ยท no partial state
โ cannot be bypassed ยท the chain is the source of truth
โ
โโโถ ๐ Walrus โ immutable audit receipt
cryptographically committed ยท decentralized ยท permanent
This is Edge's most important architectural decision:
Layer 1 โ TypeScript PolicyEngine <1ms ยท zero network ยท developer convenience
Layer 2 โ Sui Move Contract atomic ยท tamper-proof ยท cannot be bypassed
Blocked/Escalated โ Layer 1 catches them ยท never submitted to chain ยท no gas wasted
Approved โ Layer 1 + Layer 2 ยท both must pass ยท atomic execution
Layer 1 can be bypassed by a compromised agent runtime. Treat it as a UX convenience and gas optimization โ not a security boundary.
Layer 2 cannot be bypassed. The Move contract validates the same five rules independently. A compromised SDK, a compromised agent, a compromised developer machine โ none of these can circumvent the contract. The chain enforces the policy.
Most zkLogin implementations call jwtToAddress(jwt, BigInt(0)) โ hardcoding the salt as zero. This silently derives the wrong wallet address. Users can log in but their transactions fail or go to the wrong address.
The correct pattern: fetch the unique salt from Enoki before deriving the address.
Edge fixes this. Your users will have the correct wallet address derived from their Google identity.
๐ zkLogin โ Invisible wallet from Google login. No seed phrase, no MetaMask. On Ethereum: weeks of account abstraction. On Sui: one API call.
โฝ Sponsored Transactions โ Users never pay gas. Protocol-level primitive. On Ethereum: deploy and maintain a Paymaster contract. On Sui: one API key.
๐งฑ Programmable Transaction Blocks โ Policy check + execution + state update โ one atomic block. If any step fails, everything reverts. No partial state. No race conditions. Native to Sui.
๐ฆ Object Model โ EdgePass is a first-class owned object in the user's wallet. An agent executes against it without ever taking ownership. On Ethereum: a contract mapping the developer can modify. On Sui: an object only the owner can touch.
๐ Walrus โ Decentralized audit storage built by the same team as Sui. Byzantine fault-tolerant. Erasure-coded. Not IPFS. Not S3. Native.
You could build a worse version of Edge on Ethereum in months. On Sui it took 10 days โ because every primitive was already there.
sdk.validate() โ TypeScript (instant preview, saves gas on rejections)
sdk.execute() โ TypeScript + Move contract (atomic, tamper-proof, final)
The Move contract runs six assertions, in order, in the Sui VM before recording any spend:
assert!(pass.active, EPassInactive);
assert!(now <= pass.expires_at_ms, EPassExpired);
assert!(ctx.sender() == pass.agent, ENotAgent);
assert!(pass.approved_merchants.contains(&merchant), EMerchantNotApproved);
assert!(amount <= pass.max_per_transaction, EExceedsMaxPerTransaction);
assert!(pass.velocity_used + 1 <= pass.velocity_cap, EVelocityExceeded); // skipped when velocity_cap == 0
assert!(pass.spent + amount <= pass.budget, EBudgetExceeded);Notice escalateAbove isn't in that list โ escalation is an off-chain routing decision the SDK's PolicyEngine makes, not a refusal the contract can enforce. The chain only knows hard yes/no answers: active, in-scope, under the per-transaction ceiling, under the velocity cap, under budget. If any assertion fails, the entire transaction reverts. A compromised agent cannot bypass the contract. The chain is the trust boundary.
Edge is the policy layer for the agentic economy. It is not a payment rail.
| Solution | Layer | Open Source | Sui Native | simulate() | 3-line SDK |
|---|---|---|---|---|---|
| Edge Protocol | Policy enforcement | โ | โ | โ | โ |
| x402 (Coinbase) | Payment rail | โ | โ | โ | โ |
| ERC-4337 | Account abstraction | โ | โ EVM only | โ | โ |
| Trust Wallet Agent Kit | Wallet interactions | โ | Partial | โ | โ |
| Cobo Agentic Wallet | Custody | โ Enterprise | โ | โ | โ |
| Skyfire | Identity + settlement | โ | โ | โ | โ |
Edge complements x402, it does not compete with it.
x402 answers: how does money move from agent to merchant? Edge answers: should this agent be allowed to spend this money at all?
Edge (policy layer) โ x402 (payment rail) โ Settlement
"is this allowed?" "move the money"
| Vertical | Template | The agent does |
|---|---|---|
| ๐ช Consumer / Festival | festival |
Purchases at approved vendors, escalates big spends |
| ๐ฎ Gaming | gaming |
In-game micro-purchases within session budget |
| ๐ฆ Subscriptions | subscription |
Recurring payments to approved services |
| ๐ DeFi / Trading | defi |
Trades on approved DEXes within risk parameters |
| ๐ข Enterprise / Payroll | enterprise |
Vendor payments with compliance audit trail |
| ๐ค AI Agent Platforms | any | Any LLM making autonomous spending decisions |
| ๐ฆ Institutional | enterprise |
Fireblocks custody + Edge policy = complete stack |
Network: Sui Mainnet โ
Package: 0x2ad62ac22e74172cc2e33cbebd7471fb16403831b3bdd1143d51935cefd1bbde
cd packages/sdk && pnpm test๐ PolicyEngine.validate() 11 tests โ
๐ PolicyEngine helpers 7 tests โ
๐ EdgePass.fromTemplate() 7 tests โ
๐ EdgePass.create() validation 2 tests โ
๐ Constants 5 tests โ
๐ Events system 7 tests โ
39 passed ยท 0 failed โ
git clone https://github.com/fluturecode/edge.git
cd edge && pnpm install
cp apps/web/.env.example apps/web/.env.local
# Add: NEXT_PUBLIC_ENOKI_API_KEY, NEXT_PUBLIC_GOOGLE_CLIENT_ID, ANTHROPIC_API_KEY, GOOGLE_API_KEY
cd apps/web && pnpm dev # โ http://localhost:3000
cd packages/sdk && pnpm test # โ 39 passing
cd packages/sdk && pnpm buildedge/
โโโ ๐ฑ apps/web/ Next.js 15 demo app
โ โโโ app/
โ โ โโโ page.tsx Login โ terminal typewriter, zkLogin
โ โ โโโ auth/callback/ zkLogin callback, Enoki address derivation
โ โ โโโ dashboard/ Main dashboard, EdgePass card
โ โ โโโ dashboard/create/ EdgePass creation + PTB preview
โ โ โโโ dashboard/agent/ ๐ค AI agent demo โ Claude + Gemini
โ โโโ lib/
โ โ โโโ signer.ts zkLogin signer, gas coin resolution
โ โ โโโ zklogin.ts ZK proof generation via Enoki
โ โ โโโ walrus.ts Walrus HTTP API (write/read blobs)
โ โ โโโ seal.ts Seal policy serialization โ not yet encrypted, see Roadmap
โ โโโ app/api/
โ โโโ sign/route.ts Transaction signing + Sui execution
โ โโโ zkp/route.ts ZK proof generation via Enoki
โ โโโ agent/route.ts Claude/Gemini API for autonomous decisions
โ
โโโ ๐ฆ packages/sdk/ @edge-protocol/sdk v2.0.0
โ โโโ src/
โ โโโ core/
โ โ โโโ EdgePass.ts Main API + events + simulate() + withPolicy()
โ โ โโโ PolicyEngine.ts Validation + budget/velocity helpers (37 tests)
โ โ โโโ ExecutionEngine.ts PTB builder + chain execution + fetch (v1 + v2)
โ โ โโโ IdempotencyRegistry.ts Two-phase commit for createWithFireblocks()
โ โ โโโ withFireblocks.ts Hardened Fireblocks settlement HOF
โ โโโ compliance/
โ โ โโโ ComplianceEngine.ts AML / sanctions / risk screening (6th dimension)
โ โ โโโ DynamicIdentityBinding.ts Binds passes to Dynamic enterprise identities
โ โโโ audit/
โ โ โโโ WalrusAudit.ts Real Walrus mainnet audit log storage
โ โโโ react/
โ โ โโโ index.ts useEdgePass, useBudgetStatus, useSimulate
โ โโโ utils/
โ โโโ types.ts All TypeScript types (v1 read-only + v2 create/spend)
โ โโโ constants.ts Templates + Package IDs + MIST_PER_SUI
โ
โโโ ๐ contracts/navis/
โโโ sources/
โโโ edge_pass.move v1 โ deployed, read-only going forward
โโโ edge_pass_v2.move โ
current โ issuer/agent split, velocity limits
- โ zkLogin onboarding โ invisible wallet from Google (salt derivation fixed)
- โ EdgePass creation โ real Move object on Sui mainnet
- โ PolicyEngine โ pure TypeScript, zero network
- โ Two-layer enforcement โ TypeScript preview + Move contract source of truth
- โ Human-in-the-loop escalation โ agent pauses, awaits human approval via modal
- โ
Events system โ
on('approved'),on('escalated'),on('blocked') - โ simulate() โ predict full session outcomes before touching the chain
- โ
Budget helpers โ
budgetStatus(),isNearLimit(),timeRemaining() - โ withPolicy() โ wrap any AI tool with on-chain enforcement in one line
- โ
React hooks โ
useEdgePass,useBudgetStatus,useSimulate - โ ๐ค Live AI agent demo โ Claude + Gemini, real autonomous decisions
- โ
Seal policy serialization โ
lib/seal.tsturns the policy into a JSON string today; it is plaintext, not encrypted. Real Seal encryption and network storage are both still pending key server deployment - โ Move contract โ deployed to Sui mainnet
- โ SDK on npm โ @edge-protocol/sdk
- โ EdgePassV2 โ issuer/agent separation: a human grants and revokes, an agent spends, neither can do the other's job
- โ Merchant scope can only narrow, never widen, after minting โ not even the issuer can add merchants back
- โ
Rolling velocity windows โ
velocityCap/velocityWindowMs, replaces the oldmaxTransactionsPerHouridea with an on-chain-enforced rate limit - โ
Hard per-transaction ceiling (
maxPerTransaction) โ required and enforced on chain, not just advisory - โ
On-chain denials โ a
blockedoutcome can be recorded as an aborted transaction, so the refusal itself is independently verifiable on Suiscan - โ Approved merchants moved from display names to addresses โ enforceable, not just cosmetic
- โ
Upgraded to
@mysten/suiv2 +@mysten/walrusv1 โ unblocked real Walrus storage - โ Real Walrus blob storage โ the demo app writes to public mainnet publishers with a local mock fallback only if every publisher is unreachable
- โ
Two-Phase Commit / Idempotency โ
createWithFireblocks()with retry-safeidempotencyKey - โ Compliance Engine (6th dimension) โ AML / sanctions / risk screening, pluggable providers
- โ Dynamic Identity Binding โ bind a pass to a Dynamic enterprise session via JWT
- โฌ Managed escalation dashboard โ proprietary SaaS approval UI
- โฌ On-chain policy signatures โ tamper-proof policy commitment
- โฌ Multi-token support โ USDC, USDT, any Sui coin
- โฌ Tool-use architecture โ agent decides one transaction at a time, sees results
- โฌ Enterprise guardrails โ SOC2, SIEM
- โฌ Cross-agent coordination โ multi-agent quorum execution
- โฌ Intent-based policies โ natural language โ on-chain rules
- โฌ Cross-chain EdgePasses
Before Stripe, every developer built their own payment processing. After Stripe, you call stripe.charge().
Edge is stripe.charge() for autonomous agent trust.
PROPRIETARY (future business):
Managed escalation UI ยท Enterprise auth ยท Policy feeds ยท Compliance exports
OPEN SOURCE (always free):
TypeScript SDK ยท Move contracts ยท Walrus audit parsers ยท PolicyEngine
The SDK, Move contracts, and PolicyEngine are and will always be open source.
The agentic economy is already here. Every autonomous agent that touches money needs a trust boundary. Today, every team builds their own. With Edge, every team ships in a day.
The best infrastructure is invisible.
Built with โฅ by @fluturecode for Sui Overflow 2026 โ Agentic Web track.
pnpm add @edge-protocol/sdk