Misogi simulates every transaction and signature, checks who is on the other side and holds it to your rules before anything is signed. Agents spend from a Safe within their charms; drainers, hidden instructions and look-alike addresses are turned away.
支払先を、清める。
example data
Try it
Also in
Good morning
Everything is settled.
Your agent pays vendors in USDC on Ethereum. Every payment passes the same five checks, and anything unusual waits for you.
Recent activity
Before every payment
Domain checkThe address must be the payout registered for that domain.
Approved vendorOnly domains on your list get paid without asking.
LimitsPer payment, per day and per vendor each month.
Not paid beforeThe same invoice reference is never paid twice.
Your approvalAnything over a limit waits for your passkey.
The model proposes. These checks decide.
Agent
Hand it a document. Watch it decide.
Pick something from the inbox. The model reads it and proposes a payment. Five checks written in plain code decide what actually happens, so a convincing scam can change the proposal but never the outcome.
Inbox
example documents
Agent run
Approvals
Waiting for you
These passed the domain check but went over a limit, or came from a vendor you have not approved yet. Approving pays this one invoice, once, to the registered address.
Rules
What the agent may pay on its own
If the agent is ever compromised, these limits are the most it can spend. Anything above them waits for your approval.
Registry
Check a domain before you pay it
Paste the address from an invoice or an email. Misogi tells you whether it is the payout that domain registered.
Payout changes in progress
Register your domain
Add one DNS record
It says which address receives payments, and on which network.
Misogi reads the record from several resolvers, then writes the domain and address to the registry on Ethereum.
Changes wait 72 hours in public
A new address only takes effect after 72 hours. Payers keep paying the old one, and you can cancel if you did not ask for it.
Agent purchases · x402
Agents buy compute and data. Misogi checks who they pay.
A merchant names its domain in the 402 response. Before the agent signs, the guard compares the requested pay-to address with that domain's registered payout. A hacked server can edit its own response. It cannot edit the registry.
A research agent, shopping for a job
Unregistered merchants: up to $2 after screening
History
Every decision, with its reason
Paid, held and refused payments, including who approved them. Copy it as CSV for your books.
When
Payee
Reference
Amount
Result
Decided by
道具Build · Docs
Misogi documentation
Everything you need to use Misogi, connect agents and run it yourself on Ethereum mainnet.
Introduction
Misogi is the gate every onchain action passes through before it is signed. Agents, bots and people send a transaction or a signature; Misogi decodes it, simulates it against Ethereum mainnet, checks who is on the other side and holds it to your rules.
PassEverything checks out. The action is signed and sent.
WaitSomething needs a human. You approve that one action with a passkey.
Turn awayA rule or a threat was hit. Nothing is signed, and the reason is shown.
Agents never hold the keys to your money. They spend from your Safe through the Omamori module, which enforces each agent's limits onchain, so even a compromised server cannot exceed them.
Unaudited software. The contracts and services are complete and tested on a local fork, but have not been audited. Start with a Safe that holds only what agents are meant to spend.
Quickstart
Sign in with your wallet
Press Enter the shrine. Misogi uses Sign-In with Ethereum, so there is no password.
Add a passkey
Approvals and unsealing need a passkey (Face ID, Touch ID, Windows Hello or a security key). It is bound to one request each time.
Connect your Safe in Honden
Paste your Safe address and the Omamori module address. Misogi prepares the enableModule batch for the Safe app.
Create an agent in Kitsune
Give it a name, the addresses it may pay or call, spending caps per token per period, and an expiry. Sign the grant in your Safe, then press Confirm grant. The API key is shown once.
Plug the agent in
Use the SDK, the MCP server for Claude or Cursor, or the Telegram bot. Every action goes through the gate.
import { Misogi } from '@misogi/sdk';
const misogi = new Misogi({ apiKey: process.env.MISOGI_AGENT_KEY!, baseUrl: 'https://api.yourdomain.com' });
// Plain words, English or Indonesian. It still passes the gate.const r = await misogi.say('send 20 usdc to vitalik.eth');
console.log(r.verdict, r.summary, r.txHash);
How the gate decides
Every action runs through the same checks, in order. Each check adds findings; the strongest finding decides the verdict.
Temizuya · clean the inputText an agent read is cleaned first: hidden HTML, zero-width and tag characters, Morse and base64 commands, injected instructions.
Yata no Kagami · simulateeth_simulateV1 against the latest block (falls back to eth_call): balance changes, approvals, EIP-7702 delegations, Permit, Permit2 and Seaport signatures.
Kasagi and Shide · who is on the other sideENS, ERC-8004 agent identity, the Kasagi domain registry, Etherscan verification and age, GoPlus, ScamSniffer, address-poisoning look-alikes.
Shimenawa · your rulesPer-action and daily USD limits (Chainlink prices), new-recipient waiting period, unlimited approvals, young contracts, blocked tokens.
Omamori · the agent's charmAllowed targets, caps per token per period, expiry and the gate co-signature, enforced again onchain by the Safe module.
Gate result
{
"verdict": "wait", // "pass" | "wait" | "refuse"
"summary": "New recipient: first payment to 0x8d…31 waits 24 hours",
"findings": [
{ "feature": "shimenawa", "level": "wait", "text": "First payment to this address", "forces": "wait" },
{ "feature": "kagami", "level": "info", "text": "−20 USDC from your Safe, +20 USDC to 0x8d…31" }
],
"valueUsd": 20
}
All 29 features
Seven zones, one gate. Each card lists what the feature does and where to reach it in the API.
鳥居 Gate
Every action passes the torii before it is signed.
鳥居
Torii
The gate that marks the line between the outside world and sacred ground.
Every transaction and signature is decoded, simulated and checked against your rules. The answer is Pass, Wait or Turn away, with the reason.
POST /v1/gate/tx
POST /v1/gate/signature
八咫鏡
Yata no Kagami
The sacred mirror hung to draw Amaterasu out of the cave. It shows things as they are.
Simulates the transaction against mainnet state and shows exactly which balances change, which approvals are granted and what gets delegated.
POST /v1/gate/tx (simulation inside every check)
手水舎
Temizuya
The water pavilion where visitors purify their hands before entering.
Cleans tweets, emails, documents and web pages before an agent reads them: hidden text, invisible unicode, encoded commands and injected instructions are quarantined.
POST /v1/temizuya
POST /v1/agent/purify
注連縄
Shimenawa
The sacred rope that marks a boundary not to be crossed.
Your rules: per-transaction and daily limits, allowed recipients, approval caps, and a waiting period before new recipients or changed rules take effect.
GET /v1/me
PUT /v1/me/policy
紙垂
Shide
Zigzag paper streamers shaped like lightning, marking what is pure.
A clear label on every address, token and contract: safe, caution or danger, with the evidence behind it.
Labels on every gate finding
GET /v1/kasagi/:address
狛犬 Guardians
Watchers that never sleep, and the way out when things go wrong.
狛犬
Komainu
The pair of lion-dogs at the shrine entrance, one mouth open (a), one closed (un).
Two watchers on your wallets. A watches what comes in (dust, poisoned lookalikes, bait NFTs). Un watches what goes out (new approvals, delegations, unusual transfers).
GET /v1/komainu
POST /v1/komainu
DELETE /v1/komainu/:id
黄泉
Yomi
The land of the dead, whose entrance Izanagi sealed with a boulder.
A blocklist of drainers and scam addresses, synced from public threat feeds and your own reports. Nothing passes to them.
GET /v1/yomi
POST /v1/yomi/report
天岩戸
Ama-no-Iwato
The cave where Amaterasu hid, sealing the light inside.
Emergency seal: one action freezes every agent, revokes their charms and prepares the revoke transactions for every open approval.
POST /v1/iwato/seal
POST /v1/iwato/unseal/options
POST /v1/iwato/unseal/verify
草薙剣
Kusanagi
The sword Yamato Takeru used to cut the grass and escape a ring of fire.
Recovery for a Safe: guardians you choose can replace a lost or stolen owner key after a public delay that the owner can cancel.
KusanagiRecovery contract
PUT /v1/honden
狐 Messengers
Your agents, the charms that limit them, and the priest who approves.
狐
Kitsune
Foxes, the messengers of Inari.
Your agents. Each one has an API key, a charm that limits it, and a timeline of everything it tried to do.
GET /v1/agents
POST /v1/agents
PUT /v1/agents/:id/charm
POST /v1/agents/:id/revoke
POST /v1/agents/:id/rotate-key
お守り
Omamori
A protective charm carried everywhere.
Onchain session limits for each agent, enforced by a Safe module: allowed contracts, spend caps per token per period, and an expiry date.
OmamoriModule contract
POST /v1/agents/:id/confirm-grant
GET /v1/agents/:id/remaining
神主
Kannushi
The priest who performs the rites.
Human approval with a passkey. When an agent asks for something outside its charm, you approve that one action, once.
GET /v1/approvals
POST /v1/approvals/:id/options
POST /v1/approvals/:id/verify
POST /v1/approvals/:id/reject
神楽
Kagura
The sacred dance, repeated in rhythm.
Recurring strategies run by your agent inside the gate: dollar-cost averaging and limit orders through CoW Protocol, and scheduled transfers.
GET /v1/kagura
POST /v1/kagura
PATCH /v1/kagura/:id
DELETE /v1/kagura/:id
賽銭 Offerings
Payments, tasks, receipts and recurring flows.
賽銭
Saisen
The offering box where coins are tossed.
Pay-per-use with x402: before an agent pays for an API call, the guard checks who will receive the money and how much.
POST /v1/agent/saisen
POST /v1/agent/saisen/:id/paid
POST /v1/saisen/check
絵馬
Ema
Wooden plaques where visitors write their wishes.
A task board with onchain escrow. Post a task and its reward, an agent or person takes it, and the reward is released when you accept the result.
EmaBoard contract
GET /v1/ema
POST /v1/ema/draft
御朱印
Goshuin
The shrine seal stamped into a pilgrim's book.
An onchain receipt (an EAS attestation) for every payment that passed the gate and every task completed. Together they form a reputation.
EAS attestations
GET /v1/goshuin
千本鳥居
Senbon Torii
The thousands of gates lining the path at Fushimi Inari.
Recurring payments: payroll, subscriptions and allowances. Each payment passes its own gate when it is due.
GET /v1/senbon
POST /v1/senbon
PATCH /v1/senbon/:id
DELETE /v1/senbon/:id
神輿
Mikoshi
The portable shrine carried from place to place.
Bridge check before assets leave mainnet: is this the canonical bridge, is the contract verified, and does the simulation send funds where you expect.
POST /v1/mikoshi
御神籤 Fortune
Tools for traders: token fortunes, cleansing, lanterns on the path.
御神籤
Omikuji
Fortune slips drawn at the shrine, from great blessing to great curse.
Token check before you buy: honeypot, buy and sell tax, mint and owner powers, liquidity and holders, graded from Daikichi to Daikyo.
GET /v1/omikuji/:token
結び
Musubi
Bad fortunes are tied at the shrine so the misfortune stays behind.
Tie a token and leave it: it is hidden from your views and every transaction that touches it is turned away.
POST /v1/musubi
灯籠
Toro
Stone lanterns that light the path to the shrine.
Alerts: price levels from Chainlink feeds and activity from wallets you watch.
GET /v1/toro
POST /v1/toro
DELETE /v1/toro/:id
祓串
Haraegushi
The purification wand the priest waves over people and things.
Cleanse a wallet: every open token and NFT approval with its risk, the transactions to revoke them, and a check for EIP-7702 delegations.
GET /v1/haraegushi/:address?
笠木 Identity
Who is on the other side, and how far to trust them.
笠木
Kasagi
The top beam of the torii, resting above everything.
Who is on the other side: ENS, ERC-8004 agent identity, verified contracts, domains registered in the Kasagi registry, and your own address book.
GET /v1/kasagi/resolve?q=
GET /v1/kasagi/:address
POST /v1/kasagi/register
GET|POST|DELETE /v1/book
勾玉
Magatama
The curved sacred jewel, one of the three imperial treasures.
A trust score for any address or agent, built from age, verification, identity, threat feeds and Goshuin receipts.
GET /v1/magatama/:address
本殿
Honden
The innermost hall where the kami dwells.
Your vault: a Safe that agents can never touch directly, with Omamori and Kusanagi modules attached.
GET /v1/honden
PUT /v1/honden
言霊 Daily
Plain words in, guarded actions out. Morning briefs and audits.
鶏
Niwatori
The roosters set on a perch to crow the sun goddess out of her cave.
A morning brief: balances, what your agents did overnight, what is waiting for you and what changed.
GET /v1/niwatori
PUT /v1/me/settings
言霊
Kotodama
The belief that words carry spirit and power.
Say it in plain words, in English or Indonesian. Misogi turns it into a transaction that still passes the gate.
POST /v1/kotodama
POST /v1/agent/intent
参道
Sando
The path that leads to the shrine.
The timeline: every request, check, approval and result, in order.
GET /v1/sando
GET /v1/sando/:id
POST /v1/sando/:id/sent
GET /v1/events
大祓
Oharae
The great purification held at the end of June and December.
A scheduled audit of every wallet and agent: approvals, delegations, charms close to expiry, risky tokens and threat-feed hits.
GET /v1/oharae
POST /v1/oharae/run
Agent SDK
The TypeScript SDK is a thin client over the REST API. Agent keys start with msk_ and are created in Kitsune.
pnpm add @misogi/sdk # or use packages/sdk from the repo
Method
What it does
me()
Who am I, which Safe I spend from, my limits and whether the gate is sealed.
check(action)
Ask the gate without doing anything. Returns the verdict and the charm findings.
execute(action)
Check, then sign and send through Omamori if it passes. Wait creates an approval request.
executeOrThrow(action)
Same as execute, but throws TurnedAway when the gate refuses.
say(text)
Kotodama: plain words become a transaction that still passes the gate.
payInvoice({to, amount, token, invoiceId})
Pay an invoice by domain, ENS or address.
request(id)
Status of one request: waiting, approved, executed, rejected or failed.
waitFor(id, {timeoutMs, intervalMs})
Poll until a human approves or rejects.
purify(text, {html, source})
Temizuya: clean text before the model reads it.
omikuji(token)
Token fortune from Daikichi to Daikyo, with reasons.
magatama(address)
Trust score 0 to 100 with its factors.
resolve(query)
Resolve a domain, ENS name or label to an address, with Yomi blocklist status.
saisen(resource, requirements)
Check an x402 payment request before paying.
saisenPaid(requestId, txHash?)
Record that an x402 payment was made.
Pay safely, or wait for a human
const res = await misogi.execute({ to: '0xA0b8…eB48', data, title: 'Pay invoice INV-2241' });
if (res.verdict === 'pass') console.log('sent', res.txHash);
if (res.verdict === 'wait') {
const done = await misogi.waitFor(res.requestId, { timeoutMs: 30 * 60_000 });
console.log(done.status); // "executed" once you approve with your passkey
}
if (res.verdict === 'refuse') console.log('turned away:', res.summary);
x402 with the Saisen guard
import { saisenFetch } from '@misogi/sdk';
// pay() is your x402 payer; Saisen checks recipient and amount before it runs.const guardedFetch = saisenFetch(misogi, pay);
const res = await guardedFetch('https://paid-api.example/v1/answer');
Errors
Error
When
MisogiError
HTTP error from the API (status, message, body).
TurnedAway
Thrown by executeOrThrow when the verdict is refuse (summary, findings, requestId).
REST API
Base URL https://api.yourdomain.com/v1. People sign in with SIWE and send Authorization: Bearer mss_… (session). Agents send Authorization: Bearer msk_…. Bodies are JSON; big integers are strings. Errors return {"error": "…"}; a refused gate check returns 422 with the full result.
Shimenawa rules live on your account. Tightening applies at once; loosening is staged and needs your passkey.
Rule
Default
Meaning
perTxUsd
250
Most one action may move without asking.
dailyUsd
1,000
Most all actions together may move in a day.
newRecipientHours
24
First payment to a new address waits this long.
unknownRecipient
wait
What to do with an address you have never paid.
unlimitedApproval
wait
Unlimited token approvals.
youngContractDays
30
Contracts younger than this need a human.
unpricedOutflow
wait
Tokens without a Chainlink price.
x402MaxUsd
1
Most per x402 purchase without asking.
allowedContracts
[]
Contracts that skip the young-contract rule.
allowedDelegates
[]
EIP-7702 delegates you trust.
blockedTokens
[]
Tokens tied with Musubi.
Self-hosting
One server runs four services that share one SQLite file. Only the signer holds keys, and it publishes no port.
Service
Role
api
Public HTTP API on :8787 behind HTTPS.
signer
The only process with private keys (agent keys AES-256-GCM encrypted). HMAC-authenticated, private network only.
worker
Komainu, Toro, Kagura, Senbon, Ema indexer, Niwatori, Oharae, request expiry.
bot
Telegram bot (optional profile).
web
Static site (Vite build) on any host.
Steps
pnpm install
cd packages/contracts && forge install foundry-rs/forge-std --no-git && cd ../..
cp .env.example .env # fill RPC, Etherscan, keys (see below)
openssl rand -hex 32 # SIGNER_SHARED_SECRET
openssl rand -hex 32 # SIGNER_MASTER_KEY (back it up)
cast wallet new # GATE_PRIVATE_KEY, SEALER_PRIVATE_KEY, KASAGI_ATTESTER_PRIVATE_KEY
docker compose up -d --build # signer, api, worker
docker compose --profile telegram up -d bot # optional
VITE_API_URL=https://api.yourdomain.com pnpm --filter @misogi/web build
Required settings
Variable
What
MISOGI_RPC_URL
Mainnet RPC with eth_simulateV1 (Alchemy, QuickNode, Infura or your node).
ETHERSCAN_API_KEY
Contract source, age and history.
SIGNER_SHARED_SECRET
HMAC between services.
SIGNER_MASTER_KEY
Encrypts agent keys.
GATE_PRIVATE_KEY
Gate co-signer; its address goes into each Omamori module.
WEBAUTHN_RP_ID · WEBAUTHN_ORIGIN · SIWE_DOMAIN
Your web app domain.
KASAGI_REGISTRY · EMA_BOARD
Addresses from Deploy.s.sol.
TELEGRAM_BOT_TOKEN
Optional, for the bot and alerts.
Security model
Keys live only in the signer. The api, worker and bot call it with HMAC-signed requests; it re-checks Yomi and the charm before signing.
Limits are onchain. Omamori enforces targets, caps and expiry in the Safe module. With the gate co-signature on, every action also needs the gate's EIP-712 signature.
Loosening waits. Raising a limit needs a passkey; new recipients wait the configured hours.
One button to stop. Ama-no-Iwato freezes every agent and calls seal() onchain. Unsealing needs a passkey.
Recovery. Kusanagi guardians can replace a lost owner after a public delay that the Safe can cancel.
Not audited. Get an audit before holding significant value.
Troubleshooting
The agent was turned away with "OverCap".
The amount is above the charm cap for this period. Wait for the period to reset, or raise the cap in Kitsune (needs a Safe signature).
"CharmExpired" or "NoCharm".
The charm expired or was revoked. Prepare a new charm in Kitsune and sign the grant in your Safe.
"GateSignatureRequired".
The charm requires the gate co-signature. Send the action through Misogi, not directly to the module.
"ModuleSealed".
Ama-no-Iwato is closed. Unseal it from the app with your passkey.
Simulation shows fewer details.
Your RPC does not support eth_simulateV1, so Misogi fell back to eth_call. Use a provider that supports it.
The agent has no gas.
Each agent address pays its own gas. Send it a little ETH; Kitsune shows the balance.
Panduan singkat (Bahasa Indonesia)
Masuk dengan wallet
Tekan Enter the shrine dan tanda tangani pesan Sign-In with Ethereum.
Tambahkan passkey
Dipakai untuk menyetujui aksi dan membuka segel. Setiap persetujuan hanya berlaku untuk satu aksi.
Sambungkan Safe di Honden
Tempel alamat Safe dan modul Omamori, lalu tanda tangani batch di aplikasi Safe.
Buat agen di Kitsune
Tentukan tujuan yang boleh, batas per token per periode dan masa berlaku. API key hanya ditampilkan sekali.
Hubungkan agen
Lewat SDK, server MCP, atau bot Telegram. Setiap aksi lewat gerbang: Lolos, Tunggu, atau Ditolak. Darurat? Tekan Ama-no-Iwato.
Approve with passkey
Pay $0
Press and hold to approve
In this demo the hold stands in for your device passkey (fingerprint or face).
Connect your wallet
Sign in with an Ethereum wallet. Misogi asks for one signature to prove the address is yours; it never moves funds.