HTTP Middleware & Agent Tool Schema

Add MpcFirewall in front of any Python, LangGraph, CrewAI, Eliza, or TypeScript agent using plain HTTP requests and standard LLM tool schemas.

Pre-Flight Inspection Request

Send any proposed transaction to POST /api/inspect before signing. The response tells your agent whether to proceed, escalate to the team DAO, or abort with exact human-readable reasons.

typescriptInspect & Gate Transaction
// Call /api/inspect before letting your agent sign or broadcast any transaction
const res = await fetch('https://mpc-firewall.netlify.app/api/inspect', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    chainKind: 'evm',
    rawUnsignedHex: unsignedEip1559Hex,
    agentIntent: 'Pay vendor #402 25 USDC on Base for monthly API invoice'
  })
});

const { data } = await res.json();
const { decision, teeAudit, mpcDispatch, daoProposalPayload } = data.record;

if (decision.outcome === 'BLOCKED') {
  throw new Error(`Transaction rejected: ${decision.reasons.join('; ')}`);
}

Ready-to-Use LLM Tool Schema

jsonOpenAI / Anthropic / NEAR AI Function Schema
{
  "type": "function",
  "function": {
    "name": "mpc_firewall_inspect_tx",
    "description": "Inspect raw unsigned EVM or Bitcoin transaction bytes before MPC signing to verify spend caps, calldata safety, and alignment with user intent.",
    "parameters": {
      "type": "object",
      "properties": {
        "chainKind": { "type": "string", "enum": ["evm", "bitcoin"] },
        "rawUnsignedHex": { "type": "string", "description": "0x-prefixed EVM RLP tx or raw BTC tx hex" },
        "agentIntent": { "type": "string", "description": "Plain-English summary of what the agent intends to do" },
        "bip143Input": {
          "type": "object",
          "properties": {
            "inputIndex": { "type": "integer" },
            "prevoutValueSats": { "type": "string" },
            "scriptCodeHex": { "type": "string" }
          },
          "required": ["inputIndex", "prevoutValueSats", "scriptCodeHex"]
        }
      },
      "required": ["chainKind", "rawUnsignedHex", "agentIntent"]
    }
  }
}

Available API Endpoints

RouteMethodPurpose
/api/inspectPOSTDecode raw EVM/BTC hex, evaluate policy + TEE audit, return dispatch or DAO proposal
/api/near/executePOSTBroadcast verify_and_sign_evm, verify_and_sign_btc_bip143, or dao_add_proposal on Testnet (12 TX/min cap)
/api/policyGET / PATCH / POSTRead/patch spend rules or reset sandbox state (auth-gated when REQUIRE_ADMIN_AUTH=true)
/api/intents/quote & /tokensPOST / GETQuery live 1Click cross-chain swap tokens and dry quotes with explicit depositType
/api/near/account & /healthGETCheck live v1.signer-prod.testnet key status and server config
/api/presetsGETFetch all 7 real-byte safe, escalation, and attack scenarios